In our application a Service Reference was added to connect to a SOAP Web Service. When connecting to the Web Service we get an error. The owner of the web service told us that the error was caused because we use SOAP 1.2 and theirs web service only supports SOAP 1.1.
This answer mentions to add a textMassageEncoding setting in our custom binding. But it is not clear where to add this setting. Where should this setting been added?
Instead of adding a Service Reference add a Web Reference. I use VS 2013 (VS 2017 is exactly the same), right click on project name in Solution Explorer, select add then Service Reference, click Advanced button, click Add Web Reference at the bottom. Web references are a bit dated, but I use them all the time because I have a ton of legacy software, including android and iOS apps that use them. RESTful apis are typically the most used api these days.
Related
I am trying to add a asmx web service to one windows forms app by following way ->
Right click- > add service reference.
But it seems the service is added under connected service folders only. not under service reference . Is this an expected behavior?
or are we supposed to use web reference instead of service reference for windows forms application?
To answer this question you need to know the difference between Webservice and WCF web service and you'll find that
Here.
Anyway, I'ts a noraml behavior, let's form that in another words, the Service reference will let you communicate with a WCF-based services whatever those services are, but with the web reference, you can only communicate with web services under some conditions.
I would use service reference always because it gives more options including those in web service, and it's the new-easy way.
I have consumed several wsdl services successfully, but am stuck now with this web service.
Am implementing Hotelston webservice which state :Hotelston.com API is a standard SOAP Web Service (WS) available at URL
http://www.hotelston.com/ws/HotelService?wsdl
I cant access the direct code of the webservice after i added the it as a reference in my application.
Please see the following MSDN articles for the exact details on how I added and used these web service references but still cant access it from the direct code.
How to: Add and Remove Web References
How to: Call a Web Service
For full API documentation of wsdl file through the link.
If you show all files in the project and expand the service reference out, Reference.cs is empty. This is likely because there are namespace errors in HotelService.wsdl ("ax23", specifically) that is causing the t4 template to fail to generate the service code. Bottom line, it's their fault, not yours.
I've started working on Windows Phone 7 and came across this problem.
I have a VS 08 console application that has a Web reference added to it and every thing works great, I have previously worked with Service Reference in WP7 and used the proxy classes.
I am not good in server side stuff and am not sure about the difference between Web and Service References i think Service refernce is for WCF only and Web supports SOAP as well, Any ways now i need to use that web Reference which is using SOAP Protocol in WP7 but when i add it as Service reference it doesn't show all proxy classes in object explorer.
Wasted 2 days in googling this and still I am not sure where to start. kindly Let me know if you have any questions.
Please HELP !
You should be able to add the web reference and coding for it will be similar to coding in your console app.
The main differences will be that WP7 requires you to use Asynchronous coding - i.e. instead of calling the service like a normal method, instead you have to pass in an event handler for when the web service call returns.
A partial tutorial is available within this article -
http://msdn.microsoft.com/en-us/magazine/ff872395.aspx - start at "Figure 6 Adding a SOAP Service Reference"
There are also some additional limitations in the WP7 implementation - e.g. it's harder to send certain things like soap headers - but hopefully your SOAP service will work OK.
One of our C# ASP.Net projects has some dependencies on the Microsoft WSE 3.0 library, in order to consume a WSE3.0 web service. However, we're migrating the project to Windows Server 2008, which does not support WSE3.0.
So I need to refactor the code to remove the dependency to WSE 3.0 but still maintain its functionality. The code is simply adding a username security token to the SOAP context and then invoking the web service. I'm not sure where to start though. I suspect I switch to WCF, and if so, is there any tutorial available online to help?
I'd start by creating a simple application, maybe a Console application, to be a test consumer of the existing web service. Create client proxy classes for this application by using "Add Service Reference", and pointing it to the existing WSE service. That should take care of most of the problems.
Once the simple console application works, you can do the same for your ASP.NET project.
Needless to say, it's way past time to update that WSE service to WCF, which is supported, and which will continue to be supported for a long time to come.
This article is a pretty good rundown of the differences between WSE 3.0 & WCF and migration recommendations. I'd start by getting the migrated service to run under the basicHttpBinding configuration (without user name/password authentication).
Once the service is running as expected and look at this article to see how to get the migrated service configured for user name/password authentication. The article is written for Silverlight use but there should be enough in it to get you going.
Can webservices be accessed by Silverlight 3? On VisualStudio, a Silverlight project doesn't allow me to add a "web reference" but only a "web service reference" that is for WCF and not "normal" webservices.
Any help?
Thanks
Sure you can. In your web project, add a new asmx webservice and add whatever functions you want. Then build your web project.
Next, go to your silverlight project, right click on Service References, select Add Service reference. If you then hit the Discover button in the dialog that pops up, it should discover your new web service. If it doesn't, then you can manually enter the url to it - if you have Cassini running (press F5 in your web project, then close the browser window once launched, Cassini will continue to run in the background) just enter http://localhost:[port]/MyWebService.asmx as the address. The [port] is whatever port you have Cassini running on for this particular project).
Also don't forget to kee the cross domain limitations and work arounds in scope when considering any implementation:
http://timheuer.com/blog/archive/2008/04/06/silverlight-cross-domain-policy-file-snippet-intellisense.aspx
Also there is a great MIX video on this:
Consuming Web Services in Microsoft Silverlight 3
Description: Come hear how to work with external REST, SOAP, and Windows Communication Foundation (WCF) services from Silverlight. Learn how to securely and efficiently communicate with services using Binary XML, debug services with improved Faults support, and implement server-to-client "push" using the new Add Service Reference for Duplex functionality.
http://videos.visitmix.com/MIX09/T42F