| == CXF WebService Proxy example |
| |
| === Introduction |
| |
| An example which proxies a real web service by a Camel application using |
| the camel-cxf component |
| |
| === Build |
| |
| You will need to compile this example first: |
| |
| [source,sh] |
| ---- |
| $ mvn compile |
| ---- |
| |
| === Run |
| |
| To run the example type: |
| |
| [source,sh] |
| ---- |
| $ mvn camel:run -Dmaven.test.skip=true |
| ---- |
| |
| The proxied webservice is located at |
| |
| .... |
| http://localhost:${proxy.port}/camel-example-cxf-proxy/webservices/incident |
| .... |
| |
| http://localhost:9080/camel-example-cxf-proxy/webservices/incident |
| |
| The real webservice is located at |
| |
| .... |
| http://localhost:${real.port}/real-webservice |
| .... |
| |
| http://localhost:9081/real-webservice |
| |
| The webservice WSDL is exposed at: |
| |
| .... |
| http://localhost:${proxy.port}/camel-example-cxf-proxy/webservices/incident?wsdl |
| .... |
| |
| http://localhost:9080/camel-example-cxf-proxy/webservices/incident?wsdl |
| |
| Because we use dynamic port numbers, you have to check the console to |
| get the used one. To stop the example hit ctrl+c |
| |
| To make a SOAP call open soapUI or another SOAP query tool and create a |
| new project w/WSDL of |
| http://localhost:$%7Bproxy.port%7D/camel-example-cxf-proxy/webservices/incident?wsdl. |
| Then make SOAP requests of this format: |
| |
| [source,xml] |
| ---- |
| <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" |
| xmlns:rep="http://reportincident.example.camel.apache.org"> |
| <soapenv:Header/> |
| <soapenv:Body> |
| <rep:inputReportIncident> |
| <incidentId></incidentId> |
| <incidentDate>2011-11-18</incidentDate> |
| <givenName>Bob</givenName> |
| <familyName>Smith</familyName> |
| <summary>Bla bla</summary> |
| <details>More bla</details> |
| <email>your@email.org</email> |
| <phone>12345678</phone> |
| </rep:inputReportIncident> |
| </soapenv:Body> |
| </soapenv:Envelope> |
| ---- |
| |
| === Configuration |
| |
| You can change `+${proxy.port}+` and `+${real.port}+` via configuration |
| file `+src/main/resources/incident.properties+` |
| |
| === Help and contributions |
| |
| If you hit any problem using Camel or have some feedback, then please |
| https://camel.apache.org/community/support/[let us know]. |
| |
| We also love contributors, so |
| https://camel.apache.org/community/contributing/[get involved] :-) |
| |
| The Camel riders! |