目前,我们正在尝试使用Mule ESB构建一个代理,该代理提供内部we服务,然后转到具有内部we服务参数的外部soap服务。一旦我得到了它,我将改变soap的内容和布局。然后,第三步,结果必须由Mule计算。
但是在我们到达第2和第3步之前,让我们先从代理开始。目前,我正在查看http://www.mulesoft.org/documentation/display/MULE3USER/Proxying+Web+Services,但是提供的WSProxyService不起作用。代码似乎是Mule 2.2的代码。我试着重建了它,看起来是这样的:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.2/mule-http.xsd">
<spring:bean name="WSProxyService" class="org.mule.module.cxf.WSProxyService">
<spring:property name="wsdlFile" value="resources/tisclientws.wsdl"/>
</spring:bean>
<flow name="HttpProxyService">
<http:inbound-endpoint address="http://localhost:8090/tis/proxy" exchange-pattern="request-response"/>
<component>
<spring-object bean="WSProxyService" />
</component>
<http:outbound-endpoint address="ADDRESSHERE/tisclientws.asmx" exchange-pattern="request-response"/>
</flow>
</mule>然而,这会导致错误。
Exception stack is:
1. Service not set, this service has not been initialized properly. (org.mule.api.lifecycle.InitialisationException)
org.mule.module.cxf.WSProxyService:254 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/lifecycle/InitialisationException.html)有谁可以帮我?我尝试了很多东西,但没有任何运气。
最后但并非最不重要的一点是,我还研究了http://www.mulesoft.org/documentation/display/MULE3USER/Consuming+Web+Services+with+CXF,但问题在于提供的内部服务存在多个参数和没有内部WSDL。
谢谢你的回复,它帮了很多忙。经过一些尝试和错误,我得到了.有点..。
目前,代理为我提供了一个本地WSDL (按预期工作)。然而,经过更仔细的检查,WSDL的SOAP1.2部分保持不变,并且仍然指向原来的位置。更糟糕的是,当调用SOAP1.1部分时,会出现一个错误(虽然原始版本运行良好)。
所以我正朝着正确的方向前进。现在只是为了解决这些问题。
除此之外,也许有人能给我指明正确的方向。假设我想从外部服务获取输出,并且只计算所有时间,并以XML形式将其抛回本地服务。这是否属于自定义变压器类别?
我使用了以下代码:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/3.2/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.2/mule-http.xsd">
<flow name="test">
<http:inbound-endpoint address="http://localhost:8090/tis/proxy" exchange-pattern="request-response"/>
<cxf:proxy-service
wsdlLocation="services/tisclientws.wsdl"
service="tisclientws"
namespace="NAMESPACEHERE"
validationEnabled="true"
enableMuleSoapHeaders="false"
/>
<http:outbound-endpoint address="EXTERNALURL/tisclientws.asmx" exchange-pattern="request-response"/>
</flow>
</mule>从SOAP1.1接收到的错误:
<faultstring>Schema validation error on message from client: tag name "icTables" is not allowed. Possible tag names are: <iiBSNNummer>.</faultstring>禁用验证后,错误更改为:
<faultcode>soap:Server</faultcode>
<faultstring>Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=EXTERNALADDRESS/tisclientws.asmx, connector=HttpConnector
{
name=connector.http.mule.default
lifecycle=start
this=17b79a6
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[http]
serviceOverrides=<none>
}
, name='endpoint.EXTERNALADDRESS.tisclientws.asmx', mep=REQUEST_RESPONSE, properties={}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: DepthXMLStreamReader</faultstring>发布于 2012-01-05 16:53:14
WSProxyService是Mule 2遗留下来的,不会处理流,只处理服务。相反,更愿意使用以下两种方法:
。
发布于 2012-02-23 00:02:34
如果它是一个代理,那么您可以使用Web服务代理模式。
<pattern:web-service-proxy
xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern"
wsdlLocation="${worker.wsdlLocation}"
name="WorkerDummy-WSProxyRequestOrder"
inboundAddress="${worker.inboundAddress}"
outboundAddress="${worker.outboundAddress}">
</pattern:web-service-proxy>https://stackoverflow.com/questions/8743330
复制相似问题