1

読んでくれてありがとう。PHP の SOAPServer クラスを使用すると大きな問題が発生します。

テストを行うと、次の応答が得られます。これはうまく機能します。

    <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:WSDL" 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>
          <ns1:NotificacionClienteResponse>
             <NotificacionClienteReturn xsi:type="xsd:string"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
                <NotificacionCliente>
                   <RESULTADO>
                      <CODIGORETORNO>8</CODIGORETORNO>
                      <DESCRIPCIONRETORNO>Xml incorrecto</DESCRIPCIONRETORNO>
                   </RESULTADO>
                </NotificacionCliente>]]>
             </NotificacionClienteReturn>
          </ns1:NotificacionClienteResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

しかし、同じことを他のサーバーで行うと、次の応答が得られます。

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:WSDL" 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:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <SOAP-ENV:Body>
           <ns1:NotificacionClienteResponse>
               <NotificacionClienteReturn xsi:type="xsd:string">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
                   &lt;NotificacionCliente&gt;
                      &lt;RESULTADO&gt;
                         &lt;CODIGORETORNO&gt;8&lt;/CODIGORETORNO&gt;
                         &lt;DESCRIPCIONRETORNO&gt;Xml incorrecto&lt;/DESCRIPCIONRETORNO&gt;
                      &lt;/RESULTADO&gt;
                   &lt;/NotificacionCliente&gt;
                </NotificacionClienteReturn>
           </ns1:NotificacionClienteResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope

2 番目の応答でわかるように、3 つの異なる問題があります。

  • < と > の代わりに < と > が表示されます。
  • xml の最後に de > がありません
  • そしてxmlはフォーマットされていません(私はあなたのためにそれをしました:))

サーバーに関する情報:

  • 同じ wsdl、Web サーバー、php_soap.dll、php.ini
  • 私たちはiis v6とphp v5.2.9-2を使用しています
  • PHP は両方のサーバーで、この方法で SOAPServer を呼び出しています。

    new SOAPServer($Path, array('encoding'=>'ISO-8859-1'))

ええと、あなたが私たちに教えてくれる情報や、価値があると思われる手がかりを教えてください... もちろん、さらに情報が必要な場合も同様です.

よろしくお願いします!

4

0 に答える 0