Hi,
I'm trying to use the dispatch API and while I can make the service call ok,
the ws-address "action" header is wrong. Here's my code:
URL wsdlURL = new
URL("file:/home/jpangburn/Desktop/IHE/XDSb.Support.Materials.v9/wsdl/XDS.b_DocumentRegistry.wsdl");
Service service = Service.create(wsdlURL, new
QName("urn:ihe:iti:xds-b:2007", "DocumentRegistry_Service"));
Dispatch<StreamSource> disp = service.createDispatch(new
QName("urn:ihe:iti:xds-b:2007", "DocumentRegistry_Port_Soap12"),
StreamSource.class, Service.Mode.PAYLOAD, new AddressingFeature());
InputStream is =
IBServer.class.getResourceAsStream("RegistryQuery.xml");
StreamSource request = new StreamSource(is);
StreamSource response = disp.invoke(request);
Basically, I try to create a service from a WSDL with the service QName, then
create a Dispatch from the port's QName while passing "new AddressingFeature()"
to turn on WS-Addressing. The action header comes out like this:
<Action
xmlns="http://www.w3.org/2005/08/addressing">http://cxf.apache.org/jaxws/dispatch/DocumentRegistry_PortType/InvokeRequest</Action>
This is wrong because the SOAP12 binding's operation has the following:
<soap12:operation soapAction="urn:ihe:iti:2007:RegistryStoredQuery"/>
So the header should be:
<Action
xmlns="http://www.w3.org/2005/08/addressing">urn:ihe:iti:2007:RegistryStoredQuery</Action>
All I can guess is that the Dispatch API doesn't know which operation I'm
calling so it makes up this generic action header for the port instead of
looking at the message I'm sending, determining the operation called, and
grabbing the correct soap action to use in the action header. Am I doing
something wrong or is this a limitation in the Dispatch API's support for
WS-Addressing?
Thanks,
Jesse