2013-08-05 3 views
3

У меня есть простое приложение WCF (.NET 3.5) Service, которое имеет код по умолчанию, созданный VS 2008 при открытии нового проекта.WCF wshttpbinding (SOAP 1.2) не работает с инструментом SoapUI

У меня есть wshttpbinding со следующей конфигурацией в файле web.config.

<system.serviceModel> 
    <services> 
     <service name="WCFTestServiceApp.Service1" behaviorConfiguration="WCFTestServiceApp.Service1Behavior"> 
     <!-- Service Endpoints --> 
     <endpoint address="" binding="wsHttpBinding" contract="WCFTestServiceApp.IService1" bindingConfiguration="binding1"> 
      <!-- 
       Upon deployment, the following identity element should be removed or replaced to reflect the 
       identity under which the deployed service runs. If removed, WCF will infer an appropriate identity 
       automatically. 
      --> 
      <identity> 
      <dns value="localhost"/> 
      </identity> 
     </endpoint> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="binding1">   
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="WCFTestServiceApp.Service1Behavior"> 
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
      <serviceMetadata httpGetEnabled="true"/> 
      <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
      <serviceDebug includeExceptionDetailInFaults="true"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 

Я запустить эту WCF приложения и возможность использовать VS 2008 WCFTESTCLIENT получать и отправлять сообщения. Я не могу сделать то же самое с инструментом SoapUI. Когда я переключаюсь на basichttpBinding, он работает как версия SOAP 1.1. Но wsHttpBinding (SOAP 1.2), похоже, не работает.

следующее сообщение об ответах и ​​ответах, которые я получаю в инструменте SoapUI.

Запрос

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/"> 
    <soap:Header/> 
    <soap:Body> 
     <tem:GetData> 
     <!--Optional:--> 
     <!--type: int--> 
     <tem:value>3</tem:value> 
     </tem:GetData> 
    </soap:Body> 
</soap:Envelope> 

Response

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"> 
    <s:Header> 
     <a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/soap/fault</a:Action> 
    </s:Header> 
    <s:Body> 
     <s:Fault> 
     <s:Code> 
      <s:Value>s:Sender</s:Value> 
      <s:Subcode> 
       <s:Value xmlns:a="http://schemas.xmlsoap.org/ws/2005/02/sc">a:BadContextToken</s:Value> 
      </s:Subcode> 
     </s:Code> 
     <s:Reason> 
      <s:Text xml:lang="en-IN">The message could not be processed. This is most likely because the action 'http://tempuri.org/IService1/GetData' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.</s:Text> 
     </s:Reason> 
     </s:Fault> 
    </s:Body> 
</s:Envelope> 

Пожалуйста, советы, как я должен продолжить. Любая помощь приветствуется.

+0

заменить WsHttpBinding с BasicHttpBinding в <адрес конечной точки = "" привязки = "WsHttpBinding" контракта = "WCFTestServiceApp.IService1" bindingConfiguration =» binding1" > – YOusaFZai

ответ

0

объясняется тем, что wsHttpBinding имеет встроенную защиту по умолчанию. Попробуйте для отключения безопасности на WCF:

Web.config

<wsHttpBinding> 
    <binding name="binding1"> 
     <security mode="None"> 
     <transport clientCredentialType="None" /> 
     <message establishSecurityContext="false" /> 
     </security> 
    </binding> 
    </wsHttpBinding> 
Смежные вопросы