This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Java - creating Web Service Request using JDOM - Header issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Java - creating Web Service Request using JDOM - Header issue" Watch "Java - creating Web Service Request using JDOM - Header issue" New topic
Author

Java - creating Web Service Request using JDOM - Header issue

Veljko Cankovic
Greenhorn

Joined: Dec 27, 2011
Posts: 12
I done many integrations using JDOM in Eclipse but for first time I have an issue because my SOAP XML message should contain and `HEADER` element wuth specific elements. This is my whole message:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:agi="http://agilent.parlayx.sms">
<soapenv:Header>
<cppass>test</cppass>
<cpuname>test</cpuname>
</soapenv:Header>
<soapenv:Body>
<agi:sendBulkSms>
<address>tel:3876123456</address>
</agi:sendBulkSms>
</soapenv:Body>
</soapenv:Envelope>


I created `BODY` structure using this:

Element top = new Element("sendBulkSms", agi);
Document jDoc = new Document(top);

Element address = new Element("address", agi);
address.setText("tel:3876123456");
top.addContent(address);

This works OK I did it many times before. But is it possible to create and header element of message uisng JDOM or not? Because as far as I know only BODY element can be defined.

Thank you, I will appreciate help (I must do it over JDOM so there are no other alternative)
 
jQuery in Action, 2nd edition
 
subject: Java - creating Web Service Request using JDOM - Header issue
 
Similar Threads
RPC/Literal vs Document/Literal
Axis client for jboss ejb3 session bean web service
urgent help: Missing wsse:Security header in request
Excpetion deserialization error while creating XML for sending via web service
SOAP Message Construction