问题描述
我目前有这个,如何在这个标题上添加标题?
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<testConnection xmlns="urn:http://url.com">
<name>Test Connection</name>
</testConnection>
</Body>
</Envelope>
我尝试这样做
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Header>
<Credentials>
<username>USERNAME</username>
<password>PASSWORD</password>
</Credentials>
</Header>
<Body>
<testConnection xmlns="urn:http://url.com">
<name>Test Connection</name>
</testConnection>
</Body>
</Envelope>
仍然无效。有人知道如何在此标题上正确添加标题吗?
这是错误响应
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode xsi:type="xsd:string">ERROR</faultcode>
<faultactor xsi:type="xsd:string"></faultactor>
<faultstring xsi:type="xsd:string">1 Authentication failed! You need to send soap headers or HTTP headers containing your credentials. If you want to use soap headers,the credentials must have the form of "&lt;Credentials&gt;&lt;username&gt;username&lt;/username&gt;&lt;password&gt;password&lt;/password&gt;&lt;/Credentials&gt; </faultstring>
<detail xsi:type="xsd:string"></detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)