我收到客户的文档以使用下面的SOAP请求。我之前从未使用过SOAP,而且我正在使用此问题中列出的解决方案:Client to send SOAP request and received response
然而,当soapEnvelop.LoadXml
运行时,我得到:'head' is an undeclared prefix. Line 5, position 39.
这是我从客户端收到的SOAP xml:
<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
<soap:Header>
<head:CustomCredentials>
<head:UserName>Username</head:UserName>
<head:Password>Password</head:Password>
<head:Source>Code</head:Source>
<head:CurrentCulture>en-CA</head:CurrentCulture>
</head:CustomCredentials>
</soap:Header>
<soap:Body>
<WebServiceMethodName xmlns='Web Service Namespace' />
</soap:Body>
</soap:Envelope>
我不确定该怎么做。从谷歌搜索我相信元素头在命名空间中不存在。