Advertisement
Guest User

Untitled

a guest
Dec 13th, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.08 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <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
  3. http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
  4. http://www.mulesoft.org/schema/mule/apikit http://www.mulesoft.org/schema/mule/apikit/current/mule-apikit.xsd
  5. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
  6. http://www.mulesoft.org/schema/mule/sfdc http://www.mulesoft.org/schema/mule/sfdc/current/mule-sfdc.xsd
  7. http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd">
  8. <http:listener-config name="test-order-system-httpListenerConfig" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
  9. <apikit:config name="test-order-system-config" raml="test-order-system.raml" consoleEnabled="true" consolePath="console" doc:name="Router"/>
  10. <sfdc:config name="Salesforce" username="${sf.username}" password="${sf.password}" securityToken="${sf.token}" doc:name="Salesforce">
  11. <sfdc:connection-pooling-profile initialisationPolicy="INITIALISE_ONE" exhaustedAction="WHEN_EXHAUSTED_GROW"/>
  12. </sfdc:config>
  13. <data-mapper:config name="Map_To_JSON" transformationGraphPath="map_to_json.grf" doc:name="Map_To_JSON"/>
  14.  
  15. <flow name="test-order-system-main">
  16. <http:listener config-ref="test-order-system-httpListenerConfig" path="/api/*" doc:name="HTTP"/>
  17. <apikit:router config-ref="test-order-system-config" doc:name="APIkit Router"/>
  18. <exception-strategy ref="test-order-system-apiKitGlobalExceptionMapping" doc:name="Reference Exception Strategy"/>
  19. </flow>
  20. <flow name="delete:/orders/order:test-order-system-config">
  21. <set-payload value="{&#xA; "createOrderRequest": {&#xA; "success": true&#xA; }&#xA;}" doc:name="Set Payload"/>
  22. </flow>
  23. <flow name="get:/orders:test-order-system-config">
  24. <sfdc:query config-ref="Salesforce" query="SELECT EffectiveDate,Id,TotalAmount FROM Order" doc:name="Salesforce"/>
  25. <logger message="#[org.apache.commons.collections.IteratorUtils.toList(payload)]" level="INFO" doc:name="Logger"/>
  26. <data-mapper:transform config-ref="Map_To_JSON" doc:name="Map To JSON"/>
  27. <byte-array-to-string-transformer mimeType="application/json" doc:name="Byte Array to String"/>
  28.  
  29. </flow>
  30. <flow name="post:/orders/order:test-order-system-config">
  31. <set-payload value="{&#xA; "createOrderResponse": {&#xA; "orderId": "8a493ecd-e842-4ca2-b33b-a03aa9136673",&#xA; "success": true&#xA; }&#xA;}" doc:name="Set Payload"/>
  32. </flow>
  33. <apikit:mapping-exception-strategy name="test-order-system-apiKitGlobalExceptionMapping">
  34. <apikit:mapping statusCode="404">
  35. <apikit:exception value="org.mule.module.apikit.exception.NotFoundException" />
  36. <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
  37. <set-payload value="{ "message": "Resource not found" }" doc:name="Set Payload"/>
  38. </apikit:mapping>
  39. <apikit:mapping statusCode="405">
  40. <apikit:exception value="org.mule.module.apikit.exception.MethodNotAllowedException" />
  41. <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
  42. <set-payload value="{ "message": "Method not allowed" }" doc:name="Set Payload"/>
  43. </apikit:mapping>
  44. <apikit:mapping statusCode="415">
  45. <apikit:exception value="org.mule.module.apikit.exception.UnsupportedMediaTypeException" />
  46. <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
  47. <set-payload value="{ "message": "Unsupported media type" }" doc:name="Set Payload"/>
  48. </apikit:mapping>
  49. <apikit:mapping statusCode="406">
  50. <apikit:exception value="org.mule.module.apikit.exception.NotAcceptableException" />
  51. <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
  52. <set-payload value="{ "message": "Not acceptable" }" doc:name="Set Payload"/>
  53. </apikit:mapping>
  54. <apikit:mapping statusCode="400">
  55. <apikit:exception value="org.mule.module.apikit.exception.BadRequestException" />
  56. <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
  57. <set-payload value="{ "message": "Bad request" }" doc:name="Set Payload"/>
  58. </apikit:mapping>
  59. </apikit:mapping-exception-strategy>
  60. </mule>
  61.  
  62. *******************************************************************************************************
  63. * - - + APPLICATION + - - * - - + DOMAIN + - - * - - + STATUS + - - *
  64. *******************************************************************************************************
  65. * test * default * DEPLOYED *
  66. *******************************************************************************************************
  67.  
  68. 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
  69. 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}]
  70.  
  71. {
  72. "getOrdersResponse": []
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement