Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svcutil does not generate soap client

Tags:

.net

soap

wsdl

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 ?

like image 438
Dave Avatar asked Mar 27 '26 17:03

Dave


1 Answers

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');

}
like image 186
JuChom Avatar answered Mar 29 '26 08:03

JuChom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!