1

我已经构建了一个 wcf 服务(带有 VisualStudio2017 的 vb.Net),它可以很好地与 testclient 和 wcfstorm 配合使用。SOAPUI 可以加载 wsdl,但是在发送请求时,它会失败并显示“a:ActionNotSupported”

我的服务使用 WsHttpbinding,没有身份验证,没有安全性,具有会话和可靠的消息传递。

Messagetracing 显示我的 TestClient 成功使用

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

SOAPUI 使用失败的地方

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

我的问题:

  1. 如何配置我的服务以理解/接受第二个模式?
    我有点困惑,据我了解它应该已经说 SOAP 1.2
  2. 如何让 SOAPUI 使用不同的架构?- 或配置请求以便它可以工作?

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>

回复:

<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>

相关服务配置:

<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:

<?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>
4

1 回答 1

0

虽然你的错误是德语,谷歌可能把它翻译得一团糟,但它指出

此端点不支持操作http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence 。此端点仅处理符合 2005 年 2 月 WS-ReliableMessaging 规范的消息。

测试它是否导致问题的建议修复是禁用reliableBinding,如下所示:

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

如果可行,您可以尝试重新启用它,然后在 SOAP-UI 中,您可以按照这篇文章使用 WS-Reliable 消息传递启用 WS-ReliableMessaging

更新
有关 SOAP-UI 可能支持的更多信息,尽管他们正在讨论旧版本,请参阅WCF services testing with SOAP-UI

如果一切都失败了,我建议在他们的论坛/社区

中发布 另一个答案来自可能有助于wcf 可靠会话可靠消息传递的问题

于 2018-02-02T14:40:16.687 回答