简体   繁体   English

wcf服务不适用于SOAPUI-创建序列失败

[英]wcf service doesn't work with SOAPUI - create sequence fails

I have build a wcf-service (vb.Net with VisualStudio2017) that works well with a testclient, and wcfstorm. 我已经建立了一个wcf服务(vb.Net与VisualStudio2017)与testclient和wcfstorm一起很好地工作。 SOAPUI can load the wsdl, but when sending a request, it fails with "a:ActionNotSupported" SOAPUI可以加载wsdl,但是在发送请求时,它将失败,并显示“ a:ActionNotSupported”

My Service uses WsHttpbinding, no authentification, no security, with sessions and reliable messaging. 我的服务使用WsHttpbinding,没有身份验证,没有安全性,具有会话和可靠的消息传递。

Messagetracing shows that my TestClient succeds with using 消息跟踪显示我的TestClient成功使用

< CreateSequence xmlns="http://schemas.xmlsoap.org/ws/2005/02/rm">

where as SOAPUI fails with using 在SOAPUI中使用失败的地方

< wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence< /wsa:Action>

My Questions: 我的问题:

  1. How can i configure my Service to understand/accept the second schema? 如何配置我的服务以理解/接受第二种模式?
    I'm a bit puzzled, from what i understand it should already speak SOAP 1.2 我有点困惑,据我所知它应该已经讲过SOAP 1.2
  2. How can i get SOAPUI to use a different schema? 如何获得SOAPUI以使用其他架构? - or configure the request so it'll work? -或配置请求以使其正常工作?

SOAPUI-Message SOAPUI消息

<MessageLogTraceRecord>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Action>http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence</wsa:Action>
<wsa:MessageID>uuid:f610452d-80ef-4439-9cc1-40c7a1731eac</wsa:MessageID>
<wsa:To>http://rmwebservice:8733/TestService</wsa:To>
</soap:Header>
<soap:Body xmlns:wsrm="http://docs.oasis-open.org/ws-rx/wsrm/200702">
<wsrm:CreateSequence>
<wsrm:AcksTo xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://www.w3.org/2005/08/addressing/anonymous?id=64f9580f-bfe9-4bd2-9b34-db88e0a5c982</wsa:Address>
</wsrm:AcksTo>
</wsrm:CreateSequence>
</soap:Body>
</soap:Envelope>
</MessageLogTraceRecord>

Response: 响应:

<MessageLogTraceRecord>
<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/fault</a:Action>
<a:RelatesTo>uuid:f610452d-80ef-4439-9cc1-40c7a1731eac</a:RelatesTo>
</s:Header>
<s:Body>
<s:Fault>
<s:Code>
<s:Value>s:Sender</s:Value>
<s:Subcode>
<s:Value>a:ActionNotSupported</s:Value>
</s:Subcode>
</s:Code>
<s:Reason>
<s:Text xml:lang="de-DE">Die Aktion http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence wird von diesem Endpunkt nicht unterstützt. Durch diesen Endpunkt werden nur Nachrichten verarbeitet, die der Spezifikation für WS-ReliableMessaging vom Februar 2005 entsprechen.</s:Text>
</s:Reason>
</s:Fault>
</s:Body>
</s:Envelope>
</MessageLogTraceRecord>

relevant service config: 相关服务配置:

<system.serviceModel>
<behaviors>
  <serviceBehaviors>
    <behavior name="myBehavior">
      <serviceMetadata httpGetEnabled="true" httpGetUrl="http://myService:8733/" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<bindings>
  <wsHttpBinding>
    <binding name="reliableBinding">
      <reliableSession ordered="true" enabled="true" />
      <security mode="None">
        <message clientCredentialType="None" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<services>
  <service name="TestSoapService.TestService"
           behaviorConfiguration="myBehavior">
    <endpoint address="http://myService:8733/TestService"
              binding="wsHttpBinding"
              bindingConfiguration="reliableBinding"
              contract="TestSoapService.ITestService" />
    <endpoint address="http://myService:8733/mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
</system.serviceModel>

wsdl: wsdl:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/" name="TestService">
<wsp:Policy wsu:Id="WSHttpBinding_ITestService_policy">
<wsp:ExactlyOne>
<wsp:All>
<wsrm:RMAssertion xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy">
<wsrm:InactivityTimeout Milliseconds="600000"/>
<wsrm:AcknowledgementInterval Milliseconds="200"/>
</wsrm:RMAssertion>
<wsaw:UsingAddressing/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import namespace="http://tempuri.org/" schemaLocation="http://rmwebservice:8733/?xsd=xsd0"/>
<xsd:import namespace="http://schemas.microsoft.com/2003/10/Serialization/" schemaLocation="http://rmwebservice:8733/?xsd=xsd1"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="ITestService_Echo_InputMessage">
<wsdl:part name="parameters" element="tns:Echo"/>
</wsdl:message>
<wsdl:message name="ITestService_Echo_OutputMessage">
<wsdl:part name="parameters" element="tns:EchoResponse"/>
</wsdl:message>
<wsdl:portType name="ITestService" msc:usingSession="true">
<wsdl:operation name="Echo" msc:isTerminating="false" msc:isInitiating="true">
<wsdl:input message="tns:ITestService_Echo_InputMessage" wsaw:Action="http://tempuri.org/ITestService/Echo"/>
<wsdl:output message="tns:ITestService_Echo_OutputMessage" wsaw:Action="http://tempuri.org/ITestService/EchoResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding type="tns:ITestService" name="WSHttpBinding_ITestService">
<wsp:PolicyReference URI="#WSHttpBinding_ITestService_policy"/>
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Echo">
<soap12:operation style="document" soapAction="http://tempuri.org/ITestService/Echo"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="TestService">
<wsdl:port name="WSHttpBinding_ITestService" binding="tns:WSHttpBinding_ITestService">
<soap12:address location="http://rmwebservice:8733/TestService"/>
<wsa10:EndpointReference>
<wsa10:Address>http://rmwebservice:8733/TestService</wsa10:Address>
</wsa10:EndpointReference>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

While your error is in German and Google likely made a mess of translating it, it states 虽然您的错误是德语的,但Google可能会翻译成一团糟,但它指出

The action http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence is not supported by this endpoint. 此端点不支持操作http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence This endpoint only processes messages that meet the February 2005 WS-ReliableMessaging specification. 该端点仅处理符合2005年2月WS-ReliableMessaging规范的消息。

The suggested fix to test that it is causing the problem is to disable reliableBinding like this: 建议的解决方案,以测试它是引起该问题的方法是禁用如下所示的可靠绑定:

<wsHttpBinding>
    <binding name="reliableBinding">
        <reliableSession ordered="true" enabled="false" />
        <security mode="None">
            <message clientCredentialType="None" />
        </security>
    </binding>
</wsHttpBinding>

If that works you might try re-enabling it then in SOAP-UI you can enable WS-ReliableMessaging following this article Using WS-Reliable messaging 如果可行,您可以尝试重新启用它,然后在SOAP-UI中启用本文后面的WS-ReliableMessaging使用WS-Reliable消息传递

Update : 更新
For a little more info on what SOAP-UI might support albeit they're discussing an older version see WCF services testing with SOAP-UI 有关SOAP-UI可能支持什么的更多信息,尽管他们正在讨论较旧的版本,请参阅使用SOAP-UI进行WCF服务测试。

If all else fails, I'd suggest posting in their forum/community 如果所有其他方法均失败,建议您在其论坛/社区中发布

Another answer(s) from SO that might help Problems with wcf reliable session reliable messaging SO的另一个答案可能会有所帮助wcf可靠会话可靠消息传递问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM