Skip to content

Instantly share code, notes, and snippets.

@ddossot
Created July 25, 2012 19:41
Show Gist options
  • Save ddossot/3178138 to your computer and use it in GitHub Desktop.
Save ddossot/3178138 to your computer and use it in GitHub Desktop.
FedACH CXF operation introduction proxy
<flow name="enrichingProxyService">
<http:inbound-endpoint
address="http://localhost:8080/fed-ach"
exchange-pattern="request-response">
<cxf:proxy-service
wsdlLocation="classpath:FedACH-Extended.wsdl"
namespace="http://www.webservicex.net/"
service="FedACH"
payload="body" />
</http:inbound-endpoint>
<choice>
<when
expression="message.inboundProperties.SOAPAction == '&quot;http://www.webservicex.net/getACHByClientId&quot;'">
<mulexml:xml-to-dom-transformer />
<set-property propertyName="clientId"
value="#[xpath('//webx:ClientId').text]" />
<enricher source="#[payload.zipCode]"
target="#[flowVars['zipCode']]">
<vm:outbound-endpoint path="client-lookup" exchange-pattern="request-response" />
</enricher>
<expression-component><![CDATA[
argumentNode = xpath('//webx:ClientId');
namespace = argumentNode.qName.namespace;
argumentNode.qName = new org.dom4j.QName('ZipCode', namespace);
argumentNode.text = zipCode;
methodNode = argumentNode.parent;
methodNode.qName = new org.dom4j.QName('getACHByZipCode', namespace);
payload = methodNode.document;
]]>
</expression-component>
<set-property propertyName="SOAPAction"
value="&quot;http://www.webservicex.net/getACHByZipCode&quot;" />
</when>
<otherwise>
<copy-properties propertyName="SOAPAction" />
</otherwise>
</choice>
<http:outbound-endpoint
address="http://www.webservicex.net/FedACH.asmx"
exchange-pattern="request-response">
<cxf:proxy-client payload="body" />
</http:outbound-endpoint>
</flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment