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 "Simon Fell (JIRA)" <ax...@ws.apache.org> on 2005/02/15 00:42:15 UTC

[jira] Created: (AXIS-1817) MessageElement.getValue doesn't do XML decoding

MessageElement.getValue doesn't do XML decoding
-----------------------------------------------

         Key: AXIS-1817
         URL: http://issues.apache.org/jira/browse/AXIS-1817
     Project: Axis
        Type: Bug
  Components: Serialization/Deserialization  
    Versions: 1.2RC2    
 Environment: XP / JDK 1.4.x / 
    Reporter: Simon Fell


This actually with the 1.2 RC3

If the WSDL contains a <any> element, this is mapped to a MessageElement [], in Axis 1.1 calling getValue on one of these MessageElement's would return the contents of the element post XML processing, in Axis 1.2 RC3 it seems to be returning the raw data, e.g. if the response element is
<elem>A&gt;B</elem>
In Axis 1.1, getValue() returns "A>B" but Axis 1.2 returns "A&gt;B"

There's a test service at http://soap.4s4c.com/dotnet/any.wsdl

here's some client code to call it.
		AnyServiceLocator loc = new AnyServiceLocator();
		Soap svc = loc.getSoap();
				
		QueryResult qr = svc.query("blah");
		
		for (int i =0; i < qr.getRecords().length; i++ ) {
			SObject s = qr.getRecords(i);
			MessageElement [] e= s.get_any();
			System.out.println("MessageElement array size is " + e.length);
			for (int j = 0; j < e.length; j++ ){
				System.out.print(" " + e[j].getValue());
			}
			System.out.println("");
		}




-- 
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


[jira] Commented: (AXIS-1817) MessageElement.getValue doesn't do XML decoding

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

Thanks Jongjin. I have tested for Axis-1817, and it seems fixed.

> MessageElement.getValue doesn't do XML decoding
> -----------------------------------------------
>
>          Key: AXIS-1817
>          URL: http://issues.apache.org/jira/browse/AXIS-1817
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC2
>  Environment: XP / JDK 1.4.x / 
>     Reporter: Simon Fell
>     Assignee: Venkat Reddy
>      Fix For: current (nightly)
>  Attachments: diff.txt
>
> This actually with the 1.2 RC3
> If the WSDL contains a <any> element, this is mapped to a MessageElement [], in Axis 1.1 calling getValue on one of these MessageElement's would return the contents of the element post XML processing, in Axis 1.2 RC3 it seems to be returning the raw data, e.g. if the response element is
> <elem>A&gt;B</elem>
> In Axis 1.1, getValue() returns "A>B" but Axis 1.2 returns "A&gt;B"
> There's a test service at http://soap.4s4c.com/dotnet/any.wsdl
> here's some client code to call it.
> 		AnyServiceLocator loc = new AnyServiceLocator();
> 		Soap svc = loc.getSoap();
> 				
> 		QueryResult qr = svc.query("blah");
> 		
> 		for (int i =0; i < qr.getRecords().length; i++ ) {
> 			SObject s = qr.getRecords(i);
> 			MessageElement [] e= s.get_any();
> 			System.out.println("MessageElement array size is " + e.length);
> 			for (int j = 0; j < e.length; j++ ){
> 				System.out.print(" " + e[j].getValue());
> 			}
> 			System.out.println("");
> 		}

-- 
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


[jira] Commented: (AXIS-1817) MessageElement.getValue doesn't do XML decoding

Posted by "Jongjin Choi (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1817?page=comments#action_59392 ]
     
Jongjin Choi commented on AXIS-1817:
------------------------------------

Hi, all.

The getValue()'s murk comes from rev.1.188 of MessageElement.
I think that rev.1.188 was right direction for performance
because it reduces unnecessary SAAJ -> DOM conversion and DOM serialization should be avoided as much as possible 
because SAAJ 1.2 is also a DOM.

As you pointed, I think the TextSerializationContext should not be used, too.

