views:

80

answers:

1

I've a relatively small problem. I'm developing and interface between my application and a third party program. The communication between both of them is made by SOAP webservices. They have provided me the wsdl that they are going to use to receive AND send data. I've create the service interface and the client with the wsdl.exe tool, and there are no errors or warnings while the generation.

The problem comes from the generated code namespace. Instead of using the one defined in the interface, it uses the tempuri.org one. Ok, no big deal, I can define the namespace in the

[ServiceContract (Namespace = "theDesiredNamespace")]

The problem is that i want to provide access to my webservice method from

http://theDesiredNamespace/myMethod

and instead my service provides it at:

http://theDesiredNamespace/nameOfTheInterface/myMethod

where nameOfTheInterface is the name of the interface generated automatically by the wsdl tool.

Any advice on how i can handle this? I know the easiest solution would be to actually send my new wsdl version to the third party (as it should be done) but I don't really have a choice.

Is there any workaround to this problem?

A: 
  1. WSDL.EXE is for legacy ASMX web services, not for WCF (which is what you're using when you use [ServiceContract]).
  2. Although it may look like a URL, the XML namespace has nothing to do with the location on the web. You want to use a single namespace like http://www.company.com/webservices/applicationName/serviceName/. You can then access your service at whatever URL you like. There is no relation between XML Namespace and the URL of the service.
John Saunders
Thank you for your answer, although i still miss something.I agree wsdl if to ASMX web services, and not for Wcf, but how do i generate my server interface code then?Then, i also understand the difference between xml namespace and the url where i can access, but i've loads of fiddiculties setting this url the way i want. It automatically adds some interface names without me wanting in. I've set up the namespace used in the url in the [ServiceContract] but still adds the interface name in between that and my method name
Srodriguez
Use the svcutil.exe command.
John Saunders