2

我创建了一个扩展 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() ?

4

0 回答 0