0

기존 웹 서비스에 연결해야합니다.웹 참조가 작동하지만 서비스 참조가 비누 버전에 대해 불만을 제기 함

Visual Studio에서 서비스 참조 추가를 수행 한 다음 서버에 WSDL 파일의 URL을 입력하십시오. 내 서비스가 나타나고 그에 대한 코드를 작성합니다.

내의 app.config는 다음과 같습니다

System.ServiceModel.CommunicationException: The envelope version of the incoming message (Soap12 (http://www.w3.org/2003/05/soap-envelope)) does not match that of the encoder (Soap11 (http://schemas.xmlsoap.org/soap/envelope/)). Make sure the binding is configured with the same version as the expected messages.

: 그러나

<system.serviceModel> 
     <bindings> 
      <basicHttpBinding> 
       <binding name="LoginServiceSoap" /> 
      </basicHttpBinding> 
     </bindings> 
     <client> 
      <endpoint address="http://server/Service.asmx" binding="basicHttpBinding" 
       bindingConfiguration="LoginServiceSoap" contract="Stuff.Login.LoginServiceSoap" 
       name="LoginServiceSoap" /> 
     </client> 
    </system.serviceModel> 

, 나는 '는를 추가하는 경우, 서비스 벌금와 통신 할 수 있어요 내가 코드를 실행할 때이 오류를 얻을 수 웹 참조 '. 그러나 WebReferences 대신 Service References를 사용하도록되어 있습니다. 나는 내가 위의 설정에서 잘못된 것이 있다고 가정하고있다.

또는 연결하려는 서비스 유형 때문에 웹 참조를 사용해야합니까?

+0

"바인딩이 예상되는 메시지와 동일한 버전으로 구성되어 있는지 확인하십시오." –

+0

존 손더스 (John Saunders), 밀도가 높아서 미안하지만 당신이 요구하는 것을 어떻게하는지 확신하지 못합니까? – sheamus

+0

웹 참조를 사용하여 지금 끝났습니다. – sheamus

답변

1

셰이 머스,

당신은 (이론적으로) 바인딩 정의에 버전 번호를 추가 할 수 있습니다.

envelopeVersion="None/Soap11/Soap12" 

물론 서비스에 대한 올바른 가치는 물론입니다.

그래서 더 같이 보일 것이다 :이 도움이

<basicHttpBinding> 
    <binding name="LoginServiceSoap" 
      envelopeVersion="Soap12" /> 
</basicHttpBinding> 

희망은 당신이 일을 당신의 방법을.

+0

나는 똑같은 문제가있다. 'envelopeVersion = "Soap12"'을 추가하려고하면 'envelopeVersion'속성이 허용되지 않습니다. '오류가 발생합니다. –