You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Jongjin Choi <gu...@hotmail.com> on 2005/03/03 11:46:14 UTC

[Axis2] OMElementImpl question

Hi.

The Aixom doest not seem to serialize soap message which has an unqualified soap body element.

For example,
  <soapenv:Body>
    <ns1:getBalance xmlns:ns1=http://localhost:8081/axis/services/BankPort/>
       <accountNo href="#id0"/>
    </ns1:getBalacne>
  </soapenv:Body>

The following exception occurs when serializing.

org.apache.axis.om.OMException: Non namespace qualified elements are not allowed
 at org.apache.axis.om.impl.llom.OMElementImpl.serializeStartpart(OMElementImpl.java:681)
 at org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:723)
 at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632)
 at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
 at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:638)
 at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
 at org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:726)
 at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632)
 at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
 at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:638)
 at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
 at org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:726)
 at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632)

But the OMElement for <accountNo> element is built and the localname and namespace's value are set.

For example, 

Envelope envelope = (SOAPEnvelope)builder.getDocumentElement();
SOAPBody sb = envelope.getBody();
OMElement e1 = sb.getFirstElement();    // <ns1:getBalance>
OMElement e2 = e1.getFirstElement();    // <accountNo>
OMNamespace ns = e2.getNamespace();

The values of localName and namespace of OMElment e2 are :

e2.getLocalName() = accountNo
e2.getNamespaceName() = null;
ns.getName() = http://localhost:8081/axis/services/BankPort
ns.getPrefix() = ns1

The questions are:
1. Why OMElement throws exception when serializing namespace-unqualified element?
2. The unqualifed element's OMElement is built but the OMNamespace for this OMElement looks invalid.
  In this case, I think the values should be : 
      ns.getName() = "" or null
      ns.getPrefix() = "" or null
  Is this right or am I miss something in OMElement?

Thanks.

/Jongjin


RE: [Axis2] OMElementImpl question

Posted by Eran Chinthaka <ch...@opensource.lk>.
I think its better for us, if you can write a test case and put that. And
make sure to exclude that using the maven.xml.

-- Chinthaka

-----Original Message-----
From: Ajith Ranabahu [mailto:ajith.ranabahu@gmail.com] 
Sent: Saturday, March 05, 2005 1:00 PM
To: axis-dev@ws.apache.org; jayachandra
Subject: Re: [Axis2] OMElementImpl question

Hi,
I have added a new testcase to check the namespace behavior with the
exact soapmessage Jongjin has mentioned and it seems to pass! Would
you be able let me know how exactly the problem came ?
In the mean time have a look at the very simple test I wrote to check it at
org.apache.axis.om.impl.serializer.NoNamespaceSerializerTest class in
the src/test folder in OM module.

Ajith


On Fri, 4 Mar 2005 20:15:39 +0530, jayachandra <ja...@gmail.com>
wrote:
> Hi Axis2 Developers!
> Has it been taken care of in Axis2 to (de)serialize non-qualifying
> objects too. Kindly update the group when it's done and where from can
> the new source be gotten.
> 
> Thank you,
> Jayachandra
> 

-- 
Ajith Ranabahu




RE: [Axis2] OMElementImpl question

Posted by Eran Chinthaka <ch...@opensource.lk>.
Well, there was a constraint in OM builder and OM serializing code that
every element should have a namespace and none can exist without one. I
changed that.
And there was a problem in default namespace handling as well. So fixed that
too. 

I think checking SOAPBody children will be an unnecessary perf draw back. So
shall we defer that for the time being ??

Regards,
-- Chinthaka 

-----Original Message-----
From: Sanjiva Weerawarana [mailto:sanjiva@opensource.lk] 
Sent: Tuesday, March 08, 2005 4:49 PM
To: axis-dev@ws.apache.org; chinthaka@opensource.lk
Subject: Re: [Axis2] OMElementImpl question

"Eran Chinthaka" <ch...@opensource.lk> writes:
> Thankx Dennis. 
> 
> Will change AXIOM stuff according to that. 

Mebbe I'm missing something .. why does AXIOM need to change? AXIOM
should just do any old XML (?).

Or did you mean to say that you'll change o.a.a.om.SOAPBody to 
check that all its children are NS qualified? If so +1, as long
as it has zero perf impact .. otherwise don't bother IMO. 

IMO our decision to keep the SOAP message abstraction classes
in AXIOM will continue to cause these kinds of confusions.

Sanjiva.




Re: [Axis2] OMElementImpl question

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
"Eran Chinthaka" <ch...@opensource.lk> writes:
> Thankx Dennis. 
> 
> Will change AXIOM stuff according to that. 

Mebbe I'm missing something .. why does AXIOM need to change? AXIOM
should just do any old XML (?).

Or did you mean to say that you'll change o.a.a.om.SOAPBody to 
check that all its children are NS qualified? If so +1, as long
as it has zero perf impact .. otherwise don't bother IMO. 

IMO our decision to keep the SOAP message abstraction classes
in AXIOM will continue to cause these kinds of confusions.

Sanjiva.

RE: [Axis2] OMElementImpl question

Posted by Eran Chinthaka <ch...@opensource.lk>.
Thankx Dennis. 

Will change AXIOM stuff according to that. 

-----Original Message-----
From: Dennis Sosnoski [mailto:dms@sosnoski.com] 
Sent: Tuesday, March 08, 2005 3:31 AM
To: axis-dev@ws.apache.org
Subject: Re: [Axis2] OMElementImpl question

Eran Chinthaka wrote:

