Exactly which method call in which class/interface are you suggesting I use?
LOL.. I shouldn't be answering these kinds of questions this late at night.. too easy to make a mistake. I thought you were straight DOM to manipulate the API. It never even dawned on my you were using the SOAP APIs.. I am sorry :)
I'm not quite sure which method call you're referring to when you say "try
the NS version of the same call". I'm currently using
javax.xml.soap.SOAPElement.addAttribute() to add the attribute. There is
no other method in the interface that adds attributes. (Given that it is
recommended to use the SOAP api to manipulate a SOAP envelope, presumably
it is not advisable to use a lower level method call to add an attribute,
such as org.w3c.dom.Element.setAttributeNS().)
Could you try the following things:
javax.xml.soap.Name myAttribName = soapFactory.createName("myattrib",null, null); mySOAPElement.addAttribute(myAttribName, "a test");
or
javax.xml.soap.Name myAttribName = soapFactory.createName("myattrib","", ""); mySOAPElement.addAttribute(myAttribName, "a test");
If that doesn't work you might be able to help out with a little experiment :)
I have access to Sun's SAAJ impl. source, and I think the latter will work and end up invoking it with the DOM L2 method:
Element.setAttributeNS(null, "myAttrib", "a test");
Worth a shot.
--Sean