2012-07-18 5 views
2

이 주제와 관련하여 다른 질문이 있지만 실제 정확한 문제는 없습니다. 나는 보통 대답을 찾을 수 있기 때문에 거의 질문하지 않습니다.WCF 비누 메시지 'To'헤더 제거

우리는 SOAP 1.1을 사용하는 Java 웹 서비스와 통신하기 위해 WCF 클라이언트를 사용하고 있습니다. userNameToken을 추가하기 위해 사용자 지정 WseHttpBinding을 만들어야했습니다. 문제는 요청이 직렬화 될 때 Java 서비스가 싫어하는 헤더 요소가 추가된다는 것입니다. 이들은 특히 다음과 같습니다

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> 
<s:Header> 
<a:Action s:mustUnderstand="1"/> 
<a:MessageID>urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</a:MessageID> 
<a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo> 
<a:To s:mustUnderstand="1">https://xxx.xxx.xxx</a:To> 

<MORE SECURITY ELEMENTS...> 
</s:Header> 

내 옵션을 조사한 후, 내가없는 사람들을 제거 할 수있는 방법을 찾을 수 없습니다 :

액션 이

실제 헤더는 다음과 같습니다에 ReplyTo의 을의 MessageID 사용자 지정 인코더 작성 또는 메시지 보내기 전에 메시지 조작 나는 후자를 선택했다.

사용자 지정 동작을 사용하여 IClientMessageInspector를 사용하여 messageInspector 클래스를 구현했습니다.

message.Headers.RemoveAll("Action", "http://schemas.xmlsoap.org/ws/2004/08/addressing"); 
message.Headers.RemoveAll("MessageID","http://schemas.xmlsoap.org/ws/2004/08/addressing"); 
message.Headers.RemoveAll("ReplyTo", "http://schemas.xmlsoap.org/ws/2004/08/addressing"); 
message.Headers.RemoveAll("To", "http://schemas.xmlsoap.org/ws/2004/08/addressing"); 

내가 그것을 하나의 헤더 예외를 모두 제거하는 것이 매우 놀랐습니다 다음 BeforeSendRequest 방법에서, 나는 다음과 같은 사용.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> 
<s:Header> 
<a:To s:mustUnderstand="1">https://pilot.eidverifier.com/uru/soap/ut/usv3</a:To> 
<MORE SECURITY ELEMENTS...> 
</s:Header> 

당신이 볼 수 있듯이, '받는 사람'요소가 여전히 존재 다음은 결과입니다. 그래서, 제 질문은 왜입니까? 메시지를 보내는 것이 필요합니까?

내가 잘못 접근하고 있다고 생각하지만 도움이되지 않습니다. false를 mustUnderstand하게하는 방법이 있습니까? 추가 구성 요소를 모두 제거하는 속성 설정이 있습니까? 나는 해제 모드에있다.

도움이나 의견을 보내 주시면 감사하겠습니다. 당신은 잘못된 messageVersion 사용하는

+0

자바 서비스에서 돌아 오는 초기 오류가 있음 : mustUnderstand에 헤더 : [{에 http : // schemas.xmlsoap.org/ws/2004/08/addressing}To, {http://schemas.xmlsoap.org/ws/2004/08/addressing}Action}은 이해할 수 없습니다. –

답변

2

,

이 제거 사용하는 Soap11 대신 Soap11WSAddressing10

내가 추가해야