0

私は Mule を初めて使用し、.Net クライアントから Mule Proxy Web サービス、Mule Proxy クライアント、.Net サービスへの小さなフローを確立しようとしています。フローは、フロー内にロジックを持たないパススルー フローです。Soap 1.2 を使用しようとしています。フローは SOAP 1.1 で正常に動作しています。以下は、使用される構成ファイルです。

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd 
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd 
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd 
http://www.mulesoft.org/schema/mule/ee/wmq http://www.mulesoft.org/schema/mule/ee/wmq/current/mule-wmq-ee.xsd 
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd 
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd 
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd 
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd ">
    <cxf:configuration name="CXF_Configuration" enableMuleSoapHeaders="true" initializeStaticBusInstance="true" doc:name="CXF Configuration"/><flow name="EndToEndWebserviceFlowEmp" doc:name="EndToEndWebserviceFlowEmp">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8080" doc:name="HTTP" path="EmpService"/>
        <logger message="After Http Inbound: #[message.payload]" level="INFO" doc:name="Logger"/>
        <cxf:proxy-service port="BasicHttpBinding_IEmpService" namespace="http://tempuri.org/" service="EmpService" payload="body" doc:name="SOAP" wsdlLocation="endtoendflow.wsdl"/>
        <logger message="First request: #[message.payload]" level="INFO" doc:name="Logger"/>
        <set-property propertyName="SOAPAction" value="http://tempuri.org/IEmpService/GetEmp" doc:name="Property"/>
        <set-property propertyName="Content-Type" value="application/soap+xml" doc:name="Property"/>
        <cxf:proxy-client payload="body" enableMuleSoapHeaders="true" doc:name="SOAP" soapVersion="1.2"/><!--
        <custom-interceptor class="com.mulesoft.wcfconsumer.HeaderInterceptor"/>
        --><echo-component doc:name="Echo"/>
        <http:outbound-endpoint exchange-pattern="request-response" doc:name="HTTP" address="http://localhost:50006/EmpService.svc"/>
    </flow>
</mule>

Mule Proxy サービスは Soap 1.1 に準拠しています。Mule Proxy クライアントは、次のように wsHttpBinding を使用して WCF クライアントとやり取りしています。

<?xml version="1.0"?>
<configuration>

  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5"/>
  </system.web>
  <system.serviceModel>
    <services>
      <service name="TestService.EmpService">
        <endpoint address="" binding="wsHttpBinding" contract="TestService.IEmpService" />
        <endpoint address="Mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
        <binding>
          <security mode="None"></security>
        </binding>
      </wsHttpBinding>
      <basicHttpBinding>
        <binding transferMode="Buffered">
          <security mode="None"></security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <directoryBrowse enabled="true"/>
  </system.webServer>

</configuration>

Mule クライアントから WCF サービスを呼び出そうとすると、Mule で生成された次の要求が表示されます。以下のリクエストの名前空間は、それが SOAP 1.2 のものであることを示しています。ヘッダーはありません。

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body><tem:GetEmp xmlns:tem="http://tempuri.org/"><tem:id>10</tem:id></tem:GetEmp></soap:Body></soap:Envelope>

このクライアントが返すため: メッセージで指定された SOAP アクション '' は、HTTP SOAP アクション ' http://tempuri.org/IEmpService/GetEmp ' と一致しません。または To 要素が空です。

Mule プロキシ クライアントを使用して必要な形式で SOAP 1.2 メッセージを作成する方法を提案するか、他の解決策があるかどうかを提案してください。

インターセプターの使用を提案する記事をいくつか読みましたが、あまり役に立ちませんでした。

ありがとうハリッシュ・クマール

4

2 に答える 2