wdsl to create a proxy class
-
Hi All, I have a wdsl file and I need to create the proxy class to be able to call a web service from a .net application. Do I need the URL link of the web service in order to call the service? I use the following syntax to generate the proxy class from wdsl as follows wsdl /language:cs /protocol:soap c:\wdsl\Service1.wdsl How do I import into my .net application that will call the class? How do I call the service if I don't have the url link? Sorry I am new to this Thanks
-
Hi All, I have a wdsl file and I need to create the proxy class to be able to call a web service from a .net application. Do I need the URL link of the web service in order to call the service? I use the following syntax to generate the proxy class from wdsl as follows wsdl /language:cs /protocol:soap c:\wdsl\Service1.wdsl How do I import into my .net application that will call the class? How do I call the service if I don't have the url link? Sorry I am new to this Thanks
You do need the URL yes but you could host it locally for testing. Rather than use the command line, it might be easier for you to just add a Web Reference to the .net project directly. This will create your proxy class and add the URL of the webservice to your web.config. That way you can change this to a production server on release. This is explained here: http://msdn.microsoft.com/en-us/library/ms169816.aspx
-
You do need the URL yes but you could host it locally for testing. Rather than use the command line, it might be easier for you to just add a Web Reference to the .net project directly. This will create your proxy class and add the URL of the webservice to your web.config. That way you can change this to a production server on release. This is explained here: http://msdn.microsoft.com/en-us/library/ms169816.aspx
Rhys, Thanks for the reply, the problem is that I only have the wsdl file without the URL. I have added the file from c:\work.wsdl to Service References and created the reference.cs, Reference.svcmap and the configuration.svcinfo. However it seems not possible to create the URL locally for testing just from the wsdl. Any ideas? Thanks
-
Rhys, Thanks for the reply, the problem is that I only have the wsdl file without the URL. I have added the file from c:\work.wsdl to Service References and created the reference.cs, Reference.svcmap and the configuration.svcinfo. However it seems not possible to create the URL locally for testing just from the wsdl. Any ideas? Thanks
It's going to be difficult to test without an actual web service to test against. Is it a commercial service? If so they should have a test service for you to code against? If not you could create a mock webservice of your own. You know the methods and return types from the wsdl so you could code against that.