0

実際のXMLリクエストをリクエスト内の唯一の変数の値として渡すWSDLから開発されたレガシーWebサービスクライアントを使用する必要があるという問題に取り組んでいます。現在使用しているWebサービスのWSDLが異なり、XMLパーサーをだまそうとしていますが、実際のXML応答をエンコードしています。

とにかくパーサーを構成してリクエストを構成する方法はありますか?

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header/>
   <soapenv:Body>
      <request>&lt;elemA&gt;&lt;elemB&gt;abc&lt;/elemB&gt;&lt;/elemA&gt;</request>
   </soapenv:Body>
</soapenv:Envelope>

これに変更されます:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header/>
   <soapenv:Body>
      <foo>
         <elemA>
            <elemB>abc</elemB>
         </elemA>
      </foo>
   </soapenv:Body>
</soapenv:Envelope>

JAX-WSとWebSphere7を使用しています。

前もって感謝します。

パブロ

4

1 に答える 1

0

私は昨年、この状況に対処しなければなりませんでした。私にとっての解決策は、CDATA セクション内の SOAP メッセージ内にある XML をラップすることでした。

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Header/>
       <soapenv:Body>
          <![CDATA[
          <foo>
             <elemA>
                <elemB>abc</elemB>
             </elemA>
          </foo>
          ]]
       </soapenv:Body>
    </soapenv:Envelope>
于 2011-08-15T20:37:19.910 に答える