5

SOAPエンベロープヘッダーに認証トークンを配置するWebサービスを利用しています。(WS WSDLに付属のサンプルを見ると)スタブが.NETで生成された場合、このヘッダー情報はスタブクラスのメンバー変数を介して公開されているように見えます。ただし、WSDL2Javaを使用してAxis2 Javaスタブを生成すると、どこにも公開されていないように見えます。

SOAPエンベロープヘッダーからこの情報を抽出する正しい方法は何ですか?

WSDL: http ://www.vbar.com/zangelo/SecurityService.wsdl

C#サンプル:


using System;
using SignInSample.Security;           // web service 
using SignInSample.Document;           // web service

namespace SignInSample
{
    class SignInSampleClass
    {
        [STAThread]
        static void Main(string[] args)
        {
            // login to the Vault and set up the document service
            SecurityService secSvc = new SecurityService();
            secSvc.Url = "http://localhost/AutodeskDM/Services/SecurityService.asmx";
            secSvc.SecurityHeaderValue = new SignInSample.Security.SecurityHeader();

            secSvc.SignIn("Administrator", "", "Vault");

            DocumentServiceWse docSvc = new DocumentServiceWse();
            docSvc.Url = "http://localhost/AutodeskDM/Services/DocumentService.asmx";
            docSvc.SecurityHeaderValue = new SignInSample.Document.SecurityHeader();
            docSvc.SecurityHeaderValue.Ticket = secSvc.SecurityHeaderValue.Ticket;
            docSvc.SecurityHeaderValue.UserId = secSvc.SecurityHeaderValue.UserId; 
        }
    }
}

サンプルは、私がやりたいことを示しています。呼び出しが成功した後に入力されるメンバー変数がsecSvcインスタンスにどのようにあるかに注目してください。SecurityHeaderValuesecSvc.SignIn()

SignInメソッドに関するいくつかの関連するAPIドキュメントは次のとおりです。

戻り値はありませんが、サインインに成功すると、セキュリティサービスのSecurityHeaderValueにデータが入力されます。SecurityHeaderValue情報は、他のWebサービス呼び出しに使用されます。
4

1 に答える 1

2

お探しの電話番号は次のとおりです。

MessageContext.getCurrentMessageContext().getEnvelope().getHeader()

于 2013-05-03T22:48:26.660 に答える