이전 ASMX 웹 서비스와 통신 할 수있는 타사 SOAP 클라이언트가 하나 있습니다.ASMX SOAP 응답 형식에 대한 WCF SOAP 응답
문제는 WCF 서비스에서 발생합니다.
내 WCF 서비스는이 클라이언트에서 아무런 문제없이 메시지를 받지만 클라이언트는 내 WCF 응답을 좋아하지 않습니다.
내 테스트 WCF 서비스는 다음과 같은 응답을 보냅니다 :
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<testResponse xmlns="http://www.tempuri.org">
<testResult>randomStringData</testResult>
</testResponse>
</s:Body>
</s:Envelope>
그러나 기존의 SOAP 클라이언트는 응답의 종류 (ASMX 서비스) 예상 :
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<testResponse xmlns="http://tempuri.org/">
<testResult>randomStringData</testResult>
</testResponse>
</soap:Body>
</soap:Envelope>
내가 클라이언트 여부를 제어 할 수 없습니다를 . 내 ASMX 서비스와 정확히 같은 메시지를 보내도록 내 WCF를 구성 할 수있는 방법이 있습니까?
내 WCF 서비스는 다음과 같은 바인딩을 사용하고 있습니다 : 나는 정의 메시지 관리자와 BeforeSendReply 방법으로 접두사 문제를 해결하기 위해 관리
<customBinding>
<binding name="soap11">
<textMessageEncoding messageVersion="Soap11" writeEncoding="utf-8"></textMessageEncoding>
<httpTransport></httpTransport>
</binding>
</customBinding>
"soap :"과 반대로 두 응답의 유일한 차이점이 "s :"인 경우 XML과 관련하여 두 가지 응답이 동일합니다. 레거시 ASMX 서비스 또는 클라이언트의 경우에도이 둘은 동일합니다. 네임 스페이스 접두사 ("s :")는 실제 네임 스페이스의 별칭 일 뿐이며 네임 스페이스는 동일합니다. –
이전 SOAP 클라이언트가 xml 구문 분석을 하드 코딩했으며 문자열 "
Tanel
존이''so :'soap :와 똑같다 '는 것이 옳다고 생각한다. 어쨌든 네가 raw xml을 보내기 위해 말리려고 할 수 있기 때문에 soap : as 네임 스페이스로 비누 호출을 구성 할 수있다. – Fabio