Barnes和Noble卖方使用PHP的SOAP API

Barnes和Noble卖方使用PHP的SOAP API,php,soap,Php,Soap,我是SOAP新手,一直在尝试使用php5内置SOAP函数连接Barnes和Noble SOAP API 我的问题是,有没有人有使用Barnes和Noble系统的文档或经验?我一直在和支持人员来往,我觉得他们认为我们应该能够解决这个问题 我得到的错误代码是“HTTP”,错误字符串是“methodnotallowed” 下面是支持人员说我的头应该是什么样子 <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xs

我是SOAP新手,一直在尝试使用php5内置SOAP函数连接Barnes和Noble SOAP API

我的问题是,有没有人有使用Barnes和Noble系统的文档或经验?我一直在和支持人员来往,我觉得他们认为我们应该能够解决这个问题

我得到的错误代码是“HTTP”,错误字符串是“methodnotallowed”

下面是支持人员说我的头应该是什么样子

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
    <SessionInfo xmlns="http://tempuri.org/SessionInfoHeader">
        <User xmlns="">your username goes here</User>
        <Password xmlns="">your password goes here.</Password>
    </SessionInfo>
</soap:Header>

你的用户名在这里
你的密码在这里。
这是我能得到的最接近的

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:ns1="http://tempuri.org">
<SOAP-ENV:Header><ns1:SessionInfo>
<item>
  <key>SessionInfo</key>
  <value>
    <item><key>User</key><value>[username]</value></item>
    <item><key>Password</key><value>[password]</value></item>
  </value>
 </item>
 </ns1:SessionInfo>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<searchCriteria/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

会话信息
用户[用户名]
密码[密码]

我甚至不确定这就是问题所在。任何帮助都非常棒。

为了获得子节点而不是项键/值对,您必须将参数作为对象传递

$client = new SoapClient( 'test.wsdl' );

class SessionInfo {
  public $User = 'test@example.com';
  public $Password = '12345';
}
$sessionInfo = new SessionInfo();

$soap_headers = new SoapHeader( 'http://tempuri.org/SessionInfoHeader',
  'SessionInfo', $sessionInfo );

$client->__setSoapHeaders( $soap_headers );  
这将输出支持人员所说的应该有效的内容。我认为您也可以创建一个数组并将其类型强制转换为一个对象,但我还没有尝试过