>...
>
><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>            <soapenv:Body>
>               <ns1:getBalance
>xmlns:ns1="http://localhost:8081/axis/services/BankPort/">
>                  <accountNo href="#id0"/>
>               </ns1:getBalance>
>             </soapenv:Body>
></soapenv:Envelope>
>
>What is the namespace of accountNo element ? According to the xml namespace
>spec this has no namespace. 
>
>But in SOAP I think all elements should be namespace qualified. So the
above
>should be an invalid xml for SOAP builder. Else, can we put the namespace
of
>accountNo as the default namespace for SOAP. (What is the defaultNamespace
>of a SOAP message if defaultNamespace is not defined ??)
>
There is no requirement that "all elements should be namespace 
qualified", either in SOAP or in WS-I BP. WS-BP *does* require that the 
children of the SOAP Body element need to be namespace qualified, but 
this applies only to the direct children of that element (not to all 
contained elements).

  - Dennis




Re: [Axis2] OMElementImpl question

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Eran Chinthaka wrote:

>...
>
><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>            <soapenv:Body>
>               <ns1:getBalance
>xmlns:ns1="http://localhost:8081/axis/services/BankPort/">
>                  <accountNo href="#id0"/>
>               </ns1:getBalance>
>             </soapenv:Body>
></soapenv:Envelope>
>
>What is the namespace of accountNo element ? According to the xml namespace
>spec this has no namespace. 
>
>But in SOAP I think all elements should be namespace qualified. So the above
>should be an invalid xml for SOAP builder. Else, can we put the namespace of
>accountNo as the default namespace for SOAP. (What is the defaultNamespace
>of a SOAP message if defaultNamespace is not defined ??)
>
There is no requirement that "all elements should be namespace 
qualified", either in SOAP or in WS-I BP. WS-BP *does* require that the 
children of the SOAP Body element need to be namespace qualified, but 
this applies only to the direct children of that element (not to all 
contained elements).

  - Dennis

Re: [Axis2] OMElementImpl question

Posted by Jongjin Choi <gu...@hotmail.com>.
IMO, the namespace of <accountNO> is "" ie. no-namespace.

I think the following two are equivalent in this case.

1)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
           <soapenv:Body>
              <ns1:getBalance xmlns:ns1="http://localhost:8081/axis/services/BankPort/">
                 <accountNo href="#id0"/>
              </ns1:getBalance>
            </soapenv:Body>
</soapenv:Envelope>

2)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
           <soapenv:Body>
              <ns1:getBalance xmlns:ns1="http://localhost:8081/axis/services/BankPort/">
                 <accountNo xmlns="" href="#id0"/>
              </ns1:getBalance>
            </soapenv:Body>
</soapenv:Envelope>
  * Note xmlns="" in <accountNo>.

This is the way Axis1.X serializes SOAP messages. Isn't it?

/Jongjin 
 
----- Original Message ----- 
From: "Eran Chinthaka" <ch...@opensource.lk>
To: <ax...@ws.apache.org>
Sent: Monday, March 07, 2005 7:11 PM
Subject: RE: [Axis2] OMElementImpl question


> Well, this fixing gave me another problem. 
> 
> Now lets take the below example.
> 
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>            <soapenv:Body>
>               <ns1:getBalance
> xmlns:ns1="http://localhost:8081/axis/services/BankPort/">
>                  <accountNo href="#id0"/>
>               </ns1:getBalance>
>             </soapenv:Body>
> </soapenv:Envelope>
> 
> What is the namespace of accountNo element ? According to the xml namespace
> spec this has no namespace. 
> 
> But in SOAP I think all elements should be namespace qualified. So the above
> should be an invalid xml for SOAP builder. Else, can we put the namespace of
> accountNo as the default namespace for SOAP. (What is the defaultNamespace
> of a SOAP message if defaultNamespace is not defined ??)
> 
> For the time being, I omit the namespace check in SOAP messages. But this
> should be fixed soon, I think.
> 
> Thoughts ???
> 
> Regards,
> Eran Chinthaka
> 
> -----Original Message-----
> From: Eran Chinthaka [mailto:chinthaka@opensource.lk] 
> Sent: Monday, March 07, 2005 2:28 PM
> To: axis-dev@ws.apache.org
> Subject: RE: [Axis2] OMElementImpl question
> 
> I fixed the bug. 
> 
> -- Chinthaka
> 
> -----Original Message-----
> From: Jongjin Choi [mailto:gunsnroz@hotmail.com] 
> Sent: Monday, March 07, 2005 2:22 PM
> To: axis-dev@ws.apache.org; Ajith Ranabahu
> Subject: Re: [Axis2] OMElementImpl question
> 
> Ajith,
> 
> I'll file this to JIRA.
> 
> Thanks.
> 
> 
> ----- Original Message ----- 
> From: "Ajith Ranabahu" <aj...@gmail.com>
> To: <ax...@ws.apache.org>
> Sent: Monday, March 07, 2005 4:56 PM
> Subject: Re: [Axis2] OMElementImpl question
> 
> 
>> Thanks Jongjin. I can reporduce the problem now. Seems we have a bug
>> in the serializer when it tries to serialize the stream directly.
>> Will let you know as soon as it is fixed.
>> 
>> BTW Shouldn' t we use JIRA for these matters ?. My guess is these
>> things should be recorded and prioritized and there's no place like
>> JIRA to do it better :)
>> 
>> 
>> On Mon, 7 Mar 2005 16:37:33 +0900, Jongjin Choi <gu...@hotmail.com>
> wrote:
>>> Ajith,
>>> 
>>> In NoNamespaceSerializerTest.java,
>>> 
>>> modify following line
>>> from:
>>> (line number : 64) env.serialize(write, false);
>>> to:
>>> (line number : 64) env.serialize(write, true);
>>> 
>>> You can see the error.
>>> 
>>> /Jongjin.
>>> 
>>> 
>>> ----- Original Message -----
>>> From: "Ajith Ranabahu" <aj...@gmail.com>
>>> To: <ax...@ws.apache.org>; "jayachandra" <ja...@gmail.com>
>>> Sent: Saturday, March 05, 2005 4:00 PM
>>> Subject: Re: [Axis2] OMElementImpl question
>>> 
>>> > Hi,
>>> > I have added a new testcase to check the namespace behavior with the
>>> > exact soapmessage Jongjin has mentioned and it seems to pass! Would
>>> > you be able let me know how exactly the problem came ?
>>> > In the mean time have a look at the very simple test I wrote to check
> it at
>>> > org.apache.axis.om.impl.serializer.NoNamespaceSerializerTest class in
>>> > the src/test folder in OM module.
>>> >
>>> > Ajith
>>> >
>>> >
>>> > On Fri, 4 Mar 2005 20:15:39 +0530, jayachandra <ja...@gmail.com>
> wrote:
>>> >> Hi Axis2 Developers!
>>> >> Has it been taken care of in Axis2 to (de)serialize non-qualifying
>>> >> objects too. Kindly update the group when it's done and where from can
>>> >> the new source be gotten.
>>> >>
>>> >> Thank you,
>>> >> Jayachandra
>>> >>
>>> >
>>> > --
>>> > Ajith Ranabahu
>>> >
>> 
>> 
>> -- 
>> Ajith Ranabahu
>>
> 
> 
> 
> 
> 
> 
> 
>

RE: [Axis2] OMElementImpl question

Posted by Eran Chinthaka <ch...@opensource.lk>.
Well, this fixing gave me another problem. 

Now lets take the below example.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
            <soapenv:Body>
               <ns1:getBalance
xmlns:ns1="http://localhost:8081/axis/services/BankPort/">
                  <accountNo href="#id0"/>
               </ns1:getBalance>
             </soapenv:Body>
</soapenv:Envelope>

What is the namespace of accountNo element ? According to the xml namespace
spec this has no namespace. 

But in SOAP I think all elements should be namespace qualified. So the above
should be an invalid xml for SOAP builder. Else, can we put the namespace of
accountNo as the default namespace for SOAP. (What is the defaultNamespace
of a SOAP message if defaultNamespace is not defined ??)

For the time being, I omit the namespace check in SOAP messages. But this
should be fixed soon, I think.

Thoughts ???

Regards,
Eran Chinthaka

-----Original Message-----
From: Eran Chinthaka [mailto:chinthaka@opensource.lk] 
Sent: Monday, March 07, 2005 2:28 PM
To: axis-dev@ws.apache.org
Subject: RE: [Axis2] OMElementImpl question

I fixed the bug. 

-- Chinthaka

-----Original Message-----
From: Jongjin Choi [mailto:gunsnroz@hotmail.com] 
Sent: Monday, March 07, 2005 2:22 PM
To: axis-dev@ws.apache.org; Ajith Ranabahu
Subject: Re: [Axis2] OMElementImpl question

Ajith,

I'll file this to JIRA.

Thanks.


----- Original Message ----- 
From: "Ajith Ranabahu" <aj...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Monday, March 07, 2005 4:56 PM
Subject: Re: [Axis2] OMElementImpl question


> Thanks Jongjin. I can reporduce the problem now. Seems we have a bug
> in the serializer when it tries to serialize the stream directly.
> Will let you know as soon as it is fixed.
> 
> BTW Shouldn' t we use JIRA for these matters ?. My guess is these
> things should be recorded and prioritized and there's no place like
> JIRA to do it better :)
> 
> 
> On Mon, 7 Mar 2005 16:37:33 +0900, Jongjin Choi <gu...@hotmail.com>
wrote:
>> Ajith,
>> 
>> In NoNamespaceSerializerTest.java,
>> 
>> modify following line
>> from:
>> (line number : 64) env.serialize(write, false);
>> to:
>> (line number : 64) env.serialize(write, true);
>> 
>> You can see the error.
>> 
>> /Jongjin.
>> 
>> 
>> ----- Original Message -----
>> From: "Ajith Ranabahu" <aj...@gmail.com>
>> To: <ax...@ws.apache.org>; "jayachandra" <ja...@gmail.com>
>> Sent: Saturday, March 05, 2005 4:00 PM
>> Subject: Re: [Axis2] OMElementImpl question
>> 
>> > Hi,
>> > I have added a new testcase to check the namespace behavior with the
>> > exact soapmessage Jongjin has mentioned and it seems to pass! Would
>> > you be able let me know how exactly the problem came ?
>> > In the mean time have a look at the very simple test I wrote to check
it at
>> > org.apache.axis.om.impl.serializer.NoNamespaceSerializerTest class in
>> > the src/test folder in OM module.
>> >
>> > Ajith
>> >
>> >
>> > On Fri, 4 Mar 2005 20:15:39 +0530, jayachandra <ja...@gmail.com>
wrote:
>> >> Hi Axis2 Developers!
>> >> Has it been taken care of in Axis2 to (de)serialize non-qualifying
>> >> objects too. Kindly update the group when it's done and where from can
>> >> the new source be gotten.
>> >>
>> >> Thank you,
>> >> Jayachandra
>> >>
>> >
>> > --
>> > Ajith Ranabahu
>> >
> 
> 
> -- 
> Ajith Ranabahu
>








