我是Mule的新手,並試圖建立從.Net客戶端到Mule代理服務器到Mule代理客戶端到.Net服務的小流量。流程是流程內沒有任何邏輯的傳遞流程。我正在嘗試使用Soap 1.2。 Flow在Soap 1.1中運行良好。以下是使用的配置文件:Mule代理客戶端沒有爲Soap 1.2消息創建頭文件
<?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代理服務跟隨肥皂1.1。騾子代理客戶端使用的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服務。命名空間在下面的請求顯示它是肥皂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代理 客戶端或如果有其他解決方案,以所需格式製作肥皂1.2消息。
我讀過幾篇文章,建議使用攔截器,但沒有多大幫助。
感謝 哈里什·庫馬爾
在攔截器的幫助下,我可以用相關的數據構建標題,因此它現在可以工作。 –