I am forced to use jax-rpc, generating code with WSDL2LJAVA.
The calling code is like so:
InformationPort_ServiceLocator loc = new InformationPort_ServiceLocator();
InformationInterface port = loc.getInformationPort();
return port.addressVerification(new AddressVerificationRequest(new AddressVerificationInformation(null, number, subDescription, street, streetType, null, suburb, null, null, null, null, null)));
The question is, when I go to call the web service, how do I load the Header as above? I can certainly construct the XML from SOAPElements, but I've no idea how to generate the data required to be embedded in them.
Joined: Dec 14, 2010
From your sample soap message, it looks like your service expects x509 security. In case you are using J2ee based client (client implementation in WAR or EAR file) this security could be configure using deployment descriptor. It requires a number of settings to be done in deployment descriptor along with the certificate.
I do not remember the detailed steps but the point I am making here is, you do not make that kind of soap message using SOAPElement or so. Direct yourself to find the right configurations to be done for the same.
Best of luck!
Joined: Mar 22, 2005
If it was hand-crafted XML you're sending, or if you were using SAAJ, then you could use the WSS4J directly (although I wouldn't recommend it), but I don't think that's an option with JAX-RPC.
Check the documentation of whichever SOAP stack you're using for how it integrates with WS-Security; all the major ones do.