-2

I am stuck with Apache Camel. I need to expose an web service through JBOSS FUSE, but the payload that I must return depends on call to two external web services.

So, the first external web service has this URL:

http://someip/externalWSOne

This receive one param named A, and return three values X, Y and Z.

The second one, receive three params named B, X and Y. Notice that X and Y are the returned values from first external web service.

http://someip/externalWSTwo

This second external web service return N1...Nn values that are the final payload

The final user consume only one web service, that is the internal we service that I will expose through JBOSS FUSE. For this reason I need to expose a web service that receive two params

What is the correct way to model this flow in Apache camel? I write the following configuration but the final payload are empty:

<cxf:cxfEndpoint id="epInterno" address="/ep-interno/" serviceClass="somePackage.MyWebServiceInterface">
<cxf:cxfEndpoint id="epExterno1" address="http://someip/externalWSOne" serviceClass="somePackage.ExternalWSOneServiceInterface">
<cxf:cxfEndpoint id="epExterno2" address="http://someip/externalWSTwo" serviceClass="somePackage.ExternalWSTwoServiceInterface">

<camelContext id="blueprintContext" trace="false" xmlns="http://camel.apache.org/schema/blueprint">
    <route id="ruta1">
      <from uri="cxf:bean:epInterno"/>
      <process ref="proccesorOne" />
      <to uri="cxf:bean:epExterno1" />
      <process ref="processorTwo" />
      <to uri="cxf:bean:epExterno2" />
    </route>
</camelContext>

All artifacts for external web services are generate with Maven plugin.

halfer
  • 19,824
  • 17
  • 99
  • 186
pazfernando
  • 577
  • 6
  • 15
  • The last piece of XML is invalid, as you have < /camel:from > – Claus Ibsen Aug 29 '14 at 06:23
  • Did you try to debug the route such as logging the body content at each step? – Peter Keller Aug 30 '14 at 14:48
  • Yes I did that using interceptors in cxf entrypoint, and I see the SOAP message returned by epExterno2 according with this example, but for any reason this can't be pulled out as a final SOAP message by camel. I see an error related with "unexpected element". So far this, I post this question with aim to understand that the correct way for orchestrate more than one web service is the solution proposed above. – pazfernando Sep 03 '14 at 23:40

1 Answers1

0

Ok, I tried probe my solution so I decided to write the three projects mentioned above.

THE RESULT: YES this is the correct way *

Seems that for my case, when I use the real WS, I have problems not strict related with apache camel flow, instead of this are related with the implementation of this external WS

So, if I somebody need to test by self, can try it analyzing the following code for projects in github.

Thanks

pazfernando
  • 577
  • 6
  • 15