aspose file tools*
The moose likes Web Services and the fly likes How to create a SOAP request Message from a sample XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to create a SOAP request Message from a sample XML " Watch "How to create a SOAP request Message from a sample XML " New topic
Author

How to create a SOAP request Message from a sample XML

Nidhi Chandra
Greenhorn

Joined: Aug 12, 2011
Posts: 1
Hi All,

Iam really struggling with this . I have a webservice to call which is secured by certificate and digital signature . All this needs to be passed as a part of SOAP request which Iam creating via Java code , but even after spending days on it the digital signature part which Iam trying to create is not getting formed properly .
The code creates the request properly till BinaryToken and breaks from "Name signatureToken" ...Looking for guidance as to what is not right in the code

This is the sample XML :




and the code which I have written to form the above XML via code is as :



Any help in solving this will be my saviour . Thanks to all .
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 412
    
    3

Any help in solving this will be my saviour . Thanks to all .


Am a beginner. I think your saviour is "Divide and Conquer".
Just break down your big sequential code into a small method which do 1 and 1 thing and test it to see if it is working as output expected gradually.
If not, post that segment of code and ask help for why/where/what is the wrong.

(Remember: The journey of 1000 miles begin with 1 small step. Going forward...)
Rajashekhar Pandirla
Greenhorn

Joined: Aug 12, 2011
Posts: 1
i am not getting......
please give sample example for generating and sending a soap message
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 412
    
    3
Assumption:
If all you need is getting the harded-coded SOAP message as posted
AND if you do not care how to code it or the code is secondary as of now
then the code below is 1 quick way using JDK1.6

Idea: Save the hard-coded SOAP Message in a external file, for example, C:\\soapmessage.xml and read file in.
That read file will be used to create a hard-coded SOAP Message which you will use to send to the Web service provider.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to create a SOAP request Message from a sample XML