RE: [Axis2] OMElementImpl question

Posted by Eran Chinthaka <ch...@opensource.lk>.
I fixed the bug. 

-- Chinthaka

-----Original Message-----
From: Jongjin Choi [mailto:gunsnroz@hotmail.com] 
Sent: Monday, March 07, 2005 2:22 PM
To: axis-dev@ws.apache.org; Ajith Ranabahu
Subject: Re: [Axis2] OMElementImpl question

Ajith,

I'll file this to JIRA.

Thanks.


----- Original Message ----- 
From: "Ajith Ranabahu" <aj...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Monday, March 07, 2005 4:56 PM
Subject: Re: [Axis2] OMElementImpl question


> Thanks Jongjin. I can reporduce the problem now. Seems we have a bug
> in the serializer when it tries to serialize the stream directly.
> Will let you know as soon as it is fixed.
> 
> BTW Shouldn' t we use JIRA for these matters ?. My guess is these
> things should be recorded and prioritized and there's no place like
> JIRA to do it better :)
> 
> 
> On Mon, 7 Mar 2005 16:37:33 +0900, Jongjin Choi <gu...@hotmail.com>
wrote:
>> Ajith,
>> 
>> In NoNamespaceSerializerTest.java,
>> 
>> modify following line
>> from:
>> (line number : 64) env.serialize(write, false);
>> to:
>> (line number : 64) env.serialize(write, true);
>> 
>> You can see the error.
>> 
>> /Jongjin.
>> 
>> 
>> ----- Original Message -----
>> From: "Ajith Ranabahu" <aj...@gmail.com>
>> To: <ax...@ws.apache.org>; "jayachandra" <ja...@gmail.com>
>> Sent: Saturday, March 05, 2005 4:00 PM
>> Subject: Re: [Axis2] OMElementImpl question
>> 
>> > Hi,
>> > I have added a new testcase to check the namespace behavior with the
>> > exact soapmessage Jongjin has mentioned and it seems to pass! Would
>> > you be able let me know how exactly the problem came ?
>> > In the mean time have a look at the very simple test I wrote to check
it at
>> > org.apache.axis.om.impl.serializer.NoNamespaceSerializerTest class in
>> > the src/test folder in OM module.
>> >
>> > Ajith
>> >
>> >
>> > On Fri, 4 Mar 2005 20:15:39 +0530, jayachandra <ja...@gmail.com>
wrote:
>> >> Hi Axis2 Developers!
>> >> Has it been taken care of in Axis2 to (de)serialize non-qualifying
>> >> objects too. Kindly update the group when it's done and where from can
>> >> the new source be gotten.
>> >>
>> >> Thank you,
>> >> Jayachandra
>> >>
>> >
>> > --
>> > Ajith Ranabahu
>> >
> 
> 
> -- 
> Ajith Ranabahu
>





Re: [Axis2] OMElementImpl question

Posted by Jongjin Choi <gu...@hotmail.com>.
Ajith,

I'll file this to JIRA.

Thanks.


----- Original Message ----- 
From: "Ajith Ranabahu" <aj...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Monday, March 07, 2005 4:56 PM
Subject: Re: [Axis2] OMElementImpl question


> Thanks Jongjin. I can reporduce the problem now. Seems we have a bug
> in the serializer when it tries to serialize the stream directly.
> Will let you know as soon as it is fixed.
> 
> BTW Shouldn' t we use JIRA for these matters ?. My guess is these
> things should be recorded and prioritized and there's no place like
> JIRA to do it better :)
> 
> 
> On Mon, 7 Mar 2005 16:37:33 +0900, Jongjin Choi <gu...@hotmail.com> wrote:
>> Ajith,
>> 
>> In NoNamespaceSerializerTest.java,
>> 
>> modify following line
>> from:
>> (line number : 64) env.serialize(write, false);
>> to:
>> (line number : 64) env.serialize(write, true);
>> 
>> You can see the error.
>> 
>> /Jongjin.
>> 
>> 
>> ----- Original Message -----
>> From: "Ajith Ranabahu" <aj...@gmail.com>
>> To: <ax...@ws.apache.org>; "jayachandra" <ja...@gmail.com>
>> Sent: Saturday, March 05, 2005 4:00 PM
>> Subject: Re: [Axis2] OMElementImpl question
>> 
>> > Hi,
>> > I have added a new testcase to check the namespace behavior with the
>> > exact soapmessage Jongjin has mentioned and it seems to pass! Would
>> > you be able let me know how exactly the problem came ?
>> > In the mean time have a look at the very simple test I wrote to check it at
>> > org.apache.axis.om.impl.serializer.NoNamespaceSerializerTest class in
>> > the src/test folder in OM module.
>> >
>> > Ajith
>> >
>> >
>> > On Fri, 4 Mar 2005 20:15:39 +0530, jayachandra <ja...@gmail.com> wrote:
>> >> Hi Axis2 Developers!
>> >> Has it been taken care of in Axis2 to (de)serialize non-qualifying
>> >> objects too. Kindly update the group when it's done and where from can
>> >> the new source be gotten.
>> >>
>> >> Thank you,
>> >> Jayachandra
>> >>
>> >
>> > --
>> > Ajith Ranabahu
>> >
> 
> 
> -- 
> Ajith Ranabahu
>

Re: [Axis2] OMElementImpl question