Besides this issue, also according to SAAJ, the value returned from Node.getValue() should be following in these cases:
  (from test.message.TestMessageElement#testGetNodeValue())

 1. <anElement xmlns:ns1=\"aNamespace\"><bElement>FooBar</bElement>Mixed</anElement>
   --> Mixed  (currently the test case checks if it is 'null', this is invalid test)

 2. <anElement xmlns:ns1=\"aNamespace\">Foo<bElement>FooBar</bElement>Mixed</anElement>
   --> Foo

For #1, we should find the first text node among the childrens. (not just the first node).
For #2, We should append text child when a child element starts.

Fixing getValueDOM() could solve #1, but I don't think DOM approach is desirable.

Thanks.


> MessageElement.getValue doesn't do XML decoding
> -----------------------------------------------
>
>          Key: AXIS-1817
>          URL: http://issues.apache.org/jira/browse/AXIS-1817
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC2
>  Environment: XP / JDK 1.4.x / 
>     Reporter: Simon Fell
>     Assignee: Venkat Reddy
>  Attachments: diff.txt
>
> This actually with the 1.2 RC3
> If the WSDL contains a <any> element, this is mapped to a MessageElement [], in Axis 1.1 calling getValue on one of these MessageElement's would return the contents of the element post XML processing, in Axis 1.2 RC3 it seems to be returning the raw data, e.g. if the response element is
> <elem>A&gt;B</elem>
> In Axis 1.1, getValue() returns "A>B" but Axis 1.2 returns "A&gt;B"
> There's a test service at http://soap.4s4c.com/dotnet/any.wsdl
> here's some client code to call it.
> 		AnyServiceLocator loc = new AnyServiceLocator();
> 		Soap svc = loc.getSoap();
> 				
> 		QueryResult qr = svc.query("blah");
> 		
> 		for (int i =0; i < qr.getRecords().length; i++ ) {
> 			SObject s = qr.getRecords(i);
> 			MessageElement [] e= s.get_any();
> 			System.out.println("MessageElement array size is " + e.length);
> 			for (int j = 0; j < e.length; j++ ){
> 				System.out.print(" " + e[j].getValue());
> 			}
> 			System.out.println("");
> 		}

-- 
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


[jira] Resolved: (AXIS-1817) MessageElement.getValue doesn't do XML decoding

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

     Resolution: Fixed
    Fix Version: current (nightly)

patch applied

> MessageElement.getValue doesn't do XML decoding
> -----------------------------------------------
>
>          Key: AXIS-1817
>          URL: http://issues.apache.org/jira/browse/AXIS-1817
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC2
>  Environment: XP / JDK 1.4.x / 
>     Reporter: Simon Fell
>     Assignee: Venkat Reddy
>      Fix For: current (nightly)
>  Attachments: diff.txt
>
> This actually with the 1.2 RC3
> If the WSDL contains a <any> element, this is mapped to a MessageElement [], in Axis 1.1 calling getValue on one of these MessageElement's would return the contents of the element post XML processing, in Axis 1.2 RC3 it seems to be returning the raw data, e.g. if the response element is
> <elem>A&gt;B</elem>
> In Axis 1.1, getValue() returns "A>B" but Axis 1.2 returns "A&gt;B"
> There's a test service at http://soap.4s4c.com/dotnet/any.wsdl
> here's some client code to call it.
> 		AnyServiceLocator loc = new AnyServiceLocator();
> 		Soap svc = loc.getSoap();
> 				
> 		QueryResult qr = svc.query("blah");
> 		
> 		for (int i =0; i < qr.getRecords().length; i++ ) {
> 			SObject s = qr.getRecords(i);
> 			MessageElement [] e= s.get_any();
> 			System.out.println("MessageElement array size is " + e.length);
> 			for (int j = 0; j < e.length; j++ ){
> 				System.out.print(" " + e[j].getValue());
> 			}
> 			System.out.println("");
> 		}

-- 
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


[jira] Commented: (AXIS-1817) MessageElement.getValue doesn't do XML decoding

Posted by "Jongjin Choi (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1817?page=comments#action_59394 ]
     
Jongjin Choi commented on AXIS-1817:
------------------------------------

Venkat, 

I just check in the patches for AXIS-1817, 1823.
Could you review that?

/Jongjin

> MessageElement.getValue doesn't do XML decoding
> -----------------------------------------------
>
>          Key: AXIS-1817
>          URL: http://issues.apache.org/jira/browse/AXIS-1817
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC2
>  Environment: XP / JDK 1.4.x / 
>     Reporter: Simon Fell
>     Assignee: Venkat Reddy
>  Attachments: diff.txt
>
> This actually with the 1.2 RC3
> If the WSDL contains a <any> element, this is mapped to a MessageElement [], in Axis 1.1 calling getValue on one of these MessageElement's would return the contents of the element post XML processing, in Axis 1.2 RC3 it seems to be returning the raw data, e.g. if the response element is
> <elem>A&gt;B</elem>
> In Axis 1.1, getValue() returns "A>B" but Axis 1.2 returns "A&gt;B"
> There's a test service at http://soap.4s4c.com/dotnet/any.wsdl
> here's some client code to call it.
> 		AnyServiceLocator loc = new AnyServiceLocator();
> 		Soap svc = loc.getSoap();
> 				
> 		QueryResult qr = svc.query("blah");
> 		
> 		for (int i =0; i < qr.getRecords().length; i++ ) {
> 			SObject s = qr.getRecords(i);
> 			MessageElement [] e= s.get_any();
> 			System.out.println("MessageElement array size is " + e.length);
> 			for (int j = 0; j < e.length; j++ ){
> 				System.out.print(" " + e[j].getValue());
> 			}
> 			System.out.println("");
> 		}

-- 
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


[jira] Commented: (AXIS-1817) MessageElement.getValue doesn't do XML decoding

Posted by "Ashutosh Shahi (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1817?page=comments#action_59185 ]
     
Ashutosh Shahi commented on AXIS-1817:
--------------------------------------

While you are at this one, can you also look at AXIS-1417 which also is related to special characters. I have already sumitted a patch for that one.
Ashutosh

> MessageElement.getValue doesn't do XML decoding
> -----------------------------------------------
>
>          Key: AXIS-1817
>          URL: http://issues.apache.org/jira/browse/AXIS-1817
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC2
>  Environment: XP / JDK 1.4.x / 
>     Reporter: Simon Fell
>     Assignee: Venkat Reddy

>
> This actually with the 1.2 RC3
> If the WSDL contains a <any> element, this is mapped to a MessageElement [], in Axis 1.1 calling getValue on one of these MessageElement's would return the contents of the element post XML processing, in Axis 1.2 RC3 it seems to be returning the raw data, e.g. if the response element is
> <elem>A&gt;B</elem>
> In Axis 1.1, getValue() returns "A>B" but Axis 1.2 returns "A&gt;B"
> There's a test service at http://soap.4s4c.com/dotnet/any.wsdl
> here's some client code to call it.
> 		AnyServiceLocator loc = new AnyServiceLocator();
> 		Soap svc = loc.getSoap();
> 				
> 		QueryResult qr = svc.query("blah");
> 		
> 		for (int i =0; i < qr.getRecords().length; i++ ) {
> 			SObject s = qr.getRecords(i);
> 			MessageElement [] e= s.get_any();
> 			System.out.println("MessageElement array size is " + e.length);
> 			for (int j = 0; j < e.length; j++ ){
> 				System.out.print(" " + e[j].getValue());
> 			}
> 			System.out.println("");
> 		}

-- 
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


[jira] Assigned: (AXIS-1817) MessageElement.getValue doesn't do XML decoding

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

Davanum Srinivas reassigned AXIS-1817:
--------------------------------------

    Assign To: Venkat Reddy

Venkat,

Can you please look into this?

thanks,
dims

> MessageElement.getValue doesn't do XML decoding
> -----------------------------------------------
>
>          Key: AXIS-1817
>          URL: http://issues.apache.org/jira/browse/AXIS-1817
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC2
>  Environment: XP / JDK 1.4.x / 
>     Reporter: Simon Fell
>     Assignee: Venkat Reddy

>
> This actually with the 1.2 RC3
> If the WSDL contains a <any> element, this is mapped to a MessageElement [], in Axis 1.1 calling getValue on one of these MessageElement's would return the contents of the element post XML processing, in Axis 1.2 RC3 it seems to be returning the raw data, e.g. if the response element is
> <elem>A&gt;B</elem>
> In Axis 1.1, getValue() returns "A>B" but Axis 1.2 returns "A&gt;B"
> There's a test service at http://soap.4s4c.com/dotnet/any.wsdl
> here's some client code to call it.
> 		AnyServiceLocator loc = new AnyServiceLocator();
> 		Soap svc = loc.getSoap();
> 				
> 		QueryResult qr = svc.query("blah");
> 		
> 		for (int i =0; i < qr.getRecords().length; i++ ) {
> 			SObject s = qr.getRecords(i);
> 			MessageElement [] e= s.get_any();
> 			System.out.println("MessageElement array size is " + e.length);
> 			for (int j = 0; j < e.length; j++ ){
> 				System.out.print(" " + e[j].getValue());
> 			}
> 			System.out.println("");
> 		}

-- 
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


[jira] Updated: (AXIS-1817) MessageElement.getValue doesn't do XML decoding

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

Venkat Reddy updated AXIS-1817:
-------------------------------

    Attachment: diff.txt

attaching patch

> MessageElement.getValue doesn't do XML decoding
> -----------------------------------------------
>
>          Key: AXIS-1817
>          URL: http://issues.apache.org/jira/browse/AXIS-1817
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC2
>  Environment: XP / JDK 1.4.x / 
>     Reporter: Simon Fell
>     Assignee: Venkat Reddy
>  Attachments: diff.txt
>
> This actually with the 1.2 RC3
> If the WSDL contains a <any> element, this is mapped to a MessageElement [], in Axis 1.1 calling getValue on one of these MessageElement's would return the contents of the element post XML processing, in Axis 1.2 RC3 it seems to be returning the raw data, e.g. if the response element is
> <elem>A&gt;B</elem>
> In Axis 1.1, getValue() returns "A>B" but Axis 1.2 returns "A&gt;B"
> There's a test service at http://soap.4s4c.com/dotnet/any.wsdl
> here's some client code to call it.
> 		AnyServiceLocator loc = new AnyServiceLocator();
> 		Soap svc = loc.getSoap();
> 				
> 		QueryResult qr = svc.query("blah");
> 		
> 		for (int i =0; i < qr.getRecords().length; i++ ) {
> 			SObject s = qr.getRecords(i);
> 			MessageElement [] e= s.get_any();
> 			System.out.println("MessageElement array size is " + e.length);
> 			for (int j = 0; j < e.length; j++ ){
> 				System.out.print(" " + e[j].getValue());
> 			}
> 			System.out.println("");
> 		}

-- 
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


[jira] Commented: (AXIS-1817) MessageElement.getValue doesn't do XML decoding

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

This one looks murky. The implementation for MessageElement.getValue() in axis1.1 seems straight forward. But that same code is now moved to getValueDOM() in 1.2.

I just tried putting the 1.1 implementation back, and it seems to work. ant all-tests passes.

Please let me know if this could raise other issues not covered by ant all-tests.

Will attach diff in a minute.


> MessageElement.getValue doesn't do XML decoding
> -----------------------------------------------
>
>          Key: AXIS-1817
>          URL: http://issues.apache.org/jira/browse/AXIS-1817
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC2
>  Environment: XP / JDK 1.4.x / 
>     Reporter: Simon Fell
>     Assignee: Venkat Reddy
>  Attachments: diff.txt
>
> This actually with the 1.2 RC3
> If the WSDL contains a <any> element, this is mapped to a MessageElement [], in Axis 1.1 calling getValue on one of these MessageElement's would return the contents of the element post XML processing, in Axis 1.2 RC3 it seems to be returning the raw data, e.g. if the response element is
> <elem>A&gt;B</elem>
> In Axis 1.1, getValue() returns "A>B" but Axis 1.2 returns "A&gt;B"
> There's a test service at http://soap.4s4c.com/dotnet/any.wsdl
> here's some client code to call it.
> 		AnyServiceLocator loc = new AnyServiceLocator();
> 		Soap svc = loc.getSoap();
> 				
> 		QueryResult qr = svc.query("blah");
> 		
> 		for (int i =0; i < qr.getRecords().length; i++ ) {
> 			SObject s = qr.getRecords(i);
> 			MessageElement [] e= s.get_any();
> 			System.out.println("MessageElement array size is " + e.length);
> 			for (int j = 0; j < e.length; j++ ){
> 				System.out.print(" " + e[j].getValue());
> 			}
> 			System.out.println("");
> 		}

-- 
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