首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Mule ESB代理ESB服务

Mule ESB代理ESB服务
EN

Stack Overflow用户
提问于 2012-01-05 13:29:20
回答 2查看 4.5K关注 0票数 1

目前,我们正在尝试使用Mule ESB构建一个代理,该代理提供内部we服务,然后转到具有内部we服务参数的外部soap服务。一旦我得到了它,我将改变soap的内容和布局。然后,第三步,结果必须由Mule计算。

但是在我们到达第2和第3步之前,让我们先从代理开始。目前,我正在查看http://www.mulesoft.org/documentation/display/MULE3USER/Proxying+Web+Services,但是提供的WSProxyService不起作用。代码似乎是Mule 2.2的代码。我试着重建了它,看起来是这样的:

代码语言:javascript
复制
<?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>

然而,这会导致错误。

代码语言:javascript
复制
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形式将其抛回本地服务。这是否属于自定义变压器类别?

我使用了以下代码:

代码语言:javascript
复制
<?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接收到的错误:

代码语言:javascript
复制
 <faultstring>Schema validation error on message from client: tag name "icTables" is not allowed. Possible tag names are: &lt;iiBSNNummer>.</faultstring>

禁用验证后,错误更改为:

代码语言:javascript
复制
 <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=&lt;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>
EN

回答 2

Stack Overflow用户

发布于 2012-01-05 16:53:14

WSProxyService是Mule 2遗留下来的,不会处理流,只处理服务。相反,更愿意使用以下两种方法:

  • A web service proxy pattern
  • A CXF proxy,如果您需要比ws-代理服务模式所提供的更多的控制。

票数 6
EN

Stack Overflow用户

发布于 2012-02-23 00:02:34

如果它是一个代理,那么您可以使用Web服务代理模式。

代码语言:javascript
复制
    <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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8743330

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档