Mule Web Service Consumer not adding SOAP wrapper properly - json

I'm trying to set up a flow that involves taking in a JSON payload through an HTTP endpoint, transforming it into an XML payload to be used for a SOAP transaction, then turned back into a JSON payload, much like in this demo here: https://www.youtube.com/watch?v=XyZcI1_MbOo.
Now, I'm setting up the flow, and have the Web Service Consumer component up and running. Trying to debug the flow, I'm simply doing the first transformation to XML, sending the message to the Web Service Consumer, and then writing the resultant message to a file. My flow is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:ws="http://www.mulesoft.org/schema/mule/ws" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" 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.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/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/wmq http://www.mulesoft.org/schema/mule/ee/wmq/current/mule-wmq-ee.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/ws http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.example.org/Transactions/">
<http:listener-config name="HTTP_Listener_Configuration" host="10.14.5.211" port="8081" doc:name="HTTP Listener Configuration"/>
<ws:consumer-config name="Web_Service_Consumer" wsdlLocation="Transactions.wsdl" service="Transactions" port="TransactionsSOAP" serviceAddress="http://www.example.org/Transactions/" doc:name="Web Service Consumer"/>
<flow name="soapboxFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="*" doc:name="HTTP"/>
<dw:transform-message doc:name="Transform Message" metadata:id="1639d844-c95e-4feb-bda5-6258ec392591">
<dw:set-payload><![CDATA[%dw 1.0
%output application/xml
%namespace ns0 http://www.example.org/Transactions/
---
{
ns0#makePayment: {
cId: payload.payments.account_no,
noTrans: 1,
payList: {
(payload.payments map ((payment , indexOfPayment) -> {
pay: {
aNum: payment.account_no,
aName: payment.account_no,
am: payment.amount,
ref: payment.description,
des: payment.description,
qu: payment.quantity
}
}))
}
}
}]]></dw:set-payload>
</dw:transform-message>
<ws:consumer config-ref="Web_Service_Consumer" doc:name="Web Service Consumer" operation="makePayment"/>
</flow>
</mule>
(sorry for all the spacing in the DW component). The associated WSDL looks like this:
<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="Transactions" targetNamespace="http://www.example.org/Transactions/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/Transactions/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:documentation>
<wsdl:appinfo source="WMQI_APPINFO">
<MRWSDLAppInfo imported="true">
<binding hasEncoding="false" imported="true" name="TransactionsSOAP" originalBindingStyle="document"/>
</MRWSDLAppInfo>
</wsdl:appinfo>
</wsdl:documentation>
<wsdl:types>
<xsd:schema targetNamespace="http://www.example.org/Transactions/" xmlns:testSchExtn="http://www.test.com/schema/extensions/">
<xsd:include schemaLocation="Transactions_InlineSchema1.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="retrieveTransactionsRequest">
<wsdl:part element="tns:transactionRequest" name="transactionRequest"/>
</wsdl:message>
<wsdl:message name="retrieveTransactionsResponse">
<wsdl:part element="tns:transactionResponse" name="transactionResponse"/>
</wsdl:message>
<wsdl:message name="makePaymentRequest">
<wsdl:part element="tns:makePayment" name="paymentRequest"/>
</wsdl:message>
<wsdl:message name="makePaymentResponse">
<wsdl:part element="tns:makePaymentResponse" name="paymentResponse"/>
</wsdl:message>
<wsdl:portType name="Transactions">
<wsdl:operation name="retrieveTransactions">
<wsdl:input message="tns:retrieveTransactionsRequest"/>
<wsdl:output message="tns:retrieveTransactionsResponse"/>
</wsdl:operation>
<wsdl:operation name="makePayment">
<wsdl:input message="tns:makePaymentRequest"/>
<wsdl:output message="tns:makePaymentResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TransactionsSOAP" type="tns:Transactions">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="retrieveTransactions">
<soap:operation soapAction="http://www.example.org/Transactions/retrieveTransactions"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="makePayment">
<soap:operation soapAction="http://www.example.org/Transactions/makePayment"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Transactions">
<wsdl:port binding="tns:TransactionsSOAP" name="TransactionsSOAP">
<soap:address location="www.example.com"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Finally, when I input my sample JSON file into the flow, and look at the output result, I get this file:
Response was of unexpected text/html ContentType. Incoming portion of HTML stream: <?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 - Not Found</title>
</head>
<body>
<h1>404 - Not Found</h1>
<script type="text/javascript" src="http://gp1.wpc.edgecastcdn.net/00222B/jtest/tpbeacontest.js"></script>
</body>
</html>
. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: PushbackInputStream
So clearly, something is getting mucked up -- I don't know why the content type in the resultant file was of text/html, as I certainly didn't configure it that way. Any suggestions as to where I've gone wrong?

