You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Doug Schaible <do...@gmail.com> on 2007/05/24 06:24:15 UTC

Mutiple Prologs in SOAP Message

Good Evening!

I need to have two prologs in my SOAP message.  The SOAP message that I have
starts with a prolog and then the paramater that I am adding has a prolog
(because it is an XML document.)

If I leave both prologs in the message I get the exception "The processing
instruction target matching "[xX][mM][lL]" is not allowed."

If I remove the second prolog I do not receive the error.

If I delete the second prolog and then setNamespaceAware to true the second
prolog is being generated automatically for me but, but it also adds ns1 to
everything.  Is there a way to have it write the second prolog like it is
doing and then not add the name spaces?

Thanks,
Doug

Re: Mutiple Prologs in SOAP Message

Posted by Martin Gainty <mg...@hotmail.com>.
You are going to have to either declare your namespace as empty as in this example
 <A xmlns="http://www.foo.org/">
     <B>
        <C xmlns="">
           <D>abcd</D>
        </C>
     </B>
  </A>
so references to A B nodes have a default namespace of http://www.foo.org
any references to C D have NO namespace assignment

*********Or you will need to redeclarare your existing namespace**********
 <foo:A xmlns:foo="http://www.foo.org/">
     <foo:B>
        <foo:C xmlns:foo="">   <==== This is an error in v1.0, legal in v1.1.
           <foo:D>abcd</foo:D>
        </foo:C>
     </foo:B>
  </foo:A>


so in your wsdl set your xmlns to empty string 
xmlns="" 
(Info courtesy of Ron Bourret)
http://www.rpbourret.com/xml/NamespacesFAQ.htm#ns_9

M-
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

  ----- Original Message ----- 
  From: Doug Schaible 
  To: axis-user@ws.apache.org 
  Sent: Thursday, May 24, 2007 12:24 AM
  Subject: Mutiple Prologs in SOAP Message


  Good Evening!

  I need to have two prologs in my SOAP message.  The SOAP message that I have starts with a prolog and then the paramater that I am adding has a prolog (because it is an XML document.)

  If I leave both prologs in the message I get the exception "The processing instruction target matching "[xX][mM][lL]" is not allowed."

  If I remove the second prolog I do not receive the error.

  If I delete the second prolog and then setNamespaceAware to true the second prolog is being generated automatically for me but, but it also adds ns1 to everything.  Is there a way to have it write the second prolog like it is doing and then not add the name spaces? 

  Thanks,
  Doug