Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding SOAP elements through DOM

 
Vijay Chandran
Ranch Hand
Posts: 186
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,

I need to create a XML string from DOM which will be sent across to a web service. I developed the following code which will create a XML string:


This is the output:


Following are the queries:
(1) The attribute namespaces for SOAP Envelope is added correctly but not in SOAP Header and SOAP Body
(2) How to complete the SOAP header tag in the beginning itself. I must complete the header tag like this <SOAP-ENV:Header />
(3) How to remove the standalone attribue in the xml header
(4) How can i found out the DOM levl used?
(5) Is this the correct way for appending SOAP headers? If not please direct me a correct way.

Request you to clear my queries.

Thank you very much,
Regards,
Vijay

(Edited to make code narrower: PC)

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(1) I don't think there's anything wrong with your namespace declarations. What is the problem in your opinion?

(2) If you want an element to be an empty element then don't write code which adds children to it.

(3) Go back to the API documentation for OutputKeys and look again.

(4) I don't know. Why does it matter?

(5) If it produces the correct output then it is a correct way.
 
Vijay Chandran
Ranch Hand
Posts: 186
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Paul,

Thank you very much for the reply. The problem is just as i am getting the attribute namespaces in the soap envelope

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2000/XMLSchema" xmlns:xsi="http://www.w3.org/2000/XMLSchema-instance">

i'm not getting it in the SOAP header and in SOAP body. The output is only the elements:

<SOAP-ENV:Header>
<SOAP-ENV:Body>

Kindly provide a solution for this.

Thanks,
Vijay

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A solution? First explain why you think it is a problem. Bearing in mind, of course, that namespace declarations are inherited by child elements.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic