.NET     Console.WriteLine( "All Things .NET" );
.NET Nerd Blog Home
7.29.2002

 

Manually Create Web Service Reference

This probably falls under the "duh - that's obvious" category, but wanted to blog it anyway.

The IDE doesn't seem to like adding a web reference (web service) for something that runs on a non-standard port (i.e. not on port 80). Even though I enter the other port (i.e. http://blah.com:8000/foo.asmx), it ends up binding the proxy class to the standard http port 80.

So...run WSDL (thanks for the idea Kral) and generate the proxy class yourself.
wsdl http://blah.com:8000/foo.asmx?WSDL (remember to add the ?WSDL - this is what generates the wsdl xml that the tool is expecting as a return value)

This generates the output file containing the proxy class, which you add to your project just like any other cs file. Then create an instance and you're off and running.

NOTE: Looks like the generated proxy class still left off the non-standard port, so just manually edit that line in the ctor once and for all.
this.Url = "http://blah.com:8000/foo.asmx";


Comments: Post a Comment

Powered by Blogger