Posted by Ajith Ranabahu <aj...@gmail.com>.
Thanks Jongjin. I can reporduce the problem now. Seems we have a bug
in the serializer when it tries to serialize the stream directly.
Will let you know as soon as it is fixed.

BTW Shouldn' t we use JIRA for these matters ?. My guess is these
things should be recorded and prioritized and there's no place like
JIRA to do it better :)


On Mon, 7 Mar 2005 16:37:33 +0900, Jongjin Choi <gu...@hotmail.com> wrote:
> Ajith,
> 
> In NoNamespaceSerializerTest.java,
> 
> modify following line
> from:
> (line number : 64) env.serialize(write, false);
> to:
> (line number : 64) env.serialize(write, true);
> 
> You can see the error.
> 
> /Jongjin.
> 
> 
> ----- Original Message -----
> From: "Ajith Ranabahu" <aj...@gmail.com>
> To: <ax...@ws.apache.org>; "jayachandra" <ja...@gmail.com>
> Sent: Saturday, March 05, 2005 4:00 PM
> Subject: Re: [Axis2] OMElementImpl question
> 
> > Hi,
> > I have added a new testcase to check the namespace behavior with the
> > exact soapmessage Jongjin has mentioned and it seems to pass! Would
> > you be able let me know how exactly the problem came ?
> > In the mean time have a look at the very simple test I wrote to check it at
> > org.apache.axis.om.impl.serializer.NoNamespaceSerializerTest class in
> > the src/test folder in OM module.
> >
> > Ajith
> >
> >
> > On Fri, 4 Mar 2005 20:15:39 +0530, jayachandra <ja...@gmail.com> wrote:
> >> Hi Axis2 Developers!
> >> Has it been taken care of in Axis2 to (de)serialize non-qualifying
> >> objects too. Kindly update the group when it's done and where from can
> >> the new source be gotten.
> >>
> >> Thank you,
> >> Jayachandra
> >>
> >
> > --
> > Ajith Ranabahu
> >


-- 
Ajith Ranabahu

Re: [Axis2] OMElementImpl question

Posted by Jongjin Choi <gu...@hotmail.com>.
Ajith, 

In NoNamespaceSerializerTest.java,

modify following line 
from: 
(line number : 64) env.serialize(write, false);
to:
(line number : 64) env.serialize(write, true);

You can see the error. 

/Jongjin.


----- Original Message ----- 
From: "Ajith Ranabahu" <aj...@gmail.com>
To: <ax...@ws.apache.org>; "jayachandra" <ja...@gmail.com>
Sent: Saturday, March 05, 2005 4:00 PM
Subject: Re: [Axis2] OMElementImpl question


> Hi,
> I have added a new testcase to check the namespace behavior with the
> exact soapmessage Jongjin has mentioned and it seems to pass! Would
> you be able let me know how exactly the problem came ?
> In the mean time have a look at the very simple test I wrote to check it at
> org.apache.axis.om.impl.serializer.NoNamespaceSerializerTest class in
> the src/test folder in OM module.
> 
> Ajith
> 
> 
> On Fri, 4 Mar 2005 20:15:39 +0530, jayachandra <ja...@gmail.com> wrote:
>> Hi Axis2 Developers!
>> Has it been taken care of in Axis2 to (de)serialize non-qualifying
>> objects too. Kindly update the group when it's done and where from can
>> the new source be gotten.
>> 
>> Thank you,
>> Jayachandra
>> 
> 
> -- 
> Ajith Ranabahu
>

Re: [Axis2] OMElementImpl question

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi,
I have added a new testcase to check the namespace behavior with the
exact soapmessage Jongjin has mentioned and it seems to pass! Would
you be able let me know how exactly the problem came ?
In the mean time have a look at the very simple test I wrote to check it at
org.apache.axis.om.impl.serializer.NoNamespaceSerializerTest class in
the src/test folder in OM module.

Ajith


On Fri, 4 Mar 2005 20:15:39 +0530, jayachandra <ja...@gmail.com> wrote:
> Hi Axis2 Developers!
> Has it been taken care of in Axis2 to (de)serialize non-qualifying
> objects too. Kindly update the group when it's done and where from can
> the new source be gotten.
> 
> Thank you,
> Jayachandra
> 

-- 
Ajith Ranabahu

Re: [Axis2] OMElementImpl question

Posted by jayachandra <ja...@gmail.com>.
Hi Axis2 Developers!
Has it been taken care of in Axis2 to (de)serialize non-qualifying
objects too. Kindly update the group when it's done and where from can
the new source be gotten.

Thank you,
Jayachandra

