System.out.println(hdr);
System.out.println(bod);
[SOAP-ENV:Header: null]
[SOAP-ENV:Body: null]
<security-role-mapping>
<role-name>user</role-name>
<principal-name>CN=RajeshT, OU=CRIS, O=IR, L=DLI,ST=DLI, C=IN</principal-name>
</security-role-mapping>
%%%%%%%%%%Creating a soap message from an external file%%%%%%%%
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body><ns:multiply xmlns:ns="http://saaj.com/"><arg0>80</arg0><arg1>10<
/arg1></ns:multiply></SOAP-ENV:Body></SOAP-ENV:Envelope>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Lets say you want to write a web service testing program, like soapUI. Then you cannot use the proxy mechanism because you do not know which web services you will need to send requests to, at the time of writing your program.
private Dispatch<Object> prepareCalculatorDispatch()
throws MalformedURLException, JAXBException
{
QName theName =new QName(SERVICE_NAMESPACE, SERVICE_PORT_NAME);
URL theWsdlUrl = new URL(WSDL_LOCATION);
QName theServiceName = new QName(SERVICE_NAMESPACE, SERVICE_NAME);
Service theService = Service.create(theWsdlUrl, theServiceName);
JAXBContext theJaxbContext =JAXBContext.newInstance("com.ivan.calculator");
Dispatch<Object> theDispatch =theService.createDispatch(theName, theJaxbContext,Service.Mode.PAYLOAD);
return theDispatch;
}
JAXBContext theJaxbContext =JAXBContext.newInstance("com.ivan.calculator");
Dispatch<Object> theDispatch =theService.createDispatch(theName, theJaxbContext,Service.Mode.PAYLOAD);
public ReverseStringResponse reverseString(
@WebParam(name = "reverseStringReq", targetNamespace = "http://www.instinct.com/stringprocessor", partName = "parameters")
ReverseStringRequest parameters);
StringProcessorService srvc=new StringProcessorService();
StringProcessorPort port=srvc.getStringProcessorPort();
String res=port.reverseString("Hello");
Note that what appears in the build/classes directory are the compiled class-files of the generated classes.