Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <mule xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:sfdc="http://www.mulesoft.org/schema/mule/sfdc" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:apikit="http://www.mulesoft.org/schema/mule/apikit" xmlns:http="http://www.mulesoft.org/schema/mule/http" 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/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/apikit http://www.mulesoft.org/schema/mule/apikit/current/mule-apikit.xsd
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.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/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd">
- <http:listener-config name="test-order-system-httpListenerConfig" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
- <apikit:config name="test-order-system-config" raml="test-order-system.raml" consoleEnabled="true" consolePath="console" doc:name="Router"/>
- <sfdc:config name="Salesforce" username="${sf.username}" password="${sf.password}" securityToken="${sf.token}" doc:name="Salesforce">
- <sfdc:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/>
- </sfdc:config>
- <data-mapper:config name="Map_To_JSON" transformationGraphPath="map_to_json.grf" doc:name="Map_To_JSON"/>
- <flow name="test-order-system-main">
- <http:listener config-ref="test-order-system-httpListenerConfig" path="/api/*" doc:name="HTTP"/>
- <apikit:router config-ref="test-order-system-config" doc:name="APIkit Router"/>
- <exception-strategy ref="test-order-system-apiKitGlobalExceptionMapping" doc:name="Reference Exception Strategy"/>
- </flow>
- <flow name="delete:/orders/order:test-order-system-config">
- <set-payload value="{
 "createOrderRequest": {
 "success": true
 }
}" doc:name="Set Payload"/>
- </flow>
- <flow name="get:/orders:test-order-system-config">
- <sfdc:query config-ref="Salesforce" query="SELECT EffectiveDate,Id,TotalAmount FROM Order" doc:name="Salesforce"/>
- <logger message="#[org.apache.commons.collections.IteratorUtils.toList(payload)]" level="INFO" doc:name="Logger"/>
- <data-mapper:transform config-ref="Map_To_JSON" doc:name="Map To JSON"/>
- <byte-array-to-string-transformer mimeType="application/json" doc:name="Byte Array to String"/>
- </flow>
- <flow name="post:/orders/order:test-order-system-config">
- <set-payload value="{
 "createOrderResponse": {
 "orderId": "8a493ecd-e842-4ca2-b33b-a03aa9136673",
 "success": true
 }
}" doc:name="Set Payload"/>
- </flow>
- <apikit:mapping-exception-strategy name="test-order-system-apiKitGlobalExceptionMapping">
- <apikit:mapping statusCode="404">
- <apikit:exception value="org.mule.module.apikit.exception.NotFoundException" />
- <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
- <set-payload value="{ "message": "Resource not found" }" doc:name="Set Payload"/>
- </apikit:mapping>
- <apikit:mapping statusCode="405">
- <apikit:exception value="org.mule.module.apikit.exception.MethodNotAllowedException" />
- <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
- <set-payload value="{ "message": "Method not allowed" }" doc:name="Set Payload"/>
- </apikit:mapping>
- <apikit:mapping statusCode="415">
- <apikit:exception value="org.mule.module.apikit.exception.UnsupportedMediaTypeException" />
- <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
- <set-payload value="{ "message": "Unsupported media type" }" doc:name="Set Payload"/>
- </apikit:mapping>
- <apikit:mapping statusCode="406">
- <apikit:exception value="org.mule.module.apikit.exception.NotAcceptableException" />
- <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
- <set-payload value="{ "message": "Not acceptable" }" doc:name="Set Payload"/>
- </apikit:mapping>
- <apikit:mapping statusCode="400">
- <apikit:exception value="org.mule.module.apikit.exception.BadRequestException" />
- <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
- <set-payload value="{ "message": "Bad request" }" doc:name="Set Payload"/>
- </apikit:mapping>
- </apikit:mapping-exception-strategy>
- </mule>
- *******************************************************************************************************
- * - - + APPLICATION + - - * - - + DOMAIN + - - * - - + STATUS + - - *
- *******************************************************************************************************
- * test * default * DEPLOYED *
- *******************************************************************************************************
- WARN 2016-12-13 12:16:55,221 [[test].test-order-system-httpListenerConfig.worker.01] org.mule.modules.salesforce.config.AbstractConfig: API version 37.0 is lower than the recommended 38.0 version
- INFO 2016-12-13 12:16:59,946 [[test].test-order-system-httpListenerConfig.worker.01] org.mule.api.processor.LoggerMessageProcessor: [{Id=80124000006A6duAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6rUAAS, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A7O7AAK, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A647AAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5rcAAC, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5xqAAC, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6zpAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6zuAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A7NKAA0, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6tuAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6wMAAS, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5uqAAC, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5xLAAS, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5wcAAC, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5xuAAC, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6dLAAS, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6cWAAS, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6UYAA0, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6dzAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6biAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A5rmAAC, TotalAmount=74.99, type=Order, EffectiveDate=2016-12-12}, {Id=80124000006A6TFAA0, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A65AAAS, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6TyAAK, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6dVAAS, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A4OMAA0, TotalAmount=0.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6SlAAK, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}, {Id=80124000006A6zzAAC, TotalAmount=15.0, type=Order, EffectiveDate=2016-10-18}]
- {
- "getOrdersResponse": []
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement