C# .net是否为web服务创建自定义请求和响应?
我正在做一个集成,我必须使用第三方基于java的web服务。 此第三方web服务高度区分大小写。 将web服务添加到.net项目后。 我们称之为三种方法。但是.net代码创建了自己的请求XML,这与供应商需要的XML不同 例如.net创建XML如下C# .net是否为web服务创建自定义请求和响应?,c#,.net,xml,web-services,C#,.net,Xml,Web Services,我正在做一个集成,我必须使用第三方基于java的web服务。 此第三方web服务高度区分大小写。 将web服务添加到.net项目后。 我们称之为三种方法。但是.net代码创建了自己的请求XML,这与供应商需要的XML不同 例如.net创建XML如下 <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetAccountBalanceRequest xmlns="http://www.XXXXXXX.com/lmsglobal/ws/v1/extint/types">
<Authentication>
<Principal xmlns="http://www.XXXXXXX.com/lmsglobal/xsd/v1/types">
<PrincipalValue>9401120106480306</PrincipalValue>
<PrincipalClassifier>0001</PrincipalClassifier>
</Principal>
<Credential xmlns="http://www.XXXXXXX.com/lmsglobal/xsd/v1/types"/>
</Authentication>
<LoyaltyCurrency xsi:nil="true"/>
</GetAccountBalanceRequest>
</s:Body>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.XXXXXXX.com/lmsglobal/ws/v1/extint/types" xmlns:typ1="http://www.XXXXXXX.com/lmsglobal/xsd/v1/types">
<soapenv:Header/>
<soapenv:Body>
<typ:GetAccountBalanceRequest>
<typ:Authentication>
<typ1:Principal>
<typ1:PrincipalValue>9401120106480306</typ1:PrincipalValue>
<typ1:PrincipalClassifier>0001</typ1:PrincipalClassifier>
</typ1:Principal>
</typ:Authentication>
</typ:GetAccountBalanceRequest>
</soapenv:Body>
</soapenv:Envelope>
9401120106480306
0001
但是供应商说他们需要如下XML
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetAccountBalanceRequest xmlns="http://www.XXXXXXX.com/lmsglobal/ws/v1/extint/types">
<Authentication>
<Principal xmlns="http://www.XXXXXXX.com/lmsglobal/xsd/v1/types">
<PrincipalValue>9401120106480306</PrincipalValue>
<PrincipalClassifier>0001</PrincipalClassifier>
</Principal>
<Credential xmlns="http://www.XXXXXXX.com/lmsglobal/xsd/v1/types"/>
</Authentication>
<LoyaltyCurrency xsi:nil="true"/>
</GetAccountBalanceRequest>
</s:Body>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.XXXXXXX.com/lmsglobal/ws/v1/extint/types" xmlns:typ1="http://www.XXXXXXX.com/lmsglobal/xsd/v1/types">
<soapenv:Header/>
<soapenv:Body>
<typ:GetAccountBalanceRequest>
<typ:Authentication>
<typ1:Principal>
<typ1:PrincipalValue>9401120106480306</typ1:PrincipalValue>
<typ1:PrincipalClassifier>0001</typ1:PrincipalClassifier>
</typ1:Principal>
</typ:Authentication>
</typ:GetAccountBalanceRequest>
</soapenv:Body>
</soapenv:Envelope>
9401120106480306
0001
如何修改web服务,使其根据供应商的需要生成请求XML
我还使用soapui检查响应。如果我使用.net生成的XML,它就会失败,但我使用上面的XML,它就会工作。这两个XML之间有什么区别?我也看不到。我想你犯了一个错误,我的WCF使用Java运行良好,我没有使用两种不同类型的XML的问题。请确保您与WSDL的连接正常。对不起,我似乎找不到这两个xml段之间的区别。您能否指定显示差异的行?很抱歉,我发布了错误的XML。我的错。