【问题标题】:Mule 3.6.1 HTTPS ountbound GET/POSTMule 3.6.1 HTTPS 出站 GET/POST
【发布时间】:2017-08-31 05:42:53
【问题描述】:

您好,我正在尝试使用(Mule 3.6.1)https 出站端点以获得响应。在这种情况下,我无法做出任何回应。但是,如果我使用 Mule 3.4.0 depriated http outbound(在下面的 xml 文件中注释)我可以得到响应。有没有可能使用 Mule 3.6.1 https 出站端点从“https://httpbin.org/ip”获取响应。

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

<mule xmlns:https="http://www.mulesoft.org/schema/mule/https"
xmlns:http="http://www.mulesoft.org/schema/mule/http" 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" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/current/mule-https.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/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">

<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" basePath="miraj" doc:name="HTTP Listener Configuration"/>
<http:request-config name="HTTP_Request_Configuration" protocol="HTTPS" host="httpbin.org" port="443" doc:name="HTTP Request Configuration"/>
<!-- <https:connector name="HTTPS_Connector" cookieSpec="netscape" validateConnections="false" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" sendTcpNoDelay="true" clientSoTimeout="40000" serverSoTimeout="40000" socketSoLinger="0" doc:name="HTTP\HTTPS">
</https:connector> -->

 <flow name="testmulehttpsFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="hamid" doc:name="HTTP"/>
    <logger message="Hiiiii" level="INFO" doc:name="Logger"/>
    <http:request config-ref="HTTP_Request_Configuration" path="ip" method="GET" doc:name="HTTPS"/>
     <!--<https:outbound-endpoint exchange-pattern="request-response" method="GET" connector-ref="HTTPS_Connector" address="https://httpbin.org/ip"  doc:name="HTTPS"  contentType="application/xml">
    </https:outbound-endpoint> -->
 </flow>

</mule>

【问题讨论】:

    标签: https mule response outbound


    【解决方案1】:

    我找到了解决办法。

    我们需要从位于 /Eclipse/plugins/org.mule.tooling.server.3.8.1_6.0.0.201612271237/mule/lib/user 文件夹的 CE 运行时中删除一个名为 async-http-client 的 jar。

    重启 mule 就可以正常工作了。

    【讨论】:

      【解决方案2】:

      当我将 http 请求配置更改为 HTTP 而不是 HTTPS 时,它工作正常

      <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" basePath="miraj" doc:name="HTTP Listener Configuration"/>
      <http:request-config name="HTTP_Request_Configuration"  host="httpbin.org" port="80" doc:name="HTTP Request Configuration"/>
      
       <flow name="testmulehttpsFlow">
          <http:listener config-ref="HTTP_Listener_Configuration" path="hamid" doc:name="HTTP"/>
          <logger message="Hiiiii" level="INFO" doc:name="Logger"/>
          <http:request config-ref="HTTP_Request_Configuration" path="ip" method="GET" doc:name="HTTPS"/>
       </flow>
      

      对于 HTTPS 尝试将 TLS 配置添加到请求配置中。

      希望这会有所帮助。

      【讨论】:

      • 那是因为 httpbin.org/ip 也有一个 http 服务。我的问题是如何使用 Mule 3.6.1 https outbound endopint 从 HTTPS url 获得响应。
      • 要使用 HTTPS url,您必须使用带有请求配置的 TLS 配置。
      • 你能指导我怎么做吗?有资源吗?
      • 请参考TLS configuration。您还需要来自httpbin.org/ip 的 SSL 证书。证书存储请参考this
      猜你喜欢
      • 1970-01-01
      • 2016-05-04
      • 2012-07-22
      • 1970-01-01
      • 2012-02-06
      • 1970-01-01
      • 2021-06-30
      • 1970-01-01
      • 2020-11-03
      相关资源
      最近更新 更多