Your config not readable but my guess is that you don't have an endpoint after cxf component (outbound-endpoint) see below as its needed.
<mule ...>
................ initial flow
<cxf:jaxws-client operation="yourOperation" clientClass="com.abc.ws.endpoints.XYZService" port="port" enableMuleSoapHeaders="true" doc:name="docName">
<cxf:jaxb-databinding/>
</cxf:jaxws-client>
<outbound-endpoint address="http://localhost:8080/my/url/enpoint" doc:name="documentName" exchange-pattern="request-response"/>**
<echo-component doc:name="Echo"/>
</flow>
</mule>

You received a 404 looks like the service is not available from Mule.
Are you behind a proxy or firewall, are you able to call this operation from another tool as SOAP UI?

I've taken a look at the WSDL and Mule configuration provided and can see that you have configured your web service location at http://www.example.org/Transactions/ but it doesn't look like there's a web service there. Unless your positive this should work, I'd say that's the case.
If you want to try a Web Service that's public and responsive check out http://www.webservicex.net/globalweather.asmx?WSDL
For future reference, it's advisable to enable wire logging to see what's going on when troubleshooting this issues. Just add the following o the log4j2.xml file
<AsyncLogger name="org.mule.module.http.internal.HttpMessageLogger" level="DEBUG" />
<AsyncLogger name="com.ning.http" level="DEBUG" />

Related

MuleESB: Salesforce data insertion into mysql database

