C# 如何在mule 3.7.0 CE上代理web服务

C# 如何在mule 3.7.0 CE上代理web服务,c#,web-services,proxy,mule,C#,Web Services,Proxy,Mule,我使用mule 3.4.0 CE代理远程web服务,但使用新的3.7.0 CE,我找不到任何在流上工作的示例,因此我可以使用http共享连接器,有什么线索吗 不适用于基于C#的消费者的示例: <flow name="Test"> <http:listener config-ref="HTTP_Listener_Configuration" path="/services/teste/teste" doc:name="HTTP"/> <logger m

我使用mule 3.4.0 CE代理远程web服务,但使用新的3.7.0 CE,我找不到任何在流上工作的示例,因此我可以使用http共享连接器,有什么线索吗

不适用于基于C#的消费者的示例:

<flow name="Test">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/services/teste/teste" doc:name="HTTP"/>
    <logger message="AutenticacaoServicoFlowTesteHttp - #[message]" level="INFO" doc:name="Logger"/>
    <response>
        <logger message="ATestHttp - response - #[message]" level="INFO" doc:name="Logger"/>
    </response>
    <set-variable variableName="queryStringIncompleto" value="#[message.inboundProperties.'host']/logTicket?ipFrom=#[message.inboundProperties.'http.remote.address']&amp;requestSize=#[message.inboundProperties.'http.request.uri'.length()]&amp;url=#[message.inboundProperties.'host']#[message.inboundProperties.'http.request.uri'.replaceAll(&quot;&amp;&quot;, &quot;%26&quot;)]&amp;userName=#[message.inboundProperties.'authorization']&amp;modifiedRequestSize=#[message.inboundProperties.'http.request.uri'.length()]" doc:name="QueryString LogTicket"/>
    <choice doc:name="Choice">
        <when expression="#[message.inboundProperties.'http.request.uri' == '/services/Autentic?wsdl']">
            <set-variable variableName="queryString" value="#[flowVars.queryStringIncompleto]&amp;method=#[message.inboundProperties.'http.method']" doc:name="QueryString LogBilhetagem"/>
            <cxf:proxy-service  namespace="logTeste.gov" service="AutenticacaoServico" payload="envelope" wsdlLocation="${targetServerLog}/servicos/v2/Autentic.svc?singleWsdl" soapVersion="1.2" doc:name="CXF"/>
        </when>
        <otherwise>
            <set-variable variableName="queryString" value="#[flowVars.queryStringIncompleto]&amp;method=#[message.inboundProperties.'SOAPAction'.replaceAll(&quot;\&quot;&quot;, &quot;&quot;)]" doc:name="QueryString LogTicket"/>
            <message-properties-transformer doc:name="Message Properties">
                <add-message-property key="SOAPAction" value="#[message.inboundProperties.'SOAPAction']"/>
            </message-properties-transformer>
            <outbound-endpoint exchange-pattern="request-response" address="${targetServerLog}/servicos/v2/Autentc.svc" encoding="UTF-8" mimeType="text/xml" doc:name="Generic"/>
        </otherwise>
    </choice>
    <set-variable variableName="payloadLog" value="#[message.payloadAs(java.lang.String)]" doc:name="Guarda Payload Log"/>
    <outbound-endpoint exchange-pattern="request-response" address="https://teste:teste@#[flowVars.queryString]" doc:name="Log Bilhetagem"/>
    <set-payload value="#[flowVars.payloadLog]" doc:name="Set Payload"/>
    <response>
        <message-properties-transformer doc:name="Message Properties">
            <add-message-property key="Content-Type" value="text/xml"/>
        </message-properties-transformer>
    </response>
</flow>


您尝试代理服务的方式不是理想的方式,也不是3.4中的理想方式,请参阅以下文档页面:


这是代理Web服务的两种标准方式。

您尝试代理服务的方式不是理想的方式,也不是3.4中的理想方式,请参阅以下文档页面:


这是代理Web服务的两种标准方式。

您尝试代理服务的方式不是理想的方式,也不是3.4中的理想方式,请参阅以下文档页面:


这是代理Web服务的两种标准方式。

您尝试代理服务的方式不是理想的方式,也不是3.4中的理想方式,请参阅以下文档页面:


这是代理Web服务的两种标准方法。

好的,找到了问题并解决了,不是实现,我所做的是将WS重定向到正确的位置,但我也将消息记录到另一个WS,这将挂起流,并且不可能对许多方法进行级联调用。 因此,我只是取出Second outbound来记录消息,我将使用另一种方法来记录消息

代码:



好的,发现了问题并解决了,这不是实现,我所做的是将一个WS重定向到正确的位置,但我也将消息记录到另一个WS,这将挂起流,并且不可能对许多方法进行级联调用。 因此,我只是取出Second outbound来记录消息,我将使用另一种方法来记录消息

代码:



