Link to home
Create AccountLog in
Avatar of gunman69
gunman69

asked on

"Dynamic" target namespace for WSDL proxy

Hi!

We have implemented two web-services at two different customers.
The web-services are identitical, except that we accidently changed the target namespace on one of the web-services.

We also have a client application written in .NET 2.0, which communicates with the web-service using a web-service proxy generated the "Visual Studio"-way, i.e. using the WSDL from the web-service.
Since the WSDL:s have different namespaces in the two, otherwise identical, web services, the generated proxy code look a little different (note the different soapActions):

    <wsdl:operation name="GetDataSet">
      <soap:operation soapAction="http://[b]tempuri.org[/b]/GetDataSet" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>

Open in new window

vs
    <wsdl:operation name="GetDataSet">
      <soap:operation soapAction="http://[b]OurCompanyName.com[/b]/GetDataSet" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>

Open in new window


We can't change any of the web-services, since that would break the client applications already installed on users' computers.

This means that we have to maintain two different client solutions in Visual Studio, build two different installation packages, etc. We would like to avoid this.

Ideally, we would modify the client application to be "target namespace indifferent", i.e. work against both web-services, irrespective the target namespace.

Is this possible? Or can you recommend another way to work around this?

Thanks!
/Fredrik
ASKER CERTIFIED SOLUTION
Avatar of Rose Babu
Rose Babu
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of gunman69
gunman69

ASKER

Thanks, I used the first suggestion (http://www.codeproject.com/Articles/22760/Calling-Web-Service-using-ASP-NET), and it works fine!