This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
In my requirement I have to generate SOAP message from a java class.
The sending portion will be handled by a framework [ our firm has a framework built over JMS], so I just need to create a message only.
You can use SAAJ to create and populate SOAP messages. To make life a little easier, you can use JAXB to marshal and unmarshal the contents of the SOAP body, if you want to. Both these APIs are part of the JRE 6.
The following code shows how to create SOAP messages using SAAJ:
Joined: Jun 08, 2006
Thanks for the code Ivan..
Unfortunately have a 1.5 limitation..
Trying your code now.
Please suggest on additional jars needed if using 1.5
in java5, you could add two more jar files: saaj.jar, saaj-api.jar. Then use the code like below:
DocumentBuilder oBuilder = oDocFactory.newDocumentBuilder();
Document oDoc = oBuilder.parse(new File("xxx"));