我正在使用客户提供的wsdl和xsd构建Web服务客户端,而我无法访问Web服务。我可以成功导入wsdl和xsd作为服务引用,但是有些生成的请求与客户声明的不匹配。我可以捕获我们发送的xml请求如下:
<?xml version="1.0" encoding="utf-16"?>
<GetNewPLSAccountNumberRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ServiceName xmlns="http://www.abcbank.com/2006_11/schema">com.cba.core.Account</ServiceName>
<ServiceType xmlns="http://www.abcbank.com/2006_11/schema">account.inquiry</ServiceType>
<ServiceMethod xmlns="http://www.abcbank.com/2006_11/schema">getNewPLSAccountNumber</ServiceMethod>
<Session xmlns="http://www.abcbank.com/2006_11/schema">
<SourceID>ENC</SourceID>
<UserID>abc</UserID>
<TimeStamp>4/17/2017 8:00:00 AM</TimeStamp>
</Session>
<GetNewPLSAccountNumberRequestMessage xmlns="http://www.abcbank.com/2006_11/schema">
<Customer>
<TIN_SSN>123456789</TIN_SSN>
<BranchNumber>122</BranchNumber>
<Addresses>
<Address>
<AddressLines>
<AddressLine type="AL">1234 HOME ROAD</AddressLine>
</AddressLines>
</Address>
</Addresses>
</Customer>
</GetNewPLSAccountNumberRequestMessage>
</GetNewPLSAccountNumberRequest>
但他们正在寻找:
<?xml version="1.0" encoding="utf-16"?>
<GetNewPLSAccountNumberRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.abcbank.com/2006_11/schema">
<ServiceName>com.cba.core.Account</ServiceName>
<ServiceType>account.inquiry</ServiceType>
<ServiceMethod>getNewPLSAccountNumber</ServiceMethod>
<Session>
<SourceID>ENC</SourceID>
<UserID>abc</UserID>
<TimeStamp>4/17/2017 8:00:00 AM</TimeStamp>
</Session>
<GetNewPLSAccountNumberRequestMessage xmlns="http://www.abcbank.com/2006_11/schema">
<Customer>
<TIN_SSN>123456789</TIN_SSN>
<BranchNumber>122</BranchNumber>
<Addresses>
<Address>
<AddressLines>
<AddressLine type="AL">1234 HOME ROAD</AddressLine>
</AddressLines>
</Address>
</Addresses>
</Customer>
</GetNewPLSAccountNumberRequestMessage>
</GetNewPLSAccountNumberRequest>
我是否遗漏了为什么唯一的根元素缺少targetnamespace (xmlns =“http://www.abcbank.com/2006_11/schema”)?如有必要,我可以提供更多细节......