特定の WSDL に従って WebService を実装します。クライアントは変更できません。クライアントからのリクエストを正しく処理していますが、変数の名前空間が原因で、クライアントがレスポンスについて不平を言っています。
私が欲しいもの(WSDLに基づくsoapUI応答):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cal="http://callback.foo.com/">
<soapenv:Header/>
<soapenv:Body>
<cal:foo_statusResponse>
<result>SUCCESS</result>
<notify>Thanks!</notify>
</cal:foo_statusResponse>
</soapenv:Body>
</soapenv:Envelope>
私が得ているもの(tns:
検証の問題を引き起こす変数に関する通知):
<senv:Envelope xmlns:tns="http://callback.foo.com/" xmlns:senv="http://schemas.xmlsoap.org/soap/envelope/">
<senv:Body>
<tns:foo_statusResponse>
<tns:result>SUCCESS</tns:result>
<tns:notify>Thanks!</tns:notify>
</tns:foo_statusResponse>
</senv:Body>
</senv:Envelope>
Java クライアントが次の例外をスローしています:
[com.sun.istack.SAXParseException2; 行番号: 2; columnNumber: 162; 予期しない要素 (uri:" http://callback.foo.com/ "、local:"result")。期待される要素は <{}result>,<{}notify>] です
実装スニペット:
class fooStatusRS(ComplexModel):
result = Unicode()
notify = Unicode()
class foo_callback(ServiceBase):
@srpc(Unicode, Unicode, Unicode, Unicode, statusbarInfo, anotherResponse,
_out_header=None,
_out_variable_names=("result", "notify"),
_returns=(Unicode, Unicode),
_out_message_name="foo_statusResponse",
_operation_name="foo_status_rq")
def foo_status(foo_id, reply, ref, status, statusbar, another):
if foo_id:
print foo_id
return fooStatusRS(result="SUCCESS", notify="Foo received!")