2009-08-24 13 views
5

मैं एक वेब सेवा का उपभोग कर रहा हूं जो एसओएपी लिफाफा हेडर में प्रमाणीकरण टोकन रखता है। ऐसा प्रतीत होता है (डब्लूएस डब्लूएसडीएल के साथ आए नमूनों को देखकर) कि यदि .NET में स्टब उत्पन्न होता है, तो यह हेडर जानकारी स्टब क्लास में सदस्य चर के माध्यम से सामने आती है। हालांकि, जब मैं WSDL2Java का उपयोग करके अपना एक्सिस 2 जावा स्टब उत्पन्न करता हूं तो यह कहीं भी प्रकट नहीं होता है।एक्सिस 2 एसओएपी लिफाफा शीर्षलेख जानकारी

एसओएपी लिफाफा हेडर से इस जानकारी को निकालने का सही तरीका क्या है?

डबल्यूएसडीएल: http://www.vbar.com/zangelo/SecurityService.wsdl

सी # नमूना:


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 उदाहरण में SecurityHeaderValue सदस्य चर है जो सफल secSvc.SignIn() आमंत्रण के बाद पॉप्युलेट किया गया है।

यहाँ SignIn विधि के बारे में कुछ प्रासंगिक API दस्तावेज़ है:

हालांकि कोई वापसी मूल्य नहीं होता है, एक सफल संकेत में सुरक्षा सेवा के SecurityHeaderValue बस जाएँगे। सुरक्षा हेडर वैल्यू जानकारी तब अन्य वेब सेवा कॉल के लिए उपयोग की जाती है।
+0

आपको एक उदाहरण, wsdl पोस्ट कुछ भी ठोस दे सकते हैं? – skaffman

+0

मेरे पास एक ही समस्या है – LiorH

उत्तर

1

मेरा मानना ​​है कि कॉल के लिए आप देख रहे हैं:

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

संबंधित मुद्दे