tags:

views:

31

answers:

2

Hi

Do you know if there is any way to access the wsdl file when you create a WCF service library? It seems you can get it when you create a WCF application but not the service library...

Any ideas would be appreciated.

Thanks

A: 

The only way to access the WSDL is once you host and run the service. Otherwise, you cannot access it. So, create a host (or application as you are calling it) with a mex binding, then run the service and you should be able to access the WSDL.

Once you do this, you can save the WSDL as a file or something for later reference.

Doanair
A: 

You cannot access the WSDL automatically. Of course if you compile the static WSDL into the service library, as a resource, you could then access it directly.

but what is it that you are trying to accomplish?

The "Service Description" is available inside a service. It is not the WSDL itself, but rather, the in-memory model of a service description. It includes the namespaces, the element names and types - everything in a WSDL, and more.

You can get at it with System.Web.Services.Description.ServiceDescription. Typically this is done within a ServiceHost, a ServiceHostFactory, or an IEndpointBehavior.

Cheeso
Thanks for your response. I need the WSDL for blackberry development. My blackberry application needs the WSDL to hit the web service.
Then it sounds like you want the MEX binding, as suggested by Doanair.
Cheeso