File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Does WSAD 5.1.0 support SOAP 1.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Does WSAD 5.1.0 support SOAP 1.2" Watch "Does WSAD 5.1.0 support SOAP 1.2" New topic
Author

Does WSAD 5.1.0 support SOAP 1.2

Anup Bansal
Ranch Hand

Joined: Sep 12, 2006
Posts: 69
I am developing a WebService Client .The webservice we are accessing requires that we use SOAP 1.2 for all communications.

Environment:
------------
WSAD version: 5.1.0
Local Server: Integration Test Environment 5.1
Comiler version = 1.4

For the purpose to satisfy the requirements, I am using the SAAJ 1.3 APIs. I have imported saaj-api.jar and saaj-impl.jar. I am using WSAD 5.1.0 as the IDE.

I am unable to create a SOAP message. The same works when I use the default SAAJ APIs available with WSAD.

//Create Message
MessageFactory requestMessageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
SOAPMessage requestMessage = requestMessageFactory.createMessage();

//Get the SOAPBody
SOAPEnvelope requestEnvelope = requestMessage.getSOAPPart().getEnvelope();
requestBody = requestEnvelope.getBody().addBodyElement(requestEnvelope.createName("Request");

//Add Body element to SOAP Body
SOAPElement hdrTag = requestBody.addChildElement(requestEnvelope.createName("Hdr"));
SOAPElement reqBdyTag = requestBody.addChildElement(requestEnvelope.createName("ReqBdy"));

System.out.println(requestBody.toString());

The above line returns the value as [Request: null]

The same code when run using the default jars present in WSAD webservices.jar (conforming to SOAP 1.1), the following is returned:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><Request xmlns=""> <Hdr xmlns=""> hdr</Hdr><ReqBdy xmlns="">reqbdy</ReqBdy></soapenv:Body></soapenv:Envelope>

In the debug mode, when i check the value of the variable requestBody it shows all the fields properly populated.


1. Can you please let me know where I may be going wrong?
2. Is this a problem due to compatibility issue?
3. Is this a problem with the implementation jar of SAAJ 1.3?
3. Have I forgotten to include some importatn jars?
4. If SAAJ 1.3 is not preferable for implementation of SOAP 1.2 in WSAD, what other ways I can generate/handle SOAP request/response?
 
 
subject: Does WSAD 5.1.0 support SOAP 1.2