Java SOAP - Need help on Body and ChildElement manipulation
- by techventure
Hi guys
I'm trying to write some code in java to learn more about coding with WSDL and SOAP.
I've been able to build up a BodyElement for a given namespace. But when i come to adding the childElements I'm runnig intp problems.
For example given :'<'to:checkAccount xmlns:to="http://foo"
'<'to:id test' <'/to:id
'<'to:password test '<'/to:password
'<'to:checkAccount "
I'm able to set the bodyElement(to:checkAccount), but when i try to add the childElements (to:id, to:password) , the childElement needs to have the "to" prefix otherwise it won't work.
ie. sf = SOAPFactory.newInstance();
Name childName = sf.createName("id");
SOAPElement symbol = bodyElement.addChildElement(childName);
this doesn't work since it doesn't have the "to" prefix to id and password. I cannot do
Name childName = sf.createName("id","to",null);
as it gives me an error saying wrong namespace...
can someone tell me how i can add to:id and to:password to to:checkAccount ?