[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Re: Verify Correct Implementation in Web Services

Sami Vaaraniemi

5/30/2004 1:48:00 PM


"Soul" <no@spam.net> wrote in message
news:eJ5ptYVREHA.3420@TK2MSFTNGP11.phx.gbl...
> 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...

Regards,
Sami