Mule 3.6.1 HTTPS ountbound GET/POST

235 views Asked by At

Hi I am trying to use(Mule 3.6.1) https outbound endpoint in order to get a response. With this conditions I couldnt make any response. But however if I use Mule 3.4.0 depricated http outbound(which is commented in below xml file) I can get a response. Is there any possible way to get the response from "https://httpbin.org/ip" by using Mule 3.6.1 https outbound endpoint.

<?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>
2

There are 2 answers

4
AnupamBhusari On

It works fine, when I changed http request config to HTTP instead of 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>

For HTTPS try to add TLS configuration to request config.

Hope this helps.

0
Miraj Hamid On

I found the solution.

We need to remove a jar called async-http-client from you CE Runtime located at /Eclipse/plugins/org.mule.tooling.server.3.8.1_6.0.0.201612271237/mule/lib/user folder.

Restart mule and it will work fine.