Verify Correct Implementation in Web Services

S

Soul

Hi,

I have a Windows Application and multiple Web Services, all Web Services
will implement the same interface. My Windows Application allow users to
enter Web Services' URL themselves and store in an .config file with XML
format. In this case, I will only add one Web Service as web reference at
compile time, then assign different URL to Web Service object created later
during runtime.

The problem is that there may be chances that user enter wrong URL or enter
an URL that point to a wrong Web Service. Therefore, is there and mechanism,
which able to check whether a Web Service has implement a specified
interface during runtime? Or is that any way to check during runtime whether
a Web Service is the same as the Web Service proxy I created at compile
time?

In this case, after user add an URL, I am able to check whether the URL is
correct and point to the correct Web Service before storing the URL into
configuration file. In result, when consuming Web Service I know that the
URL is definitely correct, so I will only need to catch for connection error
when consuming and Web Service rather than catching all other errors!

Thank you.
 
S

Sami Vaaraniemi

Soul said:
Hi,

I have a Windows Application and multiple Web Services, all Web Services
will implement the same interface. My Windows Application allow users to
enter Web Services' URL themselves and store in an .config file with XML
format. In this case, I will only add one Web Service as web reference at
compile time, then assign different URL to Web Service object created later
during runtime.

The problem is that there may be chances that user enter wrong URL or enter
an URL that point to a wrong Web Service. Therefore, is there and mechanism,
which able to check whether a Web Service has implement a specified
interface during runtime? Or is that any way to check during runtime whether
a Web Service is the same as the Web Service proxy I created at compile
time?

In this case, after user add an URL, I am able to check whether the URL is
correct and point to the correct Web Service before storing the URL into
configuration file. In result, when consuming Web Service I know that the
URL is definitely correct, so I will only need to catch for connection error
when consuming and Web Service rather than catching all other errors!

One thing that comes to mind is you could pull the web service description
(WSDL) and analyze it to see if it is what you expect.

If you don't what to analyze WSDL you could load it into a
ServiceDescription and have a ServiceDescriptionImporter generate the proxy
class. You could then analyze the proxy class via reflection.

You can use Christian Weyer's DynWsLib as a starting point for these tasks:

http://weblogs.asp.net/cweyer/archive/2003/07/07/9769.aspx

Regards,
Sami
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top