2

I have a web service I would like to connect to and I can't figure out what goes wrong with the wsdl.

The wsdl is at "http://marketplacebylaredoute.fr/spapi/SellerOrderService?wsdl". I then try to run svcutil http://marketplacebylaredoute.fr/spapi/SellerOrderService?wsdl and it fails. The error is the following (extract only)

Error: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.Se
rviceModel.Description.XmlSerializerMessageContractImporter
Error: These members may not be derived.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://Redcats/Order
/SellerOrder/2.0']/wsdl:portType[@name='portType']

Any idea what could be wrong with this wsdl ?

Dave
  • 1,835
  • 4
  • 26
  • 44
  • possible duplicate of [wsdl.exe Error: Unable to import binding '...' from namespace '...'](http://stackoverflow.com/questions/77534/wsdl-exe-error-unable-to-import-binding-from-namespace) – CodeCaster Feb 12 '14 at 11:25

2 Answers2

9

The problem comes from the <wsdl:part>s like this one:

<wsdl:part element="ns5:UpdateSellerOrderRequest_2.0" name="parameters">

When name="parameters", svcutil.exe thinks that the service is doc/literal/wrapped.

If you change it to something else than parameters, svcutil.exe will interprete it as doc/literal/bare.

The solution is:

Use Fiddler to create a proxy that change parameters to parameters1.

Quick and dirty code for that:

static function OnBeforeResponse(oSession: Session) {
    if (m_Hide304s && oSession.responseCode == 304) {
        oSession["ui-hide"] = "true";
    }
    oSession.utilDecodeResponse();
    oSession.utilReplaceInResponse('parameters', 'parameters1');

}
CodeCaster
  • 147,647
  • 23
  • 218
  • 272
JuChom
  • 5,717
  • 5
  • 45
  • 78
0

Adding to the answer of Dave: If you're using Visual Studio you can also change the parameters names to parameters1 by saving your wdsl and changing it locally.

Replace all parameters by parameters1

Add service reference by adding path to the myservice.wdsl file like c:\webserice\myservice.wdsl

You can find more answers here

Khabba
  • 41
  • 2