On Thu, 3 Mar 2005 21:29:49 +0900, Jongjin Choi <gu...@hotmail.com> wrote:
> Ajith,
> 
> If we send or receive soap message which is rpc-encoded, the xml fragment 2 can be possible.
> SOAP 1.1's soap encoding uses unqualified accessor element in compound type.
> http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383519
> I think this is the case for #2.
> 
> Also,, I suppose, we can find real world legacy soap use cases
> which use unqualified no-namespace XML even in document style web services.
> I think the this kind of legacy usages are not recommended and even wrong,
> but it is better that Axiom(Axis2) can handle these cases.
> 
> Thought?
> 
> 
> ----- Original Message -----
> From: "Ajith Ranabahu" <aj...@gmail.com>
> To: <ax...@ws.apache.org>; "jayachandra" <ja...@gmail.com>
> Sent: Thursday, March 03, 2005 8:33 PM
> Subject: Re: [Axis2] OMElementImpl question
> 
> > Hi there,
> > I suppose what you meant by the null prefix is the default namespace
> > declaration.
> > have a look at the following XML's and tell me if I have understood
> > the problem correctly
> >
> > xml fragment 1
> >
> > <a xmlns="myns">
> > <b/>
> > </a>
> >
> > in this case element b belongs to the namespace "myns" even though its
> > is not prefixed. I believe this is the null prefix you were refering
> > to. OM should support this behavior.
> >
> > xml fragment 2
> >
> > <p:a xmlns:p="myns">
> > <b/>
> > </p:a>
> >
> > in this case the namespace is prefixed and since b is not prefixed it
> > is not namespace qualified. So OM will spit out an error message
> > saying the elements are not ns qualified.
> >
> > I believe that case 1 should work. if it's not it's definitely a bug.
> > i will run a test case and let you guys know
> >
> >
> >
> > On Thu, 3 Mar 2005 16:42:10 +0530, jayachandra <ja...@gmail.com> wrote:
> >> Hi Axis2 developers,
> >> Even I too am facing same problem. And, this appears like a bug to me.
> >> As per SOAP element names should be qualified, but that doesn't
> >> necessarily mean prefixes should exist. A default namespace element
> >> may just be qualified with a null prefix. This should be fixed at the
> >> earliest, or else interop is going to be a problem.
> >> I am writing a CommonsHTTPTransporSender and am stuck in creating a response
> >> response envelope out of the returned SOAP packet. In my case on the
> >> server-side Axis1.2RC2 returned a SOAP packet (verified with tcpmon)
> >> that has an element <EchoStringReturn>, this is being treated as
> >> unqualifed and OM (AXIOM) is failing to (de)serialize it.
> >>
> >> Thank you,
> >> Jayachandra
> >>
> >
> >
> > --
> > Ajith Ranabahu
> >


-- 
-- Jaya

Re: [Axis2] OMElementImpl question

Posted by Jongjin Choi <gu...@hotmail.com>.
Ajith,

If we send or receive soap message which is rpc-encoded, the xml fragment 2 can be possible.
SOAP 1.1's soap encoding uses unqualified accessor element in compound type.
http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383519
I think this is the case for #2.

Also,, I suppose, we can find real world legacy soap use cases 
which use unqualified no-namespace XML even in document style web services.
I think the this kind of legacy usages are not recommended and even wrong, 
but it is better that Axiom(Axis2) can handle these cases. 

Thought?


----- Original Message ----- 
From: "Ajith Ranabahu" <aj...@gmail.com>
To: <ax...@ws.apache.org>; "jayachandra" <ja...@gmail.com>
Sent: Thursday, March 03, 2005 8:33 PM
Subject: Re: [Axis2] OMElementImpl question


> Hi there,
> I suppose what you meant by the null prefix is the default namespace
> declaration.
> have a look at the following XML's and tell me if I have understood
> the problem correctly
> 
> xml fragment 1
> 
> <a xmlns="myns">
> <b/>
> </a>
> 
> in this case element b belongs to the namespace "myns" even though its
> is not prefixed. I believe this is the null prefix you were refering
> to. OM should support this behavior.
> 
> xml fragment 2
> 
> <p:a xmlns:p="myns">
> <b/>
> </p:a>
> 
> in this case the namespace is prefixed and since b is not prefixed it
> is not namespace qualified. So OM will spit out an error message
> saying the elements are not ns qualified.
> 
> I believe that case 1 should work. if it's not it's definitely a bug.
> i will run a test case and let you guys know
> 
> 
> 
> On Thu, 3 Mar 2005 16:42:10 +0530, jayachandra <ja...@gmail.com> wrote:
>> Hi Axis2 developers,
>> Even I too am facing same problem. And, this appears like a bug to me.
>> As per SOAP element names should be qualified, but that doesn't
>> necessarily mean prefixes should exist. A default namespace element
>> may just be qualified with a null prefix. This should be fixed at the
>> earliest, or else interop is going to be a problem.
>> I am writing a CommonsHTTPTransporSender and am stuck in creating a response
>> response envelope out of the returned SOAP packet. In my case on the
>> server-side Axis1.2RC2 returned a SOAP packet (verified with tcpmon)
>> that has an element <EchoStringReturn>, this is being treated as
>> unqualifed and OM (AXIOM) is failing to (de)serialize it.
>> 
>> Thank you,
>> Jayachandra
>> 
> 
> 
> -- 
> Ajith Ranabahu
>

Re: [Axis2] OMElementImpl question

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
Ajith Ranabahu wrote:

>Hi there,
>I suppose what you meant by the null prefix is the default namespace
>declaration.
>have a look at the following XML's and tell me if I have understood
>the problem correctly
>
>xml fragment 1
>
><a xmlns="myns">
> <b/>
></a>
>
>in this case element b belongs to the namespace "myns" even though its
>is not prefixed. I believe this is the null prefix you were refering
>to. OM should support this behavior.
>
>xml fragment 2
>
><p:a xmlns:p="myns">
> <b/>
></p:a>
>
>in this case the namespace is prefixed and since b is not prefixed it
>is not namespace qualified. 
>
AFAIR actually it is in default namespace - read "Namespaces in XML" spec

http://www.w3.org/TR/REC-xml-names/#defaulting

in particular handling '' as namespace name is tricky - only xmlns='' is 
ever allowed (xmls:ns='' is invalid)

BTW: all those problems should be detected by parser and serializer 
(when you try to serialize OM doc)

alek

