2012-08-24 7 views
0

를 생성 이것은 내가 생성하고자하는 헤더 ...문제 WCF 클라이언트와 WSE 보안 웹 서비스를 공격하는 동안 : 잘못된 헤더

<soap:Header> 
     <wsse:Security soap:mustUnderstand="true" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> 
     <wsse:UsernameToken wsu:Id="UsernameToken-2" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> 
      <wsse:Username>----------</wsse:Username> 
      <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">----------</wsse:Password> 
      <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">Hozef94FFwOhuiF5QixaMQ==</wsse:Nonce> 
      <wsu:Created>2012-08-21T13:26:03.642Z</wsu:Created> 
     </wsse:UsernameToken> 
     </wsse:Security> 
    </soap:Header> 

이 내가 현재 발생하고 헤더가은 ...

<wsse:Username xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">MedTrak_Dev</wsse:Username> 
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">---------</wsse:Password> 
<wsse:Nonce xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">WEb3nSNkVO29y0Mt91yYNA==</wsse:Nonce> 
<wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2012-08-24T13:45:14Z</wsu:Created> 

실제로 헤더가 무엇인지 알 수 없습니까? 어떻게 알아낼 수 있습니까?

나는이이 스택 오버플로 대답에 주어진 튜토리얼 ... 나는 문제가 그 답

public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel) 
     { 
      // Use the WSE 3.0 security token class 
      UsernameToken token = new UsernameToken(this.Username, this.Password, PasswordOption.SendPlainText); 

      Nonce nonce = new Nonce(10); 

      // Serialize the token to XML 
      XmlElement securityToken = token.GetXml(new XmlDocument()); 

      // 
      MessageHeader securityHeader = MessageHeader.CreateHeader("Security", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken", securityToken, false); 
      request.Headers.Add(securityHeader); 

      // complete 
      return Convert.DBNull; 
     } 

에서 코드의 특정 섹션 내에있는 생각 WSE service Client answer

다음 나는 그것을 조금 수정 않았다 그래서 일반 텍스트로 암호를 보내면 unimplementedExceptions 예외가 제거됩니다. 올바른 헤더를 얻으려면 어떻게해야합니까?

security.wssecurity.WSSContextImpl.s02: com.ibm.websphere.security.WSSecurityException: Exception org.apache.axis2.AxisFault: CWWSS5525E: The server cannot find the security header for a Web service with no actor. ocurred while running action: [email protected]f5 

UPDATE :는 SOAP 요청의 머리에 전체 요청을 던지고 아니라 체내로 그것을 분할하고는 난스를 생성하지 않다 제외한 비교적 가까운 헤더

생성 또는 창조 날짜 ... 그래서 그들은 내 다음 몇 가지 작업이 될 것 같아요 ...

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> 
    <s:Header> 
     <VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPo9VZylDHg5JMgjsNnWLhATkAAAAA+YtOxHdh0Uqd4a64raX/nIzYz20mPHlBv4Wk5S8d5PsACQAA</VsDebuggerCausalityData> 
     <wsse:Security s:mustUnderstand="0" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> 
      <UsernameToken xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> 
       <Username>------------</Username> 
       <Password>************</Password> 
      </UsernameToken> 
     </wsse:Security> 
     <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
      <GetOrganizations xmlns="http://esdm.upmc.com/bpm/medtrak/businessobjects/messaging/"> 
       <personId xmlns="">0</personId> 
       <typeId xmlns=""> 
        <int>1</int> 
        <int>2</int> 
        <int>3</int> 
        <int>4</int> 
       </typeId> 
      </GetOrganizations> 
     </s:Body> 
    </s:Header> 
</s:Envelope> 

내 작업 순서가 꺼져 있어야합니다.

답변