How to Stop a Mulesoft flow using a connector in Anypoint Studio - json

Is there a connector to stop the Mulesoft flow after a certain point? Let's say I have a request connector in the flow and I want to stop the flow soon after that connector is executed

If its with regards Mule4,
-- https://help.mulesoft.com/s/article/How-To-Stop-Or-Start-Flows-In-Mule-4-x-Programmatically
If its with regards Mule3,
-- https://help.mulesoft.com/s/article/How-to-start-stop-a-flow-programmatically

Alternatively you can try, wherever you want to stop your flow, give a "Raise Error" connector and give the Type as "ANY" and in the error handling section give an empty "on-error-continue" scope and in the on error continue properties uncheck "Log Exception" so that it doesn't log the error we raised.
Please find the below code:
<?xml version="1.0" encoding="UTF-8"?>
<mule 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:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="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_config" doc:name="HTTP Listener config" doc:id="d2c12e71-9f33-44f5-8515-616b1733d52a" >
<http:listener-connection host="0.0.0.0" port="8081" />
</http:listener-config>
<flow name="stop-flow-wsFlow" doc:id="c668e851-46ec-459d-9252-109ec488c47e" >
<http:listener doc:name="Listener" doc:id="e8e5a81d-97f7-4cda-8984-483ead08d376" config-ref="HTTP_Listener_config" path="/stopflow"/>
<logger level="INFO" doc:name="Logger1" doc:id="b1e57888-acf6-41bb-af46-abc54acb8c5b" message='#["Logger1"]'/>
<logger level="INFO" doc:name="Logger2" doc:id="02ba5ce3-69eb-4a8e-ae7a-063cd372ffa9" message='#["Logger2"]'/>
<raise-error doc:name="Raise error" doc:id="872e5b03-64d4-499f-a77c-b69d12bfaf0c" type="ANY"/>
<logger level="INFO" doc:name="Logger3" doc:id="b54480ea-b89b-4b66-b2bd-152617860c4f" message='#["Logger3"]'/>
<set-payload value='#["Hello World"]' doc:name="Set Payload" doc:id="04738f06-77d0-4953-a976-c14589718692" />
<error-handler>
<on-error-continue enableNotifications="true" logException="false" doc:name="On Error Continue" doc:id="87ac9f65-3456-4c00-b76c-c461acf0628c" />
</error-handler>
</flow>
</mule>
Output would be:

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

insert into database with anypoint studio

