jboss のローカル マシンでアプリケーションを実行しています。
wsdl ファイルをダウンロードし、Eclipse で Java コードを生成しました。実行して例外があります:
リクエストの処理中に例外がキャッチされました: デシリアライゼーション エラー: java.lang.NumberFormatException: For input string: ""
(アプリケーションは別の単純な WS で正しく動作します)。
いくつかのグーグル検索の後、コードが間違った xml を生成することがわかりました:
期待:
<soapenv:Body>
<ns1:setLevel soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="###">
<id xsi:type="xsd:string">x2148</id>
<level xsi:type="xsd:long">5</level>
</ns1:setLevel>
</soapenv:Body>
しかし、TCPMon/Fiddler を通じて、私のリクエストが次のようになっていることがわかりました。
<soapenv:Body>
<ns1:setLevel soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="###">
<id xsi:type="xsd:string">x2148</id>
<level href="#id0" />
</ns1:setLevel>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">5</multiRef>
</soapenv:Body>
グーグルで調べた後、解決策が変更であることがわかりました
<parameter name="sendMultiRefs" value="true"/>
サーバー側の server-config.wsdd ファイルで false をオンにします。しかし、私はこのファイルを持っていません。
解決策はありますか?実行時にxmlファイルを変更するという1つの解決策しかありませんが、それは良くありません。