Zac*_*elo 5 java soap axis2 header
我正在使用一个Web服务,它在SOAP信封头中放置一个身份验证令牌.看来(通过查看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;
}
}
}
Run Code Online (Sandbox Code Playgroud)
样本说明了我想做的事情.请注意secSvc实例如何具有SecurityHeaderValue在成功secSvc.SignIn()调用后填充的成员变量.
以下是有关该SignIn方法的一些相关API文档:
虽然没有返回值,但成功登录将填充安全服务的SecurityHeaderValue.然后,SecurityHeaderValue信息用于其他Web服务调用.
| 归档时间: |
|
| 查看次数: |
3042 次 |
| 最近记录: |