Answered by:
Problem when consuming webservice

Question
-
User514096037 posted
Hi!
I have a web application that accesses a webservice for several months.
This webservice is from another company. So far everything worked well, I'm using the framework 4.0, and I added a Service Reference to my website.However, the webservice was changed and now when I try to add it to my project, using the Add Service Reference, my web.config change as follows:
<system.serviceModel> <bindings> <customBinding> <binding name="ConsultaUtenteBindingQSService1_ConsultaUtenteBindingQSPort1"> <!-- WsdlImporter encountered unrecognized policy assertions in ServiceDescription 'http://xmlnssns.min-saude.pt/ConsultaUtente': --> <!-- <wsdl:binding name='ConsultaUtenteBinding'> --> <!-- <sp:SupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">..</sp:SupportingTokens> --> <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap11" writeEncoding="utf-8"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> </textMessageEncoding> <httpTransport manualAddressing="false" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard" keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous" realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" useDefaultWebProxy="true" /> </binding> </customBinding> </bindings> </system.serviceModel>
Just for the record I try do "Add Web Reference" and It work, but I want to be able to work with a newer version of the framework and not go backwards.
Any Ideias???
Thanks in advance.
Regards.
Tuesday, February 26, 2013 12:07 PM
Answers
-
User1291589676 posted
If the service you are consuming is normal webservice(.asmx) then you have to use add webreference only. In case you are trying to add wcf servicess(.svc) then you can add via addservicereference.
For more details about servicereference and webreference see the below links,
http://stackoverflow.com/questions/308454/difference-between-web-reference-and-service-reference
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, March 6, 2013 4:53 AM
All replies
-
User-1000095884 posted
Hi,
Just for the record I try do "Add Web Reference" and It work, but I want to be able to work with a newer version of the framework and not go backwards.If you mean you can consume the service with "Add Web Reference" but not with "Add Service Reference" for a client, please check the .NET version of the clients, the proxies generated with "Add Service Reference" can only be consumed by .NET 3.0+ clients.
#The Difference Between “Add Web Reference” and “Add Service Reference”
Best Regards.
Tuesday, March 5, 2013 3:27 AM -
User514096037 posted
Hi,
I'm working with Visual Studio 2010, Framework 4.0.
In my previous version off my web application, I still use VS 2010/framewok 4.0, and I was able to consume the webservices, using "Add Service Reference".
But now my webservice provider, appears to have changed something in the webservices that I'm not able to add it to my aplication, using the "Add Service Reference".
Now, the only way I' able to work with that webservice, is with "Add Web Reference".
Any Ideas?
Thanks.
Regards.
Wednesday, March 6, 2013 4:47 AM -
User1291589676 posted
If the service you are consuming is normal webservice(.asmx) then you have to use add webreference only. In case you are trying to add wcf servicess(.svc) then you can add via addservicereference.
For more details about servicereference and webreference see the below links,
http://stackoverflow.com/questions/308454/difference-between-web-reference-and-service-reference
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, March 6, 2013 4:53 AM