Hi,
I'm experimenting using camel to call a soap service but failing to
find the magic combination of steps to get the soap action header set.
The current approach I'm taking is to do something like the following:
public void configure() {
SoapJaxbDataFormat soapDF =
new SoapJaxbDataFormat(MyJaxBRequest.class.getPackage().getName());
from("direct:callSoap")
.beanRef("myJaxBRequestBuilder")
.setHeader("SOAPAction", simple("\"http://schemas.example.com""))
.marshal(soapDF)
.to("stream:out");
}
Where myJaxBRequestBuilder is a bean that has a trivial signature:
public class MyJaxBRequestBuilder {
public MyJaxBRequest newRequest() {
MyJaxBRequest req = new MyJaxBRequest();
// hard code various request params for now...
return req;
}
}
This generates a soap request of the form:
<ns2:Envelope xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/">
<ns2:Body>
...
</ns2:Body>
</ns2:Envelope>
But there are no headers set...
Is what I'm trying to do supported? Am I missing some configuration in
the routerbuilder?
Many thanks for any help.
Regards,
/Dave