I would like to save the flow coming from this json file: https://gist.githubusercontent.com/Rajeun/3dbbe8ca240d479dbabe/raw/aba5d0ec9345b886426ab767376b7c9cb60c251f/person.json in a database using anypoint studio.
For this i'm using a http connector where i mentioned the link of the json file. and then i used a json-to-object transformer and a database connector.
In my db i have a table with id, token, tel "int" and email is a varchar
-(I tested the connection and its working well).
when i run my code:
ERROR 2015-03-20 13:14:05,522 [main] org.mule.module.launcher.application.DefaultMuleApplication: null
java.lang.NullPointerException
at org.mule.module.db.internal.config.domain.query.QueryTemplateBeanDefinitionParser.parseParameterizedQuery(QueryTemplateBeanDefinitionParser.java:136) ~[mule-module-db-3.6.1.jar:3.6.1]
at org.mule.module.db.internal.config.domain.query.QueryTemplateBeanDefinitionParser.doParse(QueryTemplateBeanDefinitionParser.java:62) ~[mule-module-db-3.6.1.jar:3.6.1]
at org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser.parseInternal(AbstractMuleBeanDefinitionParser.java:295) ~[mule-module-spring-config-3.6.1.jar:3.6.1]
at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59) ~[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73) ~[spring-beans-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate.parseCustomElement(MuleHierarchicalBeanDefinitionParserDelegate.java:98) ~[mule-module-spring-config-3.6.1.jar:3.6.1]
at org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate.parseCustomElement(MuleHierarchicalBeanDefinitionParserDelegate.java:140) ~[mule-module-spring-config-3.6.1.jar:3.6.1]
******************************************************************************
Config:
<mule xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:json="http://www.mulesoft.org/schema/mule/json" 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" version="EE-3.6.1"
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/http http://www.mulesoft.org/schema/mule/http/current/mule-http.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/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="www.gist.githubusercontent.com" port="80" doc:name="HTTP Listener Configuration"/>
<db:mysql-config name="MySQL_Configuration" host="localhost" port="3306" user="root" database="mulesoft" doc:name="MySQL Configuration"/>
<db:template-query name="Template_Query" doc:name="Template Query">
<db:parameterized-query/>
</db:template-query>
<flow name="testFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="Rajeun/3dbbe8ca240d479dbabe/raw/aba5d0ec9345b886426ab767376b7c9cb60c251f/person.json" doc:name="HTTP"/>
<json:json-to-object-transformer returnClass="myclass" doc:name="JSON to Object"/>
<response>
<logger message="c bon" level="INFO" doc:name="Logger"/>
</response>
<response>
<db:insert config-ref="MySQL_Configuration" doc:name="Database">
<db:parameterized-query><![CDATA[INSERT INTO push(id, token, tel, email) VALUES (2,2,3,#[payload['userImage']])]]></db:parameterized-query>
</db:insert>
</response>
</flow>
</mule>
Remove the empty template query:
<db:template-query name="Template_Query" doc:name="Template Query">
<db:parameterized-query />
</db:template-query>
Also, does 'myclass' exist? if not try just using a map:
<json:json-to-object-transformer returnClass="java.util.HashMap" doc:name="JSON to Object"/>
Also It looks like you want to retrieve that JSON file from the specified URL. For that you want the http:request not http:listener. http:listener is used as a message source waiting for requests to your app.
You should use the http:request to request the file and trigger it using a polling message source:
<http:request-config name="HTTP_Request_Configuration" host="www.gist.githubusercontent.com" port="80" doc:name="HTTP Request Configuration"/>
<flow name="testFlow">
<poll>
<http:request config-ref="HTTP_Request_Configuration" path="Rajeun/3dbbe8ca240d479dbabe/raw/aba5d0ec9345b886426ab767376b7c9cb60c251f/person.json" method="GET" doc:name="HTTP"/>
</poll>
</flow>
See: http://www.mulesoft.org/documentation/display/current/HTTP+Request+Connector
And: http://www.mulesoft.org/documentation/display/current/Poll+Reference

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"/>

Mule ESB : Cannot copy message with a stream payload

I have a Mule Application where I send a Request to Multiple WebServices and aggregate the List of responses i get , the idea is to get the first response of the List by returning it from the CustomJavaClass where the list is handled :
return responses.get(0);
I am able to reach the WSDL if I try to reach it over a Browser , the returned WSDL looks like its supposed to look . But i I try to send a message via SoapUi i get the following exception :
Exception stack is:
1. Cannot copy message with a stream payload. Payload type is "org.apache.commons.httpclient.ContentLengthInputStream". Message payload is of type: ContentLengthInputStream (org.mule.api.MessagingException)
org.mule.routing.outbound.AbstractSequenceRouter:73 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.api.MessagingException: Cannot copy message with a stream payload. Payload type is "org.apache.commons.httpclient.ContentLengthInputStream". Message payload is of type: ContentLengthInputStream
at org.mule.routing.outbound.AbstractSequenceRouter.route(AbstractSequenceRouter.java:73)
at org.mule.routing.outbound.AbstractOutboundRouter$1.doInTransaction(AbstractOutboundRouter.java:102)
at org.mule.routing.outbound.AbstractOutboundRouter$1.doInTransaction(AbstractOutboundRouter.java:99)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
SOAPUi Exception :
Failed to route event via endpoint: org.mule.api.processor.MessageProcessors$LifecyleAwareMessageProcessorWrapper#ceb6dd. Message payload is of type: ContentLengthInputStream
my current configurations :
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:tcp="http://www.mulesoft.org/schema/mule/tcp" xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.2.1" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
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/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/tcp http://www.mulesoft.org/schema/mule/tcp/current/mule-tcp.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd ">
<flow name="flows1Flow1" doc:name="flows1Flow1">
<http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:4433/miniwebservice" encoding="UTF-8" mimeType="text/xml" doc:name="HTTP"/>
<logger level="INFO" category="ddo" doc:name="Logger"/>
<all doc:name="All">
<processor-chain>
<message-properties-transformer encoding="UTF-8" mimeType="text/xml" doc:name="Message Properties">
<add-message-property key="http.method" value="#[header:INBOUND:http.method]"/>
</message-properties-transformer>
<http:outbound-endpoint exchange-pattern="request-response" address="http://localhost:4435/miniwebservice#[header:INBOUND:http.request]" encoding="UTF-8" mimeType="text/xml" doc:name="HTTP"/>
<mulexml:xslt-transformer mimeType="text/xml" maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="C:\Users\kiesa\Desktop\XSLReplace.xsl" doc:name="XSLT"/>
</processor-chain>
<processor-chain>
<message-properties-transformer encoding="UTF-8" mimeType="text/xml" doc:name="Message Properties">
<add-message-property key="http.method" value="#[header:INBOUND:http.method]"/>
</message-properties-transformer>
<http:outbound-endpoint exchange-pattern="request-response" address="http://localhost:4434/miniwebservice#[header:INBOUND:http.request]" encoding="UTF-8" mimeType="text/xml" doc:name="HTTP"/>
<mulexml:xslt-transformer mimeType="text/xml" maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="C:\Users\kiesa\Desktop\XSLReplace2.xsl" doc:name="XSLT"/>
</processor-chain>
</all>
<mulexml:xml-to-object-transformer doc:name="XML to Object"/>
<component class="CustomJavaClass" doc:name="Java"/>
<byte-array-to-string-transformer ignoreBadInput="true" encoding="UTF-8" mimeType="text/xml" doc:name="Byte Array to String"/>
</flow>
</mule>
Getting the WSDL works because the GET request carries no payload. But when you try to invoke a SOAP method, the POST payload is an InputStream, which of course can't be dispatched several times.
Thus: serialize the HTTP input stream with a:
<object-to-byte-array-transformer />
right after the http:inbound-endpoint.