Web Services and Web References

When consuming a web service in .NET there are two main techniques for accessing the web service. The first is to use a web reference. The second is to use wsdl to create a proxy class.
For some strange reason Microsoft exams prefer the first.

However I would recommend the second. This is far easier (via a subclass) to create a proxy that explicitly requires the url to be specified. This came in handy on a project that communicates to many instances of a second app via web services. We have the one web service that is instantiated at a number of locations. By parameterising the web service we are able to allow the user to specify the location of the web service and to choose between them at run time.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s