I´ve got a question concerning inserting salesforce data into a mysql database.
I can query the salesforce account and i´m retrieving the right data from salesforce account.
If i wanna insert the salesforce data into mysql database, there is an error.
Just NULL values will be inserted into the database.
I think the input into the mysql component is right, but the output is wrong.
Maybe you can help me.
Attached is my xml code. What´s wrong?
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:sfdc="http://www.mulesoft.org/schema/mule/sfdc" 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.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/sfdc http://www.mulesoft.org/schema/mule/sfdc/current/mule-sfdc.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<db:mysql-config name="MySQL_Configuration" host="localhost" port="xxx" user="xxx" password="xxx" database="salesforce" doc:name="MySQL Configuration"/>
<sfdc:config name="Salesforce__Basic_Authentication" username="xxxx" password="xxx" securityToken="xxxx" doc:name="Salesforce: Basic Authentication"/>
<flow name="salesforce_query_mysqlFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/demo" doc:name="HTTP"/>
<sfdc:query config-ref="Salesforce__Basic_Authentication" query="dsql:SELECT BillingCity,BillingCountry,BillingPostalCode,BillingStreet,Id,Name,Phone,Website FROM Account" doc:name="Salesforce"/>
<logger message="#[org.apache.commons.collections.IteratorUtils.toList(message.payload)]" level="INFO" metadata:id="d66ba8a4-9f12-4def-b4fe-ea0669d02170" doc:name="Logger"/>
<dw:transform-message metadata:id="72012d35-6807-484b-89bf-cab577f4f646" doc:name="Transform Message">
<dw:input-payload mimeType="application/java" doc:sample="sample_data/list_Account_2.dwl"/>
<dw:input-variable variableName="salesforce_data"/>
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
payload map {
BillingCountry: $.BillingCountry,
BillingCity: $.BillingCity,
BillingStreet: $.BillingStreet,
Phone: $.Phone,
Website: $.Website,
BillingPostalCode: $.BillingPostalCode,
Name: $.Name,
SalesforceId: $.Id
}]]></dw:set-payload>
</dw:transform-message>
<db:insert config-ref="MySQL_Configuration" doc:name="Database" >
<db:parameterized-query><![CDATA[INSERT INTO salesforce.salesforce_account(
BillingCity,BillingCountry,BillingPostalCode,BillingStreet,Name,Phone,Website,Id)
VALUES
(#[message.payload.BillingCity],#[message.payload.BillingCountry],#[message.payload.BillingPostalCode], #[message.payload.BillingStreet], #[message.payload.Name], #[message.payload.Phone],#[message.payload.Website],
#[message.payload.SalesforceId]);]]></db:parameterized-query>
</db:insert>
<logger message="#[message.payload]" level="INFO" doc:name="Logger"/>
</flow>
</mule>
You need one more step to be able to insert all records from Salesforce to the Database. In current configuration the output of Transform Message component is a List of record. Whilst the Database query requires a single record. Therefore you should choose one of the following options:
Add a Collection Splitter component between the Transform Message and Database
Check/tick the Bulk Mode option inside the Basic Settings section in Database properties bulkMode="true"

Unable to set CSV as payload in Mule

I am trying to create a flow in Mule 3.7.3 which reads a CSV file from an input folder, does some processing and then writes the original CSV file to an output folder at the end of the flow when everything has completed successfully.
I thought I would save the CSV in a variable and then set the payload using this variable before it creates the file in the output directory.
Everything worked ok when I just had the two sftp connectors to read and write in the flow but then when I added a transform message connector, the file written to the output folder is empty or it fails with a "stream closed" error message. I would have expected the set payload connector to overwrite the transform message so wouldn't have thought there would be a problem.
Does anyone know how I can fix this?
The SFTP server I am using is CrushFTP.
XML flow:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:ftp="http://www.mulesoft.org/schema/mule/ftp" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:sftp="http://www.mulesoft.org/schema/mule/sftp" xmlns:batch="http://www.mulesoft.org/schema/mule/batch" 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.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/sftp http://www.mulesoft.org/schema/mule/sftp/current/mule-sftp.xsd
http://www.mulesoft.org/schema/mule/batch http://www.mulesoft.org/schema/mule/batch/current/mule-batch.xsd
http://www.mulesoft.org/schema/mule/ee/ftp http://www.mulesoft.org/schema/mule/ee/ftp/current/mule-ftp-ee.xsd
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/current/mule-ftp.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd">
<http:request-config name="HTTP_Request_Configuration" host="${host}" port="${orderprocess.port}" doc:name="HTTP Request Configuration"></http:request-config>
<sftp:connector name="SFTP" validateConnections="true" doc:name="SFTP" pollingFrequency="1000000"/>
<flow name="userFlow">
<sftp:inbound-endpoint connector-ref="SFTP" host="localhost" port="2222" path="//input" user="${ftp.user}" password="${ftp.password}" responseTimeout="10000" doc:name="SFTP"/>
<set-variable variableName="storeCsv" value="#[payload]" mimeType="application/csv" doc:name="Store CSV"/>
<dw:transform-message doc:name="Transform Message">
<dw:input-payload mimeType="application/csv"/>
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
payload]]></dw:set-payload>
</dw:transform-message>
<set-payload value="#[flowVars.storeCsv]" mimeType="application/csv" doc:name="Set Payload"/>
<sftp:outbound-endpoint exchange-pattern="one-way" host="localhost" port="2222" responseTimeout="10000" doc:name="SFTP" connector-ref="SFTP" password="${ftp.password}" path="//output" user="${ftp.user}" outputPattern="#[message.inboundProperties.originalFilename+'.processed']"/>
</flow>
</mule>
CSV file
1, user1
Do <object-to-string-transformer/> after <sftp> connector

How to merge two wsdl in a wsdl file?

I created a proxy in WSO2 ESB, and used two different endpoints in it. Then I want to publish a common wsdl. I have two wsdl adresses from two different web services.
1- http://localhost:12080/SRV-CSB-MOCK/CsbService?wsdl
<?xml version="1.0" ?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://csb.sgrs.ayesas.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="CsbService" targetNamespace="http://csb.sgrs.ayesas.com/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://csb.sgrs.ayesas.com/" elementFormDefault="unqualified" targetNamespace="http://csb.sgrs.ayesas.com/" version="1.0">
<xs:element name="carpma" type="tns:carpma"></xs:element>
<xs:element name="carpmaResponse" type="tns:carpmaResponse"></xs:element>
<xs:complexType name="carpma">
<xs:sequence>
<xs:element name="ilk" type="xs:int"></xs:element>
<xs:element name="son" type="xs:int"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="carpmaResponse">
<xs:sequence>
<xs:element name="return" type="xs:int"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="carpma">
<wsdl:part element="tns:carpma" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="carpmaResponse">
<wsdl:part element="tns:carpmaResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="CsbService">
<wsdl:operation name="carpma">
<wsdl:input message="tns:carpma" name="carpma">
</wsdl:input>
<wsdl:output message="tns:carpmaResponse" name="carpmaResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CsbServiceSoapBinding" type="tns:CsbService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"></soap:binding>
<wsdl:operation name="carpma">
<soap:operation soapAction="carpma" style="document"></soap:operation>
<wsdl:input name="carpma">
<soap:body use="literal"></soap:body>
</wsdl:input>
<wsdl:output name="carpmaResponse">
<soap:body use="literal"></soap:body>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CsbService">
<wsdl:port binding="tns:CsbServiceSoapBinding" name="CsbServicePort">
<soap:address location="http://localhost:12080/SRV-CSB-MOCK/CsbService"></soap:address>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
2- http://localhost:12080/SRV_DBS_MOCK/MockGTHBService/MockGTHBService?wsdl
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:tns="http://gthb.dbs.ayesas.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://gthb.dbs.ayesas.com/">
<wsdl:types>
<xsd:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://gthb.dbs.ayesas.com/" version="1.0">
<xsd:element name="add" type="tns:add"></xsd:element>
<xsd:element name="addResponse" type="tns:addResponse"></xsd:element>
<xsd:complexType name="add">
<xsd:sequence>
<xsd:element name="x" type="xsd:int"></xsd:element>
<xsd:element name="y" type="xsd:int"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="addResponse">
<xsd:sequence>
<xsd:element name="return" type="xsd:int"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="add">
<wsdl:part name="parameters" element="tns:add"></wsdl:part>
</wsdl:message>
<wsdl:message name="addResponse">
<wsdl:part name="parameters" element="tns:addResponse"></wsdl:part>
</wsdl:message>
<wsdl:portType name="GTHBProxyPortType">
<wsdl:operation name="add">
<wsdl:input message="tns:add" wsaw:Action="add"></wsdl:input>
<wsdl:output message="tns:addResponse" wsaw:Action="http://gthb.dbs.ayesas.com/MockGTHBService/addResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="GTHBProxySoap11Binding" type="tns:GTHBProxyPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding>
<wsdl:operation name="add">
<soap:operation soapAction="add" style="document"></soap:operation>
<wsdl:input>
<soap:body use="literal"></soap:body>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"></soap:body>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="GTHBProxySoap12Binding" type="tns:GTHBProxyPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap12:binding>
<wsdl:operation name="add">
<soap12:operation soapAction="add" style="document"></soap12:operation>
<wsdl:input>
<soap12:body use="literal"></soap12:body>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"></soap12:body>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="GTHBProxyHttpBinding" type="tns:GTHBProxyPortType">
<http:binding verb="POST"></http:binding>
<wsdl:operation name="add">
<http:operation location="add"></http:operation>
<wsdl:input>
<mime:content type="text/xml" part="parameters"></mime:content>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="parameters"></mime:content>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="GTHBProxy">
<wsdl:port name="GTHBProxyHttpSoap11Endpoint" binding="tns:GTHBProxySoap11Binding">
<soap:address location="http://localhost.localdomain:8280/services/GTHBProxy.GTHBProxyHttpSoap11Endpoint"></soap:address>
</wsdl:port>
<wsdl:port name="GTHBProxyHttpsSoap11Endpoint" binding="tns:GTHBProxySoap11Binding">
<soap:address location="https://localhost.localdomain:8243/services/GTHBProxy.GTHBProxyHttpsSoap11Endpoint"></soap:address>
</wsdl:port>
<wsdl:port name="GTHBProxyHttpsSoap12Endpoint" binding="tns:GTHBProxySoap12Binding">
<soap12:address location="https://localhost.localdomain:8243/services/GTHBProxy.GTHBProxyHttpsSoap12Endpoint"></soap12:address>
</wsdl:port>
<wsdl:port name="GTHBProxyHttpSoap12Endpoint" binding="tns:GTHBProxySoap12Binding">
<soap12:address location="http://localhost.localdomain:8280/services/GTHBProxy.GTHBProxyHttpSoap12Endpoint"></soap12:address>
</wsdl:port>
<wsdl:port name="GTHBProxyHttpsEndpoint" binding="tns:GTHBProxyHttpBinding">
<http:address location="https://localhost.localdomain:8243/services/GTHBProxy.GTHBProxyHttpsEndpoint"></http:address>
</wsdl:port>
<wsdl:port name="GTHBProxyHttpEndpoint" binding="tns:GTHBProxyHttpBinding">
<http:address location="http://localhost.localdomain:8280/services/GTHBProxy.GTHBProxyHttpEndpoint"></http:address>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I want to merge them in a wsdl file. I added the schemas and methods of second wsdl to first wsdl. But I cannot change targetNamespace="http://csb.sgrs.ayesas.com/" in definitions. So I can't access another methods in second wsdl.
Here is a similar questions on StackOverflow that might be of assistance:
Multiple wsdl and xsd files... into a single wsdl
With WsO2 At times it's easier to have two separate endpoints and then create a service that will call both of them and then blend the two results together using an XSLT transformation, or whatever the correct action is for your business use case.
But when you need to have one service that calls two different endpoints, you have the option of creating a WSDL that represents both endpoints by creating a namespace that can work for both.
If you are manually creating a WSDL consider these points:
Ensure that the target namespace of the two WSDL files is the same. If it is not, you will need to update the namespace in one of the files to match the other. IE: Both calls need to have a unique name.
Check for any duplicate element or type definitions in the two WSDL files and remove them.
Check for any naming conflicts between elements, types, and operations in the two WSDL files and resolve them.
Ensure that all imported and included files in the two WSDL files are also merged and their references are updated accordingly.
Validate the merged WSDL file to ensure that it is syntactically and semantically correct.
Test the merged WSDL file with a SOAP client to ensure that it works as expected.

Mule - Track Order (Tshirt Service) returning Malformed JSON?

I am sending a request to the Mulesoft tshirt service to track the order.
I am sending a JSON request via Postman (Chrome) and I am getting a error returned in Postman: Malformed JSON.
But there is nothing in the Mulesoft Studio console.
Mulesoft Flow
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" version="EE-3.5.0" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:ws="http://www.mulesoft.org/schema/mule/ws" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="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/ws http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd">
<ws:consumer-config doc:name="Web Service Consumer" name="Web_Service_Consumer" port="TshirtServicePort" service="TshirtService" serviceAddress="http://tshirt-service.cloudhub.io" wsdlLocation="tshirt.wsdl"/>
<data-mapper:config doc:name="xml_listinventoryresponse__to_json" name="xml_listinventoryresponse__to_json" transformationGraphPath="xml_listinventoryresponse__to_json.grf"/>
<data-mapper:config doc:name="xml_ordertshirtresponse__to_json" name="xml_ordertshirtresponse__to_json" transformationGraphPath="xml_ordertshirtresponse__to_json.grf"/>
<data-mapper:config doc:name="string_to_xml_authenticationheader_" name="string_to_xml_authenticationheader_" transformationGraphPath="string_to_xml_authenticationheader_.grf"/>
<data-mapper:config name="JSON_To_Xml_OrderTshirt_" transformationGraphPath="json_to_xml_ordertshirt_.grf" doc:name="JSON_To_Xml_OrderTshirt_"/>
<data-mapper:config name="JSON_To_Xml_TrackOrder_" transformationGraphPath="json_to_xml_trackorder_.grf" doc:name="JSON_To_Xml_TrackOrder_"/>
<data-mapper:config name="XML_To_JSON" transformationGraphPath="xml_to_json.grf" doc:name="XML_To_JSON"/>
<flow name="OrderTracking" doc:name="OrderTracking">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8001" path="orderTracking" doc:name="HTTP"/>
<data-mapper:transform config-ref="JSON_To_Xml_TrackOrder_" doc:name="JSON To Xml<TrackOrder>"/>
<ws:consumer config-ref="Web_Service_Consumer" operation="TrackOrder" doc:name="TrackOrder"/>
<data-mapper:transform config-ref="XML_To_JSON" doc:name="XML To JSON"/>
<http:response-builder status="200" contentType="application/json" doc:name="HTTP Response Builder"/>
</flow>
</mule>
JSON request
{
"email":"info8001#mulesoft.com",
"orderId":"264"
}
It appears your JSON request it not proper.
The JSON you provided when converted to XML will be as follows
<?xml version="1.0" encoding="UTF-8" ?>
<email>info8001#mulesoft.com</email>
<orderId>264</orderId>
Which is not complete as there is no root element to enclose the data in the XML.
Try modifying your JSON and see if it works.

Mule ESB download file from URL string

So, using Mule ESB, I'm searching Bing for certain PDF files. Then I'm parsing the JSON response to capture the URL of the file location. Now I need to retrieve the file and save locally. Below is what I have so far, but I have a feeling I'm going about this all wrong. How can I complete the use case?
I'm having two problems:
1) Can't figure out how to strip "http" from #[message.payload.Url] (since the HTTP Endpoint adds http to the url I'm passing in.
2) Can't figure out how to retrieve the file. I don't even know if HTTP Endpoint is the right option. HTTP? File?
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:https="http://www.mulesoft.org/schema/mule/https" 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" version="CE-3.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.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 ">
<flow name="BingFlow1" doc:name="BingFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
<https:outbound-endpoint exchange-pattern="request-response" host="api.datamarket.azure.com" port="443" path="Data.ashx/Bing/Search/v1/Web?Query=%27contract%20california%27&WebFileType=%27PDF%27&$top=50&$format=Json" user="********" password="*****" doc:name="Bing"/>
<json:json-to-object-transformer returnClass="java.util.Map" doc:name="JSON to Object"/>
<expression-transformer expression="#[message.payload.d.results]" doc:name="Expression"/>
<collection-splitter doc:name="Collection Splitter"/>
<http:outbound-endpoint exchange-pattern="request-response" host="#[message.payload.Url]" port="80" method="GET" doc:name="HTTP"/>
<file:outbound-endpoint path="/home/user/Documents/output" outputPattern="#[message.payload.ID].pdf" responseTimeout="10000" doc:name="File"/>
<echo-component doc:name="Echo"/>
</flow>
</mule>
I couldn't test the flow because some credentials are needed but the following should help you:
Use an expression-transformer to strip the HTTP out,
Your approach with an http:outbound-endpoint followed by a file:outbound-endpoint will work fine,
Change the http:inbound-endpoint to one-way: there is no way to return anything sensible since the execution flow gets split.
For example, assuming message.payload.Url resolves to a java.lang.String, you can use:
<expression-transformer expression="#[org.mule.util.StringUtils.substringAfter(message.payload.Url, 'http://')]" doc:name="Expression"/>