svcutil不生成Soap客户端 [英] svcutil does not generate soap client
问题描述
我有一个要连接的Web服务,但我无法弄清楚wsdl出了什么问题.
I have a web service I would like to connect to and I can't figure out what goes wrong with the wsdl.
wsdl位于" http://marketplacebylaredoute.fr/spapi/SellerOrderService?wsdl ".然后,我尝试运行svcutil http://marketplacebylaredoute.fr/spapi/SellerOrderService?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']
有人知道这个wsdl有什么问题吗?
Any idea what could be wrong with this wsdl ?
推荐答案
问题来自这样的< wsdl:part>
s:
<wsdl:part element="ns5:UpdateSellerOrderRequest_2.0" name="parameters">
当 name ="parameters"
时,svcutil.exe认为该服务是doc/literal/wrapped.
When name="parameters"
, svcutil.exe thinks that the service is doc/literal/wrapped.
如果将其更改为 parameters
以外的其他参数,则svcutil.exe会将其解释为doc/literal/bare.
If you change it to something else than parameters
, svcutil.exe will interprete it as doc/literal/bare.
解决方案是:
使用Fiddler创建一个将 parameters
更改为 parameters1
的代理.
Use Fiddler to create a proxy that change parameters
to parameters1
.
快速而肮脏的代码:
static function OnBeforeResponse(oSession: Session) {
if (m_Hide304s && oSession.responseCode == 304) {
oSession["ui-hide"] = "true";
}
oSession.utilDecodeResponse();
oSession.utilReplaceInResponse('parameters', 'parameters1');
}
这篇关于svcutil不生成Soap客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!