Re: Help defining namespace
"Scott Nichol" <[email protected]>
| Newsgroups | gmane.text.xml.soap.user |
|---|---|
| Message-ID | <09a301c41bd7$7ada1e10$6401a8c0@northgate> |
Your code looks like what I would expect. The generated payload, however, has a root element <ns1:null xmlns:ns1="" which looks like there is neither name nor namespace on the root Element. It seems like the DOM Element probably has no namespace. How do you create the DOM in the first place? Scott Nichol Do not send e-mail directly to this e-mail address, because it is filtered to accept only mail from specific mail lists. ----- Original Message ----- From: "Craig Robinson" <[email protected]> To: <[email protected]> Sent: Monday, April 05, 2004 6:37 PM Subject: Help defining namespace Hi, This may seem like a very basic question, but I am stumped. Hope someone can help! I have an XML DOM document which I need to send to a web service from a message driven bean. The appropriate code snippet that I am using is: Element message = doc.getDocumentElement(); Call call = new Call (); call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML ); Vector params = new Vector (); params.addElement (new Parameter("message", Element.class, message, Constants.NS_URI_LITERAL_XML)); call.setParams (params); URL url = new URL ("http://localhost:8080/webservice/"); Response resp = call.invoke (url, ""); It sends a message like: <SOAP-ENV:Envelope ...> <SOAP-ENV:Body> <ns1:null xmlns:ns1="" SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml"> ...DOM Document... </ns1:null> </SOAP-ENV:Body> </SOAP-ENV:Envelope> What I need to do is define a namespace like: <ns1:AMessage xmlns:ns1="http://myurl" SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml"> How do I do this? Any help would be greatly appreciated. Cheers, Craig Craig Robinson Information Systems Unit Corporate Development Division Environmental Protection Agency Ph: (07) 3006 4629 Fax: (07) 3227 6534 Mobile: 0411 477 921 E-mail: [email protected] Visit us online at www.epa.qld.gov.au ___________________________ Disclaimer This e-mail, including attachments if any, has originated from a Queensland government agency and may contain information that is confidential, or covered by legal professional privilege, and is intended for the named recipient(s) only. If you have received this message in error, you are asked to inform the sender as quickly as possible and delete this message and any copies of this message from your computer system network. Any form of disclosure, modification, distribution and/or publication of this e-mail, including attachments is prohibited. Unless otherwise stated, this e-mail, including attachments represents the views of the sender and not the views of the Environmental Protection Agency. Although this e-mail has been checked for the presence of computer viruses, the Environmental Protection Agency provides no warranty that all possible viruses have been detected and cleaned. Any use of this e-mail could harm your computer system. ___________________________