好的,发现了问题并解决了,这不是实现,我所做的是将一个WS重定向到正确的位置,但我也将消息记录到另一个WS,这将挂起流,并且不可能对许多方法进行级联调用。 因此,我只是取出Second outbound来记录消息,我将使用另一种方法来记录消息

代码:



好的,发现了问题并解决了,这不是实现,我所做的是将一个WS重定向到正确的位置,但我也将消息记录到另一个WS,这将挂起流,并且不可能对许多方法进行级联调用。 因此,我只是取出Second outbound来记录消息,我将使用另一种方法来记录消息

代码:



我使用模式:web service proxy进行了一个实现,但它不允许我使用共享连接器,我的cxf实现挂起在MS消费者上,因此我不知道该怎么做…我通常做的是启用http wire日志,并比较mule进行的调用与正常工作的直接调用之间的差异,对于基于MS的Web服务,通常http头是问题所在。好的,我使用了模式,但我不能使用共享资源端口,关于如何使用的任何线索?如果您的域中有全局http或https连接器,那么代理模式将使用它,否则,您可以简单地使用connector ref属性来引用共享资源连接器。我使用pattern:web服务代理实现了一个实现,但它不允许我使用共享连接器,而我的cxf实现挂起在MS消费者上,所以我不知道该怎么做…我通常做的是启用http wire日志,比较mule发出的调用与正常工作的直接调用之间的差异,对于基于MS的Web服务,通常http头是问题所在。好的,我使用了模式,但我不能使用共享资源端口,如果你的域中有一个全局http或https连接器,那么代理模式将使用它,否则,您可以简单地使用connector ref属性来引用共享资源连接器。我使用pattern:web服务代理实现了一个实现,但它不允许我使用共享连接器,而我的cxf实现挂起在MS消费者上,所以我不知道该怎么做…我通常做的是启用http wire日志,比较mule发出的调用与正常工作的直接调用之间的差异,对于基于MS的Web服务,通常http头是问题所在。好的,我使用了模式,但我不能使用共享资源端口,如果你的域中有一个全局http或https连接器,那么代理模式将使用它,否则,您可以简单地使用connector ref属性来引用共享资源连接器。我使用pattern:web服务代理实现了一个实现,但它不允许我使用共享连接器,而我的cxf实现挂起在MS消费者上,所以我不知道该怎么做…我通常做的是启用http wire日志,比较mule发出的调用与正常工作的直接调用之间的差异,对于基于MS的Web服务,通常http头是问题所在。好的,我使用了模式,但我不能使用共享资源端口,关于如何操作的任何线索?如果您的域中有一个全局http或https连接器,那么代理模式将使用该连接器,否则您可以简单地使用连接器ref属性来引用共享资源连接器。
<flow name="Test">
<http:listener config-ref="HTTP_Listener_Configuration" path="/services/teste/teste" doc:name="HTTP"/>
<set-variable variableName="queryStringIncompleto" value="#[message.inboundProperties.'host']/logTicket?ipFrom=#[message.inboundProperties.'http.remote.address']&amp;requestSize=#[message.inboundProperties.'http.request.uri'.length()]&amp;url=#[message.inboundProperties.'host']#[message.inboundProperties.'http.request.uri'.replaceAll(&quot;&amp;&quot;, &quot;%26&quot;)]&amp;userName=#[message.inboundProperties.'authorization']&amp;modifiedRequestSize=#[message.inboundProperties.'http.request.uri'.length()]" doc:name="QueryString LogTicket"/>
<choice doc:name="Choice">
    <when expression="#[message.inboundProperties.'http.request.uri' == '/services/Autentic?wsdl']">
        <set-variable variableName="queryString" value="#[flowVars.queryStringIncompleto]&amp;method=#[message.inboundProperties.'http.method']" doc:name="QueryString LogBilhetagem"/>
        <cxf:proxy-service  namespace="logTeste.gov" service="AutenticacaoServico" payload="envelope" wsdlLocation="${targetServerLog}/servicos/v2/Autentic.svc?singleWsdl" soapVersion="1.2" doc:name="CXF"/>
    </when>
    <otherwise>
        <set-variable variableName="queryString" value="#[flowVars.queryStringIncompleto]&amp;method=#[message.inboundProperties.'SOAPAction'.replaceAll(&quot;\&quot;&quot;, &quot;&quot;)]" doc:name="QueryString LogTicket"/>
        <message-properties-transformer doc:name="Message Properties">
            <add-message-property key="SOAPAction" value="#[message.inboundProperties.'SOAPAction']"/>
        </message-properties-transformer>
        <outbound-endpoint exchange-pattern="request-response" address="${targetServerLog}/servicos/v2/Autentc.svc" encoding="UTF-8" mimeType="text/xml" doc:name="Generic"/>
    </otherwise>
</choice>
<response>
    <message-properties-transformer doc:name="Message Properties">
        <add-message-property key="Content-Type" value="text/xml"/>
    </message-properties-transformer>
</response>