php nusoap服务器无法读取标头安全性

时间:2016-03-02 11:45:49

标签: php web-services soap nusoap

我是SOAP的新手,我被要求构建一个nusoap自定义客户端和服务器。实际上,我在阅读以下nusoap请求标题时遇到问题。

<wsa:Action> OTA_HotelRatePlanRQ </wsa:Action> 
<wsa:From> 
    <wsa:Address> urn:connect </wsa:Address> 
</wsa:From> 
<wsa:To> PartnerURL </wsa:To> 
<wsa:ReplyTo> 
    <wsa:Address> http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous </wsa:Address> 
</wsa:ReplyTo> 
<wsa:MessageID> 5f2c4c6b-642f-4d07-ad9c-02e5b5cdaa29 </wsa:MessageID> 
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:UsernameToken wsu:Id="SecurityToken-627f1ab1-338a-451f-9829-84f248e57ad8" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsse:Username> Username </wsse:Username> 
        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile1.0#PasswordText"> password </wsse:Password> 
        <wsu:Created> 2014-12-19T16:09:15 </wsu:Created> 
    </wsse:UsernameToken> 
</wsse:Security>

事实上,我很难设法从客户端发送它;最后,我能够使用serializeEnvelope()和send()nusoap函数发送它。现在,我找不到从服务器端读取它的方法。它显示以下错误消息:“未定义的索引:wsa”。任何人都可以帮助我。

谢谢

1 个答案:

答案 0 :(得分:0)

事实上我刚刚找到了一种方法来捕捉标题元素。 这是如何: $ request = get_defined_vars(); $ request [&#34; GLOBALS&#34;] [&#34; GLOBALS&#34;] [&#34; HTTP_RAW_POST_DATA&#34;]包含服务器端收到的所有数据。