I'm trying to call a web service via SOAP/JAX-WS using a Camel route, and keep getting the error: CaughtExceptionMessage:HTTP operation failed invoking http://xyz.com/Service with statusCode: 404.
Calling the same service using Soap UI works file, so my guess is that the request is not getting marshaled the same, and the service is unable to find which method is being called, causing the 404. Soap UI gives the following request XML:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bfg="http://xyz.com/Service">
<soapenv:Header/>
<soapenv:Body>
<bfg:login>
<bfg:request>
<ipAddress>1.2.3.4</ipAddress>
<locationId>0</locationId>
<password>Foo</password>
<productId>1</productId>
<username>Bar</username>
<vendorSoftwareId>0</vendorSoftwareId>
</bfg:request>
</bfg:login>
</soapenv:Body>
</soapenv:Envelope>
Camel spits out the following XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:Envelope xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns3="http://xyz.com/Service"
xmlns:ns4="http://xyz.com/Other">
<ns2:Body>
<ns3:login>
<ns3:request>
<ipAddress>1.2.3.4</ipAddress>
<locationId>0</locationId>
<password>Foo</password>
<productId>0</productId>
<username>Bar</username>
<vendorSoftwareId>0</vendorSoftwareId>
</ns3:request>
</ns3:login>
</ns2:Body>
</ns2:Envelope>
The differences are pretty small, really just the namespaces. Copying and pasting the XML into SoapUI and then using it will produce a valid request/response.
The Camel route and config is as follows:
private final SoapJaxbDataFormat globalServiceSoap =
new SoapJaxbDataFormat(Service.class.getPackage().getName(),
new ServiceInterfaceStrategy(Service.class, true));
from(RouteConstants.LOGIN_SERVICE_END_POINT_URI)
.routeId("internal::loginGlobalService").marshal(globalServiceSoap)
.to(endpointUri).unmarshal(globalServiceSoap).process(postLoginProcessor);
Where the request object to be marshaled is the body of the message heading into that Camel route. What is Camel doing on the request to cause it to fail with a 404?
ANY help or ideas would be greatly appreciated.