-4

Web サービスを使用するように SOAP リクエストを構成しようとしています

予想される SOAP リクエストは次のとおりです。

    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://xmlns.oracle.com/ABCS/Industry/Telco/ChannelLayer/ProcessPaymentChannelLayerReqABCSImpl" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<env:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" env:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:Username>test</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">test123</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</env:Header>

私はこのようにSOAPリクエストを持ってくることができました。

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" env:mustUnderstand="1" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:must
Understand="0">
<wsse:UsernameToken xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:Username>test</wsse:Username>
<wsse:password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">test123</wsse:password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>

それらはすべてほとんど同じです。唯一の違いは、envとして変更する必要があるsoapenvの Envelop タグのプレフィックスです。

SOAPRequest を構成しようとしている方法では、org.apache.axis.client.Stubにアクセスできます。

注:SOAPEnvelopにアクセスしてプレフィックスを設定しようとしましたが、nullとして返されました:(

前もって感謝します

4

1 に答える 1

1

上記の 2 つの XML スニペットは同じではありません。次の違いを確認してください。

env:mustUnderstand="1" ここで、soapenv:mustUnderstand="0" を送信しています

実際、2 番目の XML は mustUnserstand ヘッダーを 2 回オーバーライドしていますか?

また、@kdgregory が述べたように、名前空間とヘッダー値が正しいことを確認するだけで、プレフィックスは実際には重要ではありません。

于 2013-01-01T14:26:14.617 に答える