使用扩展SoapClient的php类使用MTOM生成SOAP消息

时间:2013-05-07 15:49:15

标签: php soap mtom

我创建了一个扩展SoapClient并覆盖__doRequest()函数的类,以便能够将附件添加到使用MTOM的外部Web服务器。

基本上,在调用parent :: __ doRequest()之前,我编辑第一个参数$ request以添加MTOM部分。我的问题是我得到了“读取XMLStreamReader的错误”。

我不确定是不是因为我生成的消息有错误,或者SoapClient :: __ doRequest()检测到非xml部分并抛出了soapfault。

这是我生成的肥皂消息:

    Content-Type: multipart/related; boundary=MIMEBoundary4A7AE22984E7738034;
type="application/xop+xml"; start="<0.09BC7F4BE2E4L7EF1B@example.org>";
start-info="text/xml; charset=utf-8"


--MIMEBoundary2013-04-24_0
content-type: application/xop+xml; charset=utf-8; type="application/soap+xml;"
content-transfer-encoding: binary
content-id: <0.09BC7F4BE2E4L7EF1B@example.org>

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1{endpoint} xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><SOAP-ENV:Header>
        <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <wsse:UsernameToken>
                <wsse:Username>{username}</wsse:Username>
                <wsse:Password>{password}</wsse:Password>
            </wsse:UsernameToken>
        </wsse:Security></SOAP-ENV:Header><SOAP-ENV:Body><ns1:creerDepot/><param1>depot2013-04-24_0</param1><param2></param2></SOAP-ENV:Body></SOAP-ENV:Envelope>


--MIMEBoundary2013-04-24_0
content-type: application/octet-stream
content-transfer-encoding: binary
content-id: <2013-04-24_0>


--MIMEBoundary2013-04-24_0--{file}

有人可以告诉我,如果我的问题来自我生成的包含错误的消息,或者它是否来自不想发送它的__doRequest()?

0 个答案:

没有答案