1 Reply Latest reply on May 19, 2006 2:54 AM by Shu Sato

    How to get default namespace URI from SOAP Message

    Shu Sato Newbie

      I've got a few questions on how to get the default namespace from SOAP Message.

      After JBoss WS4EE in JBoss 4.0.1SP1(Sun 1.4.2_10 on Windows) received SOAP Response including
      the following message in its body,

      SOAP Message body:
       <msg xmlns="xxxx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      ? xsi:schemaLocation="xxxx schema/yyyy.xsd">

      JBoss WS2EE cannot get the default namespace by code #1 below("nameSpace" becomes null).

       ?String XML_SCHEMA_NS = "xmlns"
       ?String nameSpace = element.getAttribute(HandlerNames.XML_SCHEMA_NS);

      On the other hand, Apache Axis(1.1rc1) can get it by code #1.

      By the way, JBoss WS2EE can obtain the default namespace by another way like code #2 below.

       SOAPBodyElement body = (SOAPBodyElement)element;
       String nameSpace = body.getNamespaceURI("")

      <Question 1>
      Is is true(a specification) that JBoss WS2EE *cannot* but Apache Axis *can* get the default namesapce by code #1 ?

      <Question 2>
      Using JBoss WS2EE and JBossWS(since 4.0.4CR2), is code #2 a correct way to get the default namesapce from SOAP Message?

      Best regards,