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 "Robert W. McKitrick Jr. (JIRA)" <ax...@ws.apache.org> on 2004/11/06 23:30:32 UTC

[jira] Created: (AXIS-1652) Undefined namespace generated from Java2WSDL for java.util.Collection

Undefined namespace generated from Java2WSDL for java.util.Collection
---------------------------------------------------------------------

         Key: AXIS-1652
         URL: http://nagoya.apache.org/jira/browse/AXIS-1652
     Project: Axis
        Type: Bug
    Versions: 1.2RC1    
 Environment: Windows, JDK-1.4.2_05, J2EE-1.3.1

    Reporter: Robert W. McKitrick Jr.
    Priority: Blocker


Given the following service:

public class CPersonService implements IPersonService
{
    public CPersonInfo[] retrievePersons(String l_State)
    {
      // real code goes here
      CPersonInfo[] l_Persons = new CPersonInfo[5];
      return l_Persons;
    }
}

If the class CPersonInfo has an attribute of type java.util.Collection, the .wsdl file generated using Java2WSDL will have an undefined namespace in it.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS-1652) Undefined namespace generated from Java2WSDL for java.util.Collection

Posted by "Robert W. McKitrick Jr. (JIRA)" <ax...@ws.apache.org>.
     [ http://nagoya.apache.org/jira/browse/AXIS-1652?page=history ]

Robert W. McKitrick Jr. updated AXIS-1652:
------------------------------------------

    Attachment: AxisUndefinedNamespaceError.zip

Here is an example of the service the value types and the generated .wsdl file in the build directory.
You can delete the build and classes directories, set the ..._HOME paths in in the build.bat file and
regenerate the .wsdl file (on MS Windows).

> Undefined namespace generated from Java2WSDL for java.util.Collection
> ---------------------------------------------------------------------
>
>          Key: AXIS-1652
>          URL: http://nagoya.apache.org/jira/browse/AXIS-1652
>      Project: Axis
>         Type: Bug
>     Versions: 1.2RC1
>  Environment: Windows, JDK-1.4.2_05, J2EE-1.3.1
>     Reporter: Robert W. McKitrick Jr.
>     Priority: Blocker
>  Attachments: AxisUndefinedNamespaceError.zip
>
> Given the following service:
> public class CPersonService implements IPersonService
> {
>     public CPersonInfo[] retrievePersons(String l_State)
>     {
>       // real code goes here
>       CPersonInfo[] l_Persons = new CPersonInfo[5];
>       return l_Persons;
>     }
> }
> If the class CPersonInfo has an attribute of type java.util.Collection, the .wsdl file generated using Java2WSDL will have an undefined namespace in it.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Re: org.apache.axis.message.MessageElement question

Posted by Davanum Srinivas <da...@gmail.com>.
Shantanu,

See http://cvs.apache.org/viewcvs.cgi/*checkout*/ws-axis/java/test/saaj/TestText.java.
Works for me with latest CVS.

-- dims


On Fri, 12 Nov 2004 18:13:18 -0800 (PST), Shantanu Sen <ss...@pacbell.net> wrote:
> I was in the process of doing that, but ran into this
> issue. Wondering if you could point to any problems
> related with the test code or is this another bug.
> 
> Compile the ClassCasTest.java and run it as
> 
> java ClassCastTest book2.xml.
> 
> It throws the following exception:
> 
> [57 bug-fix]> java ClassCastTest book2.xml
> Exception in thread "main"
> java.lang.IllegalArgumentException: invalid QName loc
> al part
>         at
> javax.xml.namespace.QName.<init>(QName.java:75)
>         at
> javax.xml.namespace.QName.<init>(QName.java:60)
>         at
> org.apache.axis.message.PrefixedQName.<init>(PrefixedQName.java:30)
>         at
> org.apache.axis.message.MessageElement.copyNode(MessageElement.java:2
> 044)
>         at
> org.apache.axis.message.MessageElement.copyNode(MessageElement.java:1
> 997)
>         at
> org.apache.axis.message.MessageElement.<init>(MessageElement.java:195
> )
>         at
> org.apache.axis.message.SOAPBodyElement.<init>(SOAPBodyElement.java:7
> 0)
>         at
> org.apache.axis.message.SOAPBody.addDocument(SOAPBody.java:220)
>         at ClassCastTest.main(ClassCastTest.java:36)
> 
> I was hoping to add this document to the SOAP Body and
> then use a parser to get the nodes and try to
> reproduce the original problem as a standalone test
> case...
> 
> 
> 
> Thanks,
> Shantanu
> 
> --- Davanum Srinivas <da...@gmail.com> wrote:
> 
> > Shantanu,
> >
> > Please open up a bug report with the small test case
> > that we can use
> > to validate the problem and fix it (hopefully before
> > we go final)
> >
> > thanks,
> > dims
> >
> >
> > On Thu, 11 Nov 2004 11:15:47 -0800 (PST), Shantanu
> > Sen <ss...@pacbell.net> wrote:
> > >
> > > No I am not creating it by hand. I am using the
> > SAAJ APis. Here is the code
> > > snippet:
> > >
> > > ---------
> > >
> > > // create a SOAPMessage - this contains an empty
> > SOAP Envelope by
> > > // default. We need to add the content of the
> > payload - which in this case
> > > // is a simple xml fragment - to the SOAP envelope
> > > MessageFactory soapMsgFactory =
> > MessageFactory.newInstance();
> > > SOAPMessage soapMsg =
> > soapMsgFactory.createMessage();
> > >
> > > SOAPPart soapPart = soapMsg.getSOAPPart();
> > > SOAPEnvelope soapEnv = soapPart.getEnvelope();
> > > SOAPBody soapBody = soapEnv.getBody();
> > >
> > >
> > > // payload.getDocument returns a
> > org.w3c.dom.Document object
> > >  if (payload != null && payload.length > 0 &&
> > payload[0] != null) {
> > >
> > soapBody.addDocument(payload[0].getDocument());
> > >  }
> > >
> > > //soapMsg.writeTo(System.out);
> > >
> > > ---------
> > >
> > > After the above code executes, we use a third
> > party XML document reader to
> > > parse the SOAPPart, which is a
> > org.w3c.dom.Document object. In the course of
> > > parsing this the parser checks the nodetype of
> > each Node which is a
> > > MessageElement and if the nodetype returns
> > TEXT_NODE, it casts the node to
> > > org.w3c.dom.Text. This will throw a
> > ClassCastException since a
> > > MessageElement does not implement Text.
> > >
> > > Now note this: if I uncomment the soapMsg.writeTo
> > line, above, it works.
> > > This is because the writeTo in turn does a save,
> > which stores the
> > > SOAPPart.currentMessage as FORM_OPTIMIZED. This
> > results in a Deserializer to
> > > parse the content and in this course a RPCElement
> > is created (not a
> > > MessageElement). Thus there is no errors when the
> > third party parser parses
> > > the SOAP Message.
> > >
> > > But if the soapMsg.writeTo is commented out, then
> > the
> > > SOAPPart.currentMessages is stored as
> > FORM_SOAPENVELOPE - which uses
> > > MessageElement.
> > >
> > > Any ideas on this or pointers how we can work
> > around this (without using
> > > soapMsg.writeTo). Basically I feel that
> > MessageElement has a bug, but
> > > RPCElement has not, and if we can use SAAJ APIs to
> > generate RPCElement
> > > instead of MessageElement, we'll be ok. Is there a
> > switch somewhere that
> > > allows us to do that?
> > >
> > > Thanks,
> > >
> > > Shantanu
> > >
> > >
> > >
> > > Davanum Srinivas <da...@gmail.com> wrote:
> > >
> > >
> > >
> > >
> > > Question: Are u creating the MessageElement by
> > hand or is Axis
> > > generating this one (based on say the SAAJ API's
> > for you)?
> > >
> > > Thanks,
> > > dims
> > >
> > > On Thu, 11 Nov 2004 00:53:57 -0800 (PST), Shantanu
> > Sen wrote:
> > > > The org.apache.axis.message.MessageElement
> > extends
> > > > NodeImpl as shown below
> > > >
> > > > ....
> > > > public class MessageElement extends NodeImpl
> > > > implements SOAPElement, Serializable,
> > > > org.w3c.dom.NodeList, Cloneable
> > > > ....
> > > >
> > > > NodelImpl has the method getNodeType that
> > returns
> > > > TEXT_NODE, if the node value has text:
> > > >
> > > > ------
> > > > public short getNodeType() {
> > > > if (this.textRep != null) {
> > > > if (textRep instanceof Comment) {
> > > > return COMMENT_NODE;
> > > > } else if (textRep instanceof CDATASection) {
> > > > return CDATA_SECTION_NODE;
> > > > } else {
> > > > return TEXT_NODE;
> > > > }
> > > > -------
> > > >
> > > > This means that any client that calls
> > getNodeType on a
> > > > MessageElement and obtains a TEXT_NODE as return
> > may
> > > > cast the MessageElement to org.w3c.dom.Text. But
> > this
> > > > will throw a ClassCastException since
> > MessageElement
> > > > does not implement this interface.
> > > >
> > > > Any comments on this? Is'nt it mandatory for the
> > > > specific node that returns a TEXT_NODE type
> > implement
> > > > the dom.Text interface?
> > > >
> > > > Thanks for any help.
> > > > Shantanu Sen
> > > >
> > >
> > >
> > > --
> > > Davanum Srinivas -
> > http://webservices.apache.org/~dims/
> > >
> >
> >
> > --
> > Davanum Srinivas -
> > http://webservices.apache.org/~dims/
> >
> 
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/

Re: org.apache.axis.message.MessageElement question

Posted by Shantanu Sen <ss...@pacbell.net>.
I was in the process of doing that, but ran into this
issue. Wondering if you could point to any problems
related with the test code or is this another bug.

Compile the ClassCasTest.java and run it as 

java ClassCastTest book2.xml. 

It throws the following exception:

[57 bug-fix]> java ClassCastTest book2.xml
Exception in thread "main"
java.lang.IllegalArgumentException: invalid QName loc
al part
        at
javax.xml.namespace.QName.<init>(QName.java:75)
        at
javax.xml.namespace.QName.<init>(QName.java:60)
        at
org.apache.axis.message.PrefixedQName.<init>(PrefixedQName.java:30)
        at
org.apache.axis.message.MessageElement.copyNode(MessageElement.java:2
044)
        at
org.apache.axis.message.MessageElement.copyNode(MessageElement.java:1
997)
        at
org.apache.axis.message.MessageElement.<init>(MessageElement.java:195
)
        at
org.apache.axis.message.SOAPBodyElement.<init>(SOAPBodyElement.java:7
0)
        at
org.apache.axis.message.SOAPBody.addDocument(SOAPBody.java:220)
        at ClassCastTest.main(ClassCastTest.java:36)


I was hoping to add this document to the SOAP Body and
then use a parser to get the nodes and try to
reproduce the original problem as a standalone test
case...

Thanks,
Shantanu

--- Davanum Srinivas <da...@gmail.com> wrote:

> Shantanu,
> 
> Please open up a bug report with the small test case
> that we can use
> to validate the problem and fix it (hopefully before
> we go final)
> 
> thanks,
> dims
> 
> 
> On Thu, 11 Nov 2004 11:15:47 -0800 (PST), Shantanu
> Sen <ss...@pacbell.net> wrote:
> > 
> > No I am not creating it by hand. I am using the
> SAAJ APis. Here is the code
> > snippet: 
> >   
> > --------- 
> > 
> > // create a SOAPMessage - this contains an empty
> SOAP Envelope by
> > // default. We need to add the content of the
> payload - which in this case
> > // is a simple xml fragment - to the SOAP envelope
> > MessageFactory soapMsgFactory =
> MessageFactory.newInstance();
> > SOAPMessage soapMsg =
> soapMsgFactory.createMessage();    
> >     
> > SOAPPart soapPart = soapMsg.getSOAPPart();
> > SOAPEnvelope soapEnv = soapPart.getEnvelope();
> > SOAPBody soapBody = soapEnv.getBody();
> >   
> > 
> > // payload.getDocument returns a
> org.w3c.dom.Document object   
> >  if (payload != null && payload.length > 0 &&
> payload[0] != null) {
> >        
> soapBody.addDocument(payload[0].getDocument());
> >  } 
> > 
> > //soapMsg.writeTo(System.out); 
> > 
> > --------- 
> > 
> > After the above code executes, we use a third
> party XML document reader to
> > parse the SOAPPart, which is a
> org.w3c.dom.Document object. In the course of
> > parsing this the parser checks the nodetype of
> each Node which is a
> > MessageElement and if the nodetype returns
> TEXT_NODE, it casts the node to
> > org.w3c.dom.Text. This will throw a
> ClassCastException since a
> > MessageElement does not implement Text. 
> > 
> > Now note this: if I uncomment the soapMsg.writeTo
> line, above, it works.
> > This is because the writeTo in turn does a save,
> which stores the
> > SOAPPart.currentMessage as FORM_OPTIMIZED. This
> results in a Deserializer to
> > parse the content and in this course a RPCElement
> is created (not a
> > MessageElement). Thus there is no errors when the
> third party parser parses
> > the SOAP Message. 
> > 
> > But if the soapMsg.writeTo is commented out, then
> the
> > SOAPPart.currentMessages is stored as
> FORM_SOAPENVELOPE - which uses
> > MessageElement. 
> > 
> > Any ideas on this or pointers how we can work
> around this (without using
> > soapMsg.writeTo). Basically I feel that
> MessageElement has a bug, but
> > RPCElement has not, and if we can use SAAJ APIs to
> generate RPCElement
> > instead of MessageElement, we'll be ok. Is there a
> switch somewhere that
> > allows us to do that? 
> > 
> > Thanks, 
> > 
> > Shantanu
> > 
> > 
> > 
> > Davanum Srinivas <da...@gmail.com> wrote:
> > 
> > 
> > 
> >  
> > Question: Are u creating the MessageElement by
> hand or is Axis
> > generating this one (based on say the SAAJ API's
> for you)?
> > 
> > Thanks,
> > dims
> > 
> > On Thu, 11 Nov 2004 00:53:57 -0800 (PST), Shantanu
> Sen wrote:
> > > The org.apache.axis.message.MessageElement
> extends
> > > NodeImpl as shown below
> > > 
> > > ....
> > > public class MessageElement extends NodeImpl
> > > implements SOAPElement, Serializable,
> > > org.w3c.dom.NodeList, Cloneable
> > > ....
> > > 
> > > NodelImpl has the method getNodeType that
> returns
> > > TEXT_NODE, if the node value has text:
> > > 
> > > ------
> > > public short getNodeType() {
> > > if (this.textRep != null) {
> > > if (textRep instanceof Comment) {
> > > return COMMENT_NODE;
> > > } else if (textRep instanceof CDATASection) {
> > > return CDATA_SECTION_NODE;
> > > } else {
> > > return TEXT_NODE;
> > > }
> > > -------
> > > 
> > > This means that any client that calls
> getNodeType on a
> > > MessageElement and obtains a TEXT_NODE as return
> may
> > > cast the MessageElement to org.w3c.dom.Text. But
> this
> > > will throw a ClassCastException since
> MessageElement
> > > does not implement this interface.
> > > 
> > > Any comments on this? Is'nt it mandatory for the
> > > specific node that returns a TEXT_NODE type
> implement
> > > the dom.Text interface?
> > > 
> > > Thanks for any help.
> > > Shantanu Sen
> > > 
> > 
> > 
> > -- 
> > Davanum Srinivas -
> http://webservices.apache.org/~dims/
> >  
> 
> 
> -- 
> Davanum Srinivas -
> http://webservices.apache.org/~dims/
> 

Re: org.apache.axis.message.MessageElement question

Posted by Davanum Srinivas <da...@gmail.com>.
Shantanu,

Please open up a bug report with the small test case that we can use
to validate the problem and fix it (hopefully before we go final)

thanks,
dims


On Thu, 11 Nov 2004 11:15:47 -0800 (PST), Shantanu Sen <ss...@pacbell.net> wrote:
> 
> No I am not creating it by hand. I am using the SAAJ APis. Here is the code
> snippet: 
>   
> --------- 
> 
> // create a SOAPMessage - this contains an empty SOAP Envelope by
> // default. We need to add the content of the payload - which in this case
> // is a simple xml fragment - to the SOAP envelope
> MessageFactory soapMsgFactory = MessageFactory.newInstance();
> SOAPMessage soapMsg = soapMsgFactory.createMessage();    
>     
> SOAPPart soapPart = soapMsg.getSOAPPart();
> SOAPEnvelope soapEnv = soapPart.getEnvelope();
> SOAPBody soapBody = soapEnv.getBody();
>   
> 
> // payload.getDocument returns a org.w3c.dom.Document object   
>  if (payload != null && payload.length > 0 && payload[0] != null) {
>         soapBody.addDocument(payload[0].getDocument());
>  } 
> 
> //soapMsg.writeTo(System.out); 
> 
> --------- 
> 
> After the above code executes, we use a third party XML document reader to
> parse the SOAPPart, which is a org.w3c.dom.Document object. In the course of
> parsing this the parser checks the nodetype of each Node which is a
> MessageElement and if the nodetype returns TEXT_NODE, it casts the node to
> org.w3c.dom.Text. This will throw a ClassCastException since a
> MessageElement does not implement Text. 
> 
> Now note this: if I uncomment the soapMsg.writeTo line, above, it works.
> This is because the writeTo in turn does a save, which stores the
> SOAPPart.currentMessage as FORM_OPTIMIZED. This results in a Deserializer to
> parse the content and in this course a RPCElement is created (not a
> MessageElement). Thus there is no errors when the third party parser parses
> the SOAP Message. 
> 
> But if the soapMsg.writeTo is commented out, then the
> SOAPPart.currentMessages is stored as FORM_SOAPENVELOPE - which uses
> MessageElement. 
> 
> Any ideas on this or pointers how we can work around this (without using
> soapMsg.writeTo). Basically I feel that MessageElement has a bug, but
> RPCElement has not, and if we can use SAAJ APIs to generate RPCElement
> instead of MessageElement, we'll be ok. Is there a switch somewhere that
> allows us to do that? 
> 
> Thanks, 
> 
> Shantanu
> 
> 
> 
> Davanum Srinivas <da...@gmail.com> wrote:
> 
> 
> 
>  
> Question: Are u creating the MessageElement by hand or is Axis
> generating this one (based on say the SAAJ API's for you)?
> 
> Thanks,
> dims
> 
> On Thu, 11 Nov 2004 00:53:57 -0800 (PST), Shantanu Sen wrote:
> > The org.apache.axis.message.MessageElement extends
> > NodeImpl as shown below
> > 
> > ....
> > public class MessageElement extends NodeImpl
> > implements SOAPElement, Serializable,
> > org.w3c.dom.NodeList, Cloneable
> > ....
> > 
> > NodelImpl has the method getNodeType that returns
> > TEXT_NODE, if the node value has text:
> > 
> > ------
> > public short getNodeType() {
> > if (this.textRep != null) {
> > if (textRep instanceof Comment) {
> > return COMMENT_NODE;
> > } else if (textRep instanceof CDATASection) {
> > return CDATA_SECTION_NODE;
> > } else {
> > return TEXT_NODE;
> > }
> > -------
> > 
> > This means that any client that calls getNodeType on a
> > MessageElement and obtains a TEXT_NODE as return may
> > cast the MessageElement to org.w3c.dom.Text. But this
> > will throw a ClassCastException since MessageElement
> > does not implement this interface.
> > 
> > Any comments on this? Is'nt it mandatory for the
> > specific node that returns a TEXT_NODE type implement
> > the dom.Text interface?
> > 
> > Thanks for any help.
> > Shantanu Sen
> > 
> 
> 
> -- 
> Davanum Srinivas - http://webservices.apache.org/~dims/
>  


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/

Re: org.apache.axis.message.MessageElement question

Posted by Shantanu Sen <ss...@pacbell.net>.
No I am not creating it by hand. I am using the SAAJ APis. Here is the code snippet:
 
---------

// create a SOAPMessage - this contains an empty SOAP Envelope by
// default. We need to add the content of the payload - which in this case
// is a simple xml fragment - to the SOAP envelope
MessageFactory soapMsgFactory = MessageFactory.newInstance();
SOAPMessage soapMsg = soapMsgFactory.createMessage();    
    
SOAPPart soapPart = soapMsg.getSOAPPart();
SOAPEnvelope soapEnv = soapPart.getEnvelope();
SOAPBody soapBody = soapEnv.getBody();
 

// payload.getDocument returns a org.w3c.dom.Document object   
 if (payload != null && payload.length > 0 && payload[0] != null) {
        soapBody.addDocument(payload[0].getDocument());
 } 

//soapMsg.writeTo(System.out);

---------

After the above code executes, we use a third party XML document reader to parse the SOAPPart, which is a org.w3c.dom.Document object. In the course of parsing this the parser checks the nodetype of each Node which is a MessageElement and if the nodetype returns TEXT_NODE, it casts the node to org.w3c.dom.Text. This will throw a ClassCastException since a MessageElement does not implement Text. 

Now note this: if I uncomment the soapMsg.writeTo line, above, it works. This is because the writeTo in turn does a save, which stores the SOAPPart.currentMessage as FORM_OPTIMIZED. This results in a Deserializer to parse the content and in this course a RPCElement is created (not a MessageElement). Thus there is no errors when the third party parser parses the SOAP Message.

But if the soapMsg.writeTo is commented out, then the SOAPPart.currentMessages is stored as FORM_SOAPENVELOPE - which uses MessageElement.

Any ideas on this or pointers how we can work around this (without using soapMsg.writeTo). Basically I feel that MessageElement has a bug, but RPCElement has not, and if we can use SAAJ APIs to generate RPCElement instead of MessageElement, we'll be ok. Is there a switch somewhere that allows us to do that?

Thanks,

Shantanu

Davanum Srinivas <da...@gmail.com> wrote:
Question: Are u creating the MessageElement by hand or is Axis
generating this one (based on say the SAAJ API's for you)?

Thanks,
dims

On Thu, 11 Nov 2004 00:53:57 -0800 (PST), Shantanu Sen wrote:
> The org.apache.axis.message.MessageElement extends
> NodeImpl as shown below
> 
> ....
> public class MessageElement extends NodeImpl
> implements SOAPElement, Serializable,
> org.w3c.dom.NodeList, Cloneable
> ....
> 
> NodelImpl has the method getNodeType that returns
> TEXT_NODE, if the node value has text:
> 
> ------
> public short getNodeType() {
> if (this.textRep != null) {
> if (textRep instanceof Comment) {
> return COMMENT_NODE;
> } else if (textRep instanceof CDATASection) {
> return CDATA_SECTION_NODE;
> } else {
> return TEXT_NODE;
> }
> -------
> 
> This means that any client that calls getNodeType on a
> MessageElement and obtains a TEXT_NODE as return may
> cast the MessageElement to org.w3c.dom.Text. But this
> will throw a ClassCastException since MessageElement
> does not implement this interface.
> 
> Any comments on this? Is'nt it mandatory for the
> specific node that returns a TEXT_NODE type implement
> the dom.Text interface?
> 
> Thanks for any help.
> Shantanu Sen
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/

Re: org.apache.axis.message.MessageElement question

Posted by Davanum Srinivas <da...@gmail.com>.
Question: Are u creating the MessageElement by hand or is Axis
generating this one (based on say the SAAJ API's for you)?

Thanks,
dims

On Thu, 11 Nov 2004 00:53:57 -0800 (PST), Shantanu Sen <ss...@pacbell.net> wrote:
> The org.apache.axis.message.MessageElement extends
> NodeImpl as shown below
> 
> ....
> public class MessageElement extends NodeImpl
> implements SOAPElement, Serializable,
> org.w3c.dom.NodeList,  Cloneable
> ....
> 
> NodelImpl has the method getNodeType that returns
> TEXT_NODE, if the node value has text:
> 
> ------
> public short getNodeType() {
>   if (this.textRep != null) {
>        if (textRep instanceof Comment) {
>            return COMMENT_NODE;
>        } else if (textRep instanceof CDATASection) {
>            return CDATA_SECTION_NODE;
>        } else {
>           return TEXT_NODE;
>       }
> -------
> 
> This means that any client that calls getNodeType on a
> MessageElement and obtains a TEXT_NODE as return may
> cast the MessageElement to  org.w3c.dom.Text. But this
> will throw a ClassCastException since MessageElement
> does not implement this interface.
> 
> Any comments on this? Is'nt it mandatory for the
> specific node that returns a TEXT_NODE type implement
> the dom.Text interface?
> 
> Thanks for any help.
> Shantanu Sen
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/

org.apache.axis.message.MessageElement question

Posted by Shantanu Sen <ss...@pacbell.net>.
The org.apache.axis.message.MessageElement extends
NodeImpl as shown below

....
public class MessageElement extends NodeImpl
implements SOAPElement, Serializable,
org.w3c.dom.NodeList,  Cloneable
....

NodelImpl has the method getNodeType that returns
TEXT_NODE, if the node value has text:

------
public short getNodeType() {
  if (this.textRep != null) {
       if (textRep instanceof Comment) {
           return COMMENT_NODE;
       } else if (textRep instanceof CDATASection) {
           return CDATA_SECTION_NODE;
       } else {
          return TEXT_NODE;
      }
-------

This means that any client that calls getNodeType on a
MessageElement and obtains a TEXT_NODE as return may
cast the MessageElement to  org.w3c.dom.Text. But this
will throw a ClassCastException since MessageElement
does not implement this interface.

Any comments on this? Is'nt it mandatory for the
specific node that returns a TEXT_NODE type implement
the dom.Text interface?

Thanks for any help.
Shantanu Sen

[jira] Commented: (AXIS-1652) Undefined namespace generated from Java2WSDL for java.util.Collection

Posted by "Venkat Reddy (JIRA)" <ax...@ws.apache.org>.
     [ http://nagoya.apache.org/jira/browse/AXIS-1652?page=comments#action_55304 ]
     
Venkat Reddy commented on AXIS-1652:
------------------------------------

May be you should use the option "-uENCODED" since we need to encode the Array type. With this option, the definitions with include a namespace for encoding, whose prefix will be used in the place where the undefined name space is used.

> Undefined namespace generated from Java2WSDL for java.util.Collection
> ---------------------------------------------------------------------
>
>          Key: AXIS-1652
>          URL: http://nagoya.apache.org/jira/browse/AXIS-1652
>      Project: Axis
>         Type: Bug
>     Versions: 1.2RC1
>  Environment: Windows, JDK-1.4.2_05, J2EE-1.3.1
>     Reporter: Robert W. McKitrick Jr.
>     Priority: Blocker
>  Attachments: AxisUndefinedNamespaceError.zip
>
> Given the following service:
> public class CPersonService implements IPersonService
> {
>     public CPersonInfo[] retrievePersons(String l_State)
>     {
>       // real code goes here
>       CPersonInfo[] l_Persons = new CPersonInfo[5];
>       return l_Persons;
>     }
> }
> If the class CPersonInfo has an attribute of type java.util.Collection, the .wsdl file generated using Java2WSDL will have an undefined namespace in it.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS-1652) Undefined namespace generated from Java2WSDL for java.util.Collection

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1652?page=history ]

Davanum Srinivas updated AXIS-1652:
-----------------------------------

    Priority: Major  (was: Blocker)

downgrading the bug.

> Undefined namespace generated from Java2WSDL for java.util.Collection
> ---------------------------------------------------------------------
>
>          Key: AXIS-1652
>          URL: http://issues.apache.org/jira/browse/AXIS-1652
>      Project: Axis
>         Type: Bug
>     Versions: 1.2RC1
>  Environment: Windows, JDK-1.4.2_05, J2EE-1.3.1
>     Reporter: Robert W. McKitrick Jr.
>  Attachments: AxisUndefinedNamespaceError.zip
>
> Given the following service:
> public class CPersonService implements IPersonService
> {
>     public CPersonInfo[] retrievePersons(String l_State)
>     {
>       // real code goes here
>       CPersonInfo[] l_Persons = new CPersonInfo[5];
>       return l_Persons;
>     }
> }
> If the class CPersonInfo has an attribute of type java.util.Collection, the .wsdl file generated using Java2WSDL will have an undefined namespace in it.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira