Calling a Service where the Class Name is different than the Service Name

Some Web Services expose multiple service classes or the actual Service Class Name is different than the service name. In this case - using the default settings - the FoxPro proxy generation tool will not find the service class and fail to generate the FoxPro proxy properly.

You can work around this by manually changing the Class name on the Wizard form.

How do you find the Class Name?

When the service class doesn't match the service name, how do you find the class name? This process requires that you either look directly in the WSDL document, or more likely look in the generated .NET assembly to find the service class that you want to connect to.

Even though the proxy is likely to fail to generate completely or with errors, the .NET assembly will likely generate. You can then use Refector to review the Proxy assembly created and pick the Service Class you're interested in:

In the image above pick the service class that you want then use it for the Class Name when you re-run the Wizard.

To do this:

    * Generate the Proxy with the default settings (ie. ServiceName as the class) * FoxPro proxy generation will likely fail - ignore this for now * Open the generated .NET Assembly in Refector * Find the Service class that you want to work with * Note or copy the Class Name * Re-run the Wizard and fill in the Class Name with the class you want to use

If the service you are generating from has more than one service class/endpoint you might have to adjust the service Url. The WSDL generator only picks up the first URL generated by default which may be the wrong one. If that's the case you can find the correct endpoint URL in the WSDL document - it'll be towards the bottom.

<wsdl:service name="ConfigurationService">
- <wsdl:port name="Configuration-BASIC" binding="i0:Configuration-BASIC">
  <soap:address location="http://somesite.com:8088/ToteLink/ConfigurationService/BASIC" /> 
  </wsdl:port>
- <wsdl:port name="Configuration-BASIC-S" binding="i0:Configuration-BASIC-S">
  <soap:address location="https://somesite.com:8090/ToteLink/ConfigurationService/BASIC" /> 
  </wsdl:port>

This WSDL exposes 2 endpoints (but only two Soap HTTP endpoints). In the example in Reflector ConfigurationBASICS maps to Configuration-BASIC-S so the cServiceUrl should be set to:

cServiceUrl = "https://somesite.com:8090/ToteLink/ConfigurationService/BASIC"

© West Wind Technologies, 2004-2020 • Updated: 09/29/15
Comment or report problem with topic