>So OM will spit out an error message
>saying the elements are not ns qualified.
>
>I believe that case 1 should work. if it's not it's definitely a bug.
>i will run a test case and let you guys know
>
>
>
>On Thu, 3 Mar 2005 16:42:10 +0530, jayachandra <ja...@gmail.com> wrote:
>  
>
>>Hi Axis2 developers,
>>Even I too am facing same problem. And, this appears like a bug to me.
>>As per SOAP element names should be qualified, but that doesn't
>>necessarily mean prefixes should exist. A default namespace element
>>may just be qualified with a null prefix. This should be fixed at the
>>earliest, or else interop is going to be a problem.
>>I am writing a CommonsHTTPTransporSender and am stuck in creating a response
>>response envelope out of the returned SOAP packet. In my case on the
>>server-side Axis1.2RC2 returned a SOAP packet (verified with tcpmon)
>>that has an element <EchoStringReturn>, this is being treated as
>>unqualifed and OM (AXIOM) is failing to (de)serialize it.
>>
>>Thank you,
>>Jayachandra
>>
>>    
>>
>
>
>  
>


-- 
The best way to predict the future is to invent it - Alan Kay


Re: [Axis2] OMElementImpl question

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi there,
I suppose what you meant by the null prefix is the default namespace
declaration.
have a look at the following XML's and tell me if I have understood
the problem correctly

xml fragment 1

<a xmlns="myns">
 <b/>
</a>

in this case element b belongs to the namespace "myns" even though its
is not prefixed. I believe this is the null prefix you were refering
to. OM should support this behavior.

xml fragment 2

<p:a xmlns:p="myns">
 <b/>
</p:a>

in this case the namespace is prefixed and since b is not prefixed it
is not namespace qualified. So OM will spit out an error message
saying the elements are not ns qualified.

I believe that case 1 should work. if it's not it's definitely a bug.
i will run a test case and let you guys know



On Thu, 3 Mar 2005 16:42:10 +0530, jayachandra <ja...@gmail.com> wrote:
> Hi Axis2 developers,
> Even I too am facing same problem. And, this appears like a bug to me.
> As per SOAP element names should be qualified, but that doesn't
> necessarily mean prefixes should exist. A default namespace element
> may just be qualified with a null prefix. This should be fixed at the
> earliest, or else interop is going to be a problem.
> I am writing a CommonsHTTPTransporSender and am stuck in creating a response
> response envelope out of the returned SOAP packet. In my case on the
> server-side Axis1.2RC2 returned a SOAP packet (verified with tcpmon)
> that has an element <EchoStringReturn>, this is being treated as
> unqualifed and OM (AXIOM) is failing to (de)serialize it.
> 
> Thank you,
> Jayachandra
> 


-- 
Ajith Ranabahu

Re: [Axis2] OMElementImpl question

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
jayachandra wrote:

>Hi Axis2 developers,
>Even I too am facing same problem. And, this appears like a bug to me. 
>As per SOAP element names should be qualified, but that doesn't
>necessarily mean prefixes should exist. A default namespace element
>may just be qualified with a null prefix. 
>
i do not think so (null?). instead all messages by default are in empty 
'' default namespace until xmlns='...' happens.

alek

>This should be fixed at the
>earliest, or else interop is going to be a problem.
>I am writing a CommonsHTTPTransporSender and am stuck in creating a response
>response envelope out of the returned SOAP packet. In my case on the
>server-side Axis1.2RC2 returned a SOAP packet (verified with tcpmon)
>that has an element <EchoStringReturn>, this is being treated as
>unqualifed and OM (AXIOM) is failing to (de)serialize it.
>
>Thank you,
>Jayachandra
>
>On Thu, 3 Mar 2005 19:46:14 +0900, Jongjin Choi <gu...@hotmail.com> wrote:
>  
>
>>Hi.
>>
>>The Aixom doest not seem to serialize soap message which has an unqualified soap body element.
>>
>>For example,
>> <soapenv:Body>
>>   <ns1:getBalance xmlns:ns1=http://localhost:8081/axis/services/BankPort/>
>>      <accountNo href="#id0"/>
>>   </ns1:getBalacne>
>> </soapenv:Body>
>>
>>The following exception occurs when serializing.
>>
>>org.apache.axis.om.OMException: Non namespace qualified elements are not allowed
>>at org.apache.axis.om.impl.llom.OMElementImpl.serializeStartpart(OMElementImpl.java:681)
>>at org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:723)
>>at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632)
>>at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
>>at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:638)
>>at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
>>at org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:726)
>>at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632)
>>at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
>>at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:638)
>>at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
>>at org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:726)
>>at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632)
>>
>>But the OMElement for <accountNo> element is built and the localname and namespace's value are set.
>>
>>For example,
>>
>>Envelope envelope = (SOAPEnvelope)builder.getDocumentElement();
>>SOAPBody sb = envelope.getBody();
>>OMElement e1 = sb.getFirstElement();    // <ns1:getBalance>
>>OMElement e2 = e1.getFirstElement();    // <accountNo>
>>OMNamespace ns = e2.getNamespace();
>>
>>The values of localName and namespace of OMElment e2 are :
>>
>>e2.getLocalName() = accountNo
>>e2.getNamespaceName() = null;
>>ns.getName() = http://localhost:8081/axis/services/BankPort
>>ns.getPrefix() = ns1
>>
>>The questions are:
>>1. Why OMElement throws exception when serializing namespace-unqualified element?
>>2. The unqualifed element's OMElement is built but the OMNamespace for this OMElement looks invalid.
>> In this case, I think the values should be :
>>     ns.getName() = "" or null
>>     ns.getPrefix() = "" or null
>> Is this right or am I miss something in OMElement?
>>
>>Thanks.
>>
>>/Jongjin
>>
>>
>>    
>>
>
>
>  
>


-- 
The best way to predict the future is to invent it - Alan Kay


Re: [Axis2] OMElementImpl question

Posted by jayachandra <ja...@gmail.com>.
Hi Axis2 developers,
Even I too am facing same problem. And, this appears like a bug to me. 
As per SOAP element names should be qualified, but that doesn't
necessarily mean prefixes should exist. A default namespace element
may just be qualified with a null prefix. This should be fixed at the
earliest, or else interop is going to be a problem.
I am writing a CommonsHTTPTransporSender and am stuck in creating a response
response envelope out of the returned SOAP packet. In my case on the
server-side Axis1.2RC2 returned a SOAP packet (verified with tcpmon)
that has an element <EchoStringReturn>, this is being treated as
unqualifed and OM (AXIOM) is failing to (de)serialize it.

Thank you,
Jayachandra

On Thu, 3 Mar 2005 19:46:14 +0900, Jongjin Choi <gu...@hotmail.com> wrote:
> Hi.
> 
> The Aixom doest not seem to serialize soap message which has an unqualified soap body element.
> 
> For example,
>  <soapenv:Body>
>    <ns1:getBalance xmlns:ns1=http://localhost:8081/axis/services/BankPort/>
>       <accountNo href="#id0"/>
>    </ns1:getBalacne>
>  </soapenv:Body>
> 
> The following exception occurs when serializing.
> 
> org.apache.axis.om.OMException: Non namespace qualified elements are not allowed
> at org.apache.axis.om.impl.llom.OMElementImpl.serializeStartpart(OMElementImpl.java:681)
> at org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:723)
> at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632)
> at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
> at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:638)
> at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
> at org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:726)
> at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632)
> at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
> at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:638)
> at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
> at org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:726)
> at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632)
> 
> But the OMElement for <accountNo> element is built and the localname and namespace's value are set.
> 
> For example,
> 
> Envelope envelope = (SOAPEnvelope)builder.getDocumentElement();
> SOAPBody sb = envelope.getBody();
> OMElement e1 = sb.getFirstElement();    // <ns1:getBalance>
> OMElement e2 = e1.getFirstElement();    // <accountNo>
> OMNamespace ns = e2.getNamespace();
> 
> The values of localName and namespace of OMElment e2 are :
> 
> e2.getLocalName() = accountNo
> e2.getNamespaceName() = null;
> ns.getName() = http://localhost:8081/axis/services/BankPort
> ns.getPrefix() = ns1
> 
> The questions are:
> 1. Why OMElement throws exception when serializing namespace-unqualified element?
> 2. The unqualifed element's OMElement is built but the OMNamespace for this OMElement looks invalid.
>  In this case, I think the values should be :
>      ns.getName() = "" or null
>      ns.getPrefix() = "" or null
>  Is this right or am I miss something in OMElement?
> 
> Thanks.
> 
> /Jongjin
> 
> 


-- 
-- Jaya

Re: [Axis2] OMElementImpl question

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi Jongjin,
Yes, OM throws errors when SOAP messages violate the SOAP spec. The
reason simply is that OM is meant to be a SOAP specific object model.
So SOAP messages that are not qualified will throw errors :) We are
thinking of extending OM as a generic XML object model but it's still
in the drawing boards.

Well you are right. I have to run this XML through Om to see whether
this is recreatable but just by looking at the code I understand that
the variable ns (the whole namspace object) should be null.



On Thu, 3 Mar 2005 19:46:14 +0900, Jongjin Choi <gu...@hotmail.com> wrote:
> Hi.
> 
> The Aixom doest not seem to serialize soap message which has an unqualified soap body element.
> 
> For example,
>  <soapenv:Body>
>    <ns1:getBalance xmlns:ns1=http://localhost:8081/axis/services/BankPort/>
>       <accountNo href="#id0"/>
>    </ns1:getBalacne>
>  </soapenv:Body>
> 
> The following exception occurs when serializing.
> 
> org.apache.axis.om.OMException: Non namespace qualified elements are not allowed
> at org.apache.axis.om.impl.llom.OMElementImpl.serializeStartpart(OMElementImpl.java:681)
> at org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:723)
> at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632)
> at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
> at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:638)
> at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
> at org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:726)
> at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632)
> at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
> at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:638)
> at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127)
> at org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:726)
> at org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632)
> 
> But the OMElement for <accountNo> element is built and the localname and namespace's value are set.
> 
> For example,
> 
> Envelope envelope = (SOAPEnvelope)builder.getDocumentElement();
> SOAPBody sb = envelope.getBody();
> OMElement e1 = sb.getFirstElement();    // <ns1:getBalance>
> OMElement e2 = e1.getFirstElement();    // <accountNo>
> OMNamespace ns = e2.getNamespace();
> 
> The values of localName and namespace of OMElment e2 are :
> 
> e2.getLocalName() = accountNo
> e2.getNamespaceName() = null;
> ns.getName() = http://localhost:8081/axis/services/BankPort
> ns.getPrefix() = ns1
> 
> The questions are:
> 1. Why OMElement throws exception when serializing namespace-unqualified element?
> 2. The unqualifed element's OMElement is built but the OMNamespace for this OMElement looks invalid.
>  In this case, I think the values should be :
>      ns.getName() = "" or null
>      ns.getPrefix() = "" or null
>  Is this right or am I miss something in OMElement?
> 
> Thanks.
> 
> /Jongjin
> 
> 


-- 
Ajith Ranabahu