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)" <ji...@apache.org> on 2006/04/28 18:38:38 UTC

[jira] Created: (AXIS2-632) get errors trying to parse valid response

get errors trying to parse valid response
-----------------------------------------

         Key: AXIS2-632
         URL: http://issues.apache.org/jira/browse/AXIS2-632
     Project: Apache Axis 2.0 (Axis2)
        Type: Bug

  Components: databinding  
 Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
    Reporter: Simon Fell
    Priority: Blocker


A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.

Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
	at client.main(client.java:19)
Caused by: java.lang.RuntimeException: Unexpected subelement Name
	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
	... 2 more


Here's the response msg it fails to deserialize
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>


the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl


The test code is
		SforceServiceStub stub = new SforceServiceStub();
		SforceServiceStub.Login l = new SforceServiceStub.Login();
		l.setUsername("*username*");
		l.setPassword("*password*");
		SforceServiceStub.LoginResponse lr = stub.login(l);
		
		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
		sh.setSessionId(lr.getResult().getSessionId());
		stub = new SforceServiceStub(lr.getResult().getServerUrl());
		
		SforceServiceStub.Query q = new SforceServiceStub.Query();
		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
		
		System.out.println("query returned " + qr.getResult().getSize() + " rows");
		
		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
		}


Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (AXIS2-632) get errors trying to parse valid response

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

Could u please log a JIRA bug and mark it post 1.0?

thanks,
dims

On 4/29/06, Sanjiva Weerawarana <sa...@opensource.lk> wrote:
> On Sat, 2006-04-29 at 00:06 -0700, Simon Fell wrote:
> > the few verbs lots of nouns approach is a very successful design
> > model, to do it in web services with a static schema requires the
> > schema/runtime stack to support choice or extension, and IMO extension
> > is much better supported than choice, YMMV.
>
> Fair enough .. my statement was too strong :).
>
> However, I wanted to comment on the impact of this for Axis2- Axis2 is
> carefully designed with data binding intentionally kept *out* of the
> core Axis2 platform. ADB is just one of many data bindings we support,
> as you know. ADB was designed to cover the "80%" schema case .. we
> didn't start it to cover all of schema. Of course, as usual, its a
> slippery slope and we've added lots of stuff .. which is fine. But it is
> definitely not 100%.
>
> I think the problem is that we have WSDL2Java configured to go to ADB by
> default. IMO we should have it with no default data binding: just
> generate OM elements! If someone wants a data binding, they can pick
> between ADB, XMLBeans and JibX. I'm presuming the latter two will handle
> enterprise.wsdl fine as they're both much older and stable data binding
> technologies compared to ADB which is still a toddler in that space.
>
> Anyway, I'm not making excuses: We *DO* want Axis2/ADB to be able to
> handle widely used, public, big, WSDL files. As such, enterprise.wsdl is
> a key one to support.
>
> At the same time, we need to draw a line somewhere for 1.0. I would like
> to draw it at where we have ADB now and say that schema extensions and
> deserialization of instances which carry xsi:type to indicate the
> subtype is not yet supported with ADB. Its not that hard to support it
> (we just need a table of schema type -> class mappings hanging around in
> the generated code and to pay attention to xsi:type), but its a
> significant change and not one to embark on at this time IMO.
>
> Sanjiva.
>
>
>


--
Davanum Srinivas : http://wso2.com/blogs/

Re: [jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Sat, 2006-04-29 at 00:06 -0700, Simon Fell wrote:
> the few verbs lots of nouns approach is a very successful design
> model, to do it in web services with a static schema requires the
> schema/runtime stack to support choice or extension, and IMO extension
> is much better supported than choice, YMMV.

Fair enough .. my statement was too strong :).

However, I wanted to comment on the impact of this for Axis2- Axis2 is
carefully designed with data binding intentionally kept *out* of the
core Axis2 platform. ADB is just one of many data bindings we support,
as you know. ADB was designed to cover the "80%" schema case .. we
didn't start it to cover all of schema. Of course, as usual, its a
slippery slope and we've added lots of stuff .. which is fine. But it is
definitely not 100%.

I think the problem is that we have WSDL2Java configured to go to ADB by
default. IMO we should have it with no default data binding: just
generate OM elements! If someone wants a data binding, they can pick
between ADB, XMLBeans and JibX. I'm presuming the latter two will handle
enterprise.wsdl fine as they're both much older and stable data binding
technologies compared to ADB which is still a toddler in that space.

Anyway, I'm not making excuses: We *DO* want Axis2/ADB to be able to
handle widely used, public, big, WSDL files. As such, enterprise.wsdl is
a key one to support.

At the same time, we need to draw a line somewhere for 1.0. I would like
to draw it at where we have ADB now and say that schema extensions and
deserialization of instances which carry xsi:type to indicate the
subtype is not yet supported with ADB. Its not that hard to support it
(we just need a table of schema type -> class mappings hanging around in
the generated code and to pay attention to xsi:type), but its a
significant change and not one to embark on at this time IMO.

Sanjiva.



Re: [jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by Chuck Williams <ch...@manawiz.com>.
Simon,

Choice is supported now in generated code, but unfortunately extension
is not there yet.  I would agree that extension is the better method to
use for services that use types in a natural hierarchy.  I added choice
recently for a different use case.  I'm not sure if or where extension
is in the plans, but suspect you could contribute it if you have time.

Chuck

Simon Fell wrote on 04/28/2006 09:06 PM:
> the few verbs lots of nouns approach is a very successful design
> model, to do it in web services with a static schema requires the
> schema/runtime stack to support choice or extension, and IMO extension
> is much better supported than choice, YMMV.
>
> Cheers
> Simon
>
> On Sat, 29 Apr 2006 03:01:37 +0000 (GMT+00:00), in soap you wrote:
>
>   
>>    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377061 ] 
>>
>> Sanjiva Weerawarana commented on AXIS2-632:
>> -------------------------------------------
>>
>> Its not whether to wrap or unwrap .. there is no unwrap support in 1.0.
>>
>> We came up with a model for stubs as follows (and it was in fact driven by enterprise.wsdl because it lead to the generation of some 2000 classes with XmlBeans):
>>
>> - default is to generate one class with inner classes for data types .. this is like what WCF does
>> - next step is to generate 1+n where n is the number of top level elements for which classes have to be generated
>> - final option is the n classes where we gen one class per whatever needs to be done- no inner classes
>>
>> Enterprise.wsdl is a good test but its a weird test in that regard .. none of the patterns gives an easily managable set of things. I'm going to annoy Simon but I'd venture to say its not a very well designed Web service when it has an object oriented data model represented in XML Schema. Hey but that's just me .. and they're Salesforce, so who am I to tell.
>>
>>     
>>> get errors trying to parse valid response
>>> -----------------------------------------
>>>
>>>          Key: AXIS2-632
>>>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>>>      Project: Apache Axis 2.0 (Axis2)
>>>         Type: Bug
>>>       
>>>   Components: databinding
>>>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>>>     Reporter: Simon Fell
>>>     Priority: Blocker
>>>  Attachments: WhiteSpaceAndExtensionTypes.zip
>>>
>>> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
>>> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
>>> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
>>> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
>>> 	at client.main(client.java:19)
>>> Caused by: java.lang.RuntimeException: Unexpected subelement Name
>>> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
>>> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
>>> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
>>> 	... 2 more
>>> Here's the response msg it fails to deserialize
>>> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
>>> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
>>> The test code is
>>> 		SforceServiceStub stub = new SforceServiceStub();
>>> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
>>> 		l.setUsername("*username*");
>>> 		l.setPassword("*password*");
>>> 		SforceServiceStub.LoginResponse lr = stub.login(l);
>>> 		
>>> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
>>> 		sh.setSessionId(lr.getResult().getSessionId());
>>> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
>>> 		
>>> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
>>> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
>>> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
>>> 		
>>> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
>>> 		
>>> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
>>> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
>>> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
>>> 		}
>>> Also the generated stub has getId() returning an OMElement, and not a string.
>>>       


Re: [jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by Simon Fell <so...@zaks.demon.co.uk>.
the few verbs lots of nouns approach is a very successful design
model, to do it in web services with a static schema requires the
schema/runtime stack to support choice or extension, and IMO extension
is much better supported than choice, YMMV.

Cheers
Simon

On Sat, 29 Apr 2006 03:01:37 +0000 (GMT+00:00), in soap you wrote:

>    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377061 ] 
>
>Sanjiva Weerawarana commented on AXIS2-632:
>-------------------------------------------
>
>Its not whether to wrap or unwrap .. there is no unwrap support in 1.0.
>
>We came up with a model for stubs as follows (and it was in fact driven by enterprise.wsdl because it lead to the generation of some 2000 classes with XmlBeans):
>
>- default is to generate one class with inner classes for data types .. this is like what WCF does
>- next step is to generate 1+n where n is the number of top level elements for which classes have to be generated
>- final option is the n classes where we gen one class per whatever needs to be done- no inner classes
>
>Enterprise.wsdl is a good test but its a weird test in that regard .. none of the patterns gives an easily managable set of things. I'm going to annoy Simon but I'd venture to say its not a very well designed Web service when it has an object oriented data model represented in XML Schema. Hey but that's just me .. and they're Salesforce, so who am I to tell.
>
>> get errors trying to parse valid response
>> -----------------------------------------
>>
>>          Key: AXIS2-632
>>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>>      Project: Apache Axis 2.0 (Axis2)
>>         Type: Bug
>
>>   Components: databinding
>>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>>     Reporter: Simon Fell
>>     Priority: Blocker
>>  Attachments: WhiteSpaceAndExtensionTypes.zip
>>
>> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
>> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
>> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
>> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
>> 	at client.main(client.java:19)
>> Caused by: java.lang.RuntimeException: Unexpected subelement Name
>> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
>> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
>> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
>> 	... 2 more
>> Here's the response msg it fails to deserialize
>> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
>> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
>> The test code is
>> 		SforceServiceStub stub = new SforceServiceStub();
>> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
>> 		l.setUsername("*username*");
>> 		l.setPassword("*password*");
>> 		SforceServiceStub.LoginResponse lr = stub.login(l);
>> 		
>> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
>> 		sh.setSessionId(lr.getResult().getSessionId());
>> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
>> 		
>> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
>> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
>> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
>> 		
>> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
>> 		
>> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
>> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
>> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
>> 		}
>> Also the generated stub has getId() returning an OMElement, and not a string.

[jira] Updated: (AXIS2-632) get errors trying to parse valid response

Posted by "Ajith Harshana Ranabahu (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-632?page=all ]

Ajith Harshana Ranabahu updated AXIS2-632:
------------------------------------------

    Priority: Major  (was: Blocker)

I'm downgrading the critiacality as agreed.

> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>  Attachments: WhiteSpaceAndExtensionTypes.zip
>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by "Chuck Williams (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377063 ] 

Chuck Williams commented on AXIS2-632:
--------------------------------------

So is there a way to get either of the second two options for a Stub?  WSDL2Java does not provide either of these options as far as I can see.  That's why I generated server-side (-ss).




> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>     Priority: Blocker
>  Attachments: WhiteSpaceAndExtensionTypes.zip
>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by "Sanjiva Weerawarana (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377061 ] 

Sanjiva Weerawarana commented on AXIS2-632:
-------------------------------------------

Its not whether to wrap or unwrap .. there is no unwrap support in 1.0.

We came up with a model for stubs as follows (and it was in fact driven by enterprise.wsdl because it lead to the generation of some 2000 classes with XmlBeans):

- default is to generate one class with inner classes for data types .. this is like what WCF does
- next step is to generate 1+n where n is the number of top level elements for which classes have to be generated
- final option is the n classes where we gen one class per whatever needs to be done- no inner classes

Enterprise.wsdl is a good test but its a weird test in that regard .. none of the patterns gives an easily managable set of things. I'm going to annoy Simon but I'd venture to say its not a very well designed Web service when it has an object oriented data model represented in XML Schema. Hey but that's just me .. and they're Salesforce, so who am I to tell.

> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>     Priority: Blocker
>  Attachments: WhiteSpaceAndExtensionTypes.zip
>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by "Ajith Harshana Ranabahu (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12422886 ] 
            
Ajith Harshana Ranabahu commented on AXIS2-632:
-----------------------------------------------

I've resolved this by adding a mapper class that handles types attributes. Please see the resolution for Axis2-639. However I do not want to mark this as resolved until a decent test case is added

> get errors trying to parse valid response
> -----------------------------------------
>
>                 Key: AXIS2-632
>                 URL: http://issues.apache.org/jira/browse/AXIS2-632
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding
>         Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>            Reporter: Simon Fell
>         Attachments: WhiteSpaceAndExtensionTypes.zip
>
>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by "Chuck Williams (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377056 ] 

Chuck Williams commented on AXIS2-632:
--------------------------------------

Hi Dims,

That would be another bug.  -u is still generating a wrapped Stub.

Chuck


> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>     Priority: Blocker
>  Attachments: WhiteSpaceAndExtensionTypes.zip
>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by "Chuck Williams (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377304 ] 

Chuck Williams commented on AXIS2-632:
--------------------------------------

Any complex type can be extended.  According to the XML Schema specification, all complex types except for the root ur type are extensions or restrictions of some other type (just like in Java all types extend Object).  Generally base types will not have any kind of <any> declaration.  It is the subtype that has the additional fields.  XML allows use of a subtype wherever the supertype is required (again like Java and other OO systems).

The only issue in supporting xsi:type is arranging for runtime information about subtypes.  It seems to me the potentially tricky thing here has to do with class loaders, since we cannot in general know about the existence of a subtype if its class has not been loaded.  A very simple solution arises if there is a deterministic algorithm to find the subclass name from the QName argument to xsi:type, which in general there should be.  Then the parser can identify the subclass parser directly from the value of xsi:type and simply dispatch to it.  The generated code can check for the xsi:type attribute as its first step in attribute parsing -- I think that resolves all remaining issues.


> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>  Attachments: WhiteSpaceAndExtensionTypes.zip
>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by "Chuck Williams (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377038 ] 

Chuck Williams commented on AXIS2-632:
--------------------------------------

The issue here is that the wsdl defines the <records> element to be an sObject:

            <complexType name="QueryResult">
                <sequence>
                    <element name="done"         type="xsd:boolean"/>
                    <element name="queryLocator" type="tns:QueryLocator" nillable="true"/>
                    <element name="records"      type="ens:sObject" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                    <element name="size"         type="xsd:int"/>
                </sequence>
            </complexType>

and then the message specifies the type to be an sAccount:

    <records xsi:type="sf:Account">
        <sf:Id>0013000000Bnr1qAAB</sf:Id>
        <sf:AccountNumber>axis2Test</sf:AccountNumber>
        <sf:Name>New Account 2</sf:Name>
    </records>

while sObject does not have the AccountNumber or Name property:

            <complexType name="sObject">

                <sequence>

                    <element name="fieldsToNull"       type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>

                    <element name="Id"                 type="tns:ID" nillable="true" minOccurs="0" maxOccurs="1" />

                </sequence>

            </complexType>

and Account adds them as an extension type:

            <complexType name="Account">
                <complexContent>
                    <extension base="ens:sObject">
                        <sequence>
                        ...
                        <element name="AccountNumber" nillable="true" minOccurs="0" type="xsd:string"/>
                        ...
                        <element name="Name" nillable="true" minOccurs="0" type="xsd:string"/>
                        ...
                    </extension>
                </complexContent>
            </complexType>

But the generated code is based solely on the declaration of QueryResult and so parses the <records> element as an sObject.  sObject does not allow the extra properties.  Whence, the exception.

The bottom line is that the current code generator does not support this construction with extension types.  Unless this is a required feature for 1.0, I'd say this is not a bug.

It could be considered a bug that the error message is not:  "Unexpected subelement AccountNumber".  The cause of this could lead to some improper behavior in other cases, but never with properly formatted xml.  It's just an error recovery/reporting issue.

In looking at this I saw another anomaly that should be corrected.  If you take the xml of this example and format it for easy reading, and then try to parse it, you get an infinite loop!!  This is not good.  There is one place in the template (at least) where an invalid assumption is made that should be fixed.  It could lead to proper xml not being parsed correctly if it is formatted with extra ignorable whitespace.  I'm looking at that now.


> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>     Priority: Blocker

>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377055 ] 

Davanum Srinivas commented on AXIS2-632:
----------------------------------------

chuck,

there is a parameter when running w2j to specify that tells w2j not to generate a single file but to generate individual files.

thanks,
dims

> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>     Priority: Blocker
>  Attachments: WhiteSpaceAndExtensionTypes.zip
>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by "Chuck Williams (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377112 ] 

Chuck Williams commented on AXIS2-632:
--------------------------------------

Ajith,

It seems just about everybody agrees that xsi:type is a feature request, and certainly not a blocker, so I agree with your proposal.

Did you notice the whitespace issue buried in the discussion and patched in the attachment?  I think that is an important bug fix for 1.0.

Simon noted on the mail list:  "If ADB doesn't support extension, that it should flag this during the WSDL2Java stage, and not throw cryptic errors at runtime."  However, it appears ADB does support extension and compiles code for the extension types correctly.  The issue is that it does not support xsi:type at runtime.  We could add a check for xsi:type in the attribute parsing code and throw a more meaningful exception there rather than dying when the base type parser sees properties only on the subtype.  However, I would not deem this an essential fix for 1.0, as there are likely other constructions that are similarly not handled and not detected.

Chuck

> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>     Priority: Blocker
>  Attachments: WhiteSpaceAndExtensionTypes.zip
>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by "Sanjiva Weerawarana (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377140 ] 

Sanjiva Weerawarana commented on AXIS2-632:
-------------------------------------------

Hi Chuck,

I agree that the issue is lack of runtime support for extensions and not about the support for generating ser/deser based on extensions. 

About throwing an exception based on xsi:type @ runtime, the issue is that many SOAP stacks (going back to Apache SOAP even) generate xsi:type for everything .. and just its presence of course does not imply that a subtype is being sent at all. So I think its best to leave this alone for now and work on it for 1.1 as a high priority item. 

I'd be +1 for marking it as a blocker for 1.1.

Sanjiva.

> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>     Priority: Blocker
>  Attachments: WhiteSpaceAndExtensionTypes.zip
>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (AXIS2-632) get errors trying to parse valid response

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-632?page=all ]

Davanum Srinivas resolved AXIS2-632.
------------------------------------

    Resolution: Fixed

as per ajith's comment. closing this bug.

> get errors trying to parse valid response
> -----------------------------------------
>
>                 Key: AXIS2-632
>                 URL: http://issues.apache.org/jira/browse/AXIS2-632
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding
>         Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>            Reporter: Simon Fell
>         Attachments: WhiteSpaceAndExtensionTypes.zip
>
>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by "Sanjiva Weerawarana (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377291 ] 

Sanjiva Weerawarana commented on AXIS2-632:
-------------------------------------------

Something bothers me about this issue: Is it not the case that for a type to be extended it must have had in its declaration xs:any and/or xs:anyAttribute?? If so, shouldn't the sObject reader be able to read any subtype, including sAccount? One can't cast the type in Java obviously until we do xsi:type right, but it seems to me the extra elements should be read and stored as extra stuff in the oObject class that's generated.

I must be missing something .. maybe the jetlag after 24 hours of flying?

> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>  Attachments: WhiteSpaceAndExtensionTypes.zip
>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by "Ajith Harshana Ranabahu (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377083 ] 

Ajith Harshana Ranabahu commented on AXIS2-632:
-----------------------------------------------

I'm sorry that the codegenerator options are not well documented but the code generator can pass certain extra parameters that will be picked up by the ADB schema compiler to expand the classes. you can pass "-Ew false -Er true" which will not pack the classes and write them directly.
As for the issue we also decovered the problem and Chuck has written an excellent account of it. The solution I see is to keep a table of Qname-class mappings inside ADB and switch to that when the xsi:type attribute is present. Anyway it means a complete twist to the deserialization code of ADB which seems not appropriate at all at this moment.
The other fact is this has to do with ADB and not Axis2 as a whole. We came to a decision that databinding will be kept out. Although ADB fails to do the correct mapping, XMLBeans is perfectly capable of doing this and it is not justifiable to say Axis2 is incapable of handling it.
I would say we should downgrade the criticality of this and attach an improvement (support xsi:type based deserialization for ADB or something). 

What would the others think about this ?

> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>     Priority: Blocker
>  Attachments: WhiteSpaceAndExtensionTypes.zip
>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by "Simon Fell (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377040 ] 

Simon Fell commented on AXIS2-632:
----------------------------------

Seems like a doc/literal case that the 4 year old Axis 1.1 supports really should work in Axis 2, isn't this suposed to be a step forward ?

> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>     Priority: Blocker

>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS2-632) get errors trying to parse valid response

Posted by "Chuck Williams (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377044 ] 

Chuck Williams commented on AXIS2-632:
--------------------------------------

Axis2 is a step forward in many ways.  The open question is whether or not this use of extension types is a feature requirement for 1.0.  I do not know the answer to that.


> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>     Priority: Blocker

>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS2-632) get errors trying to parse valid response

Posted by "Chuck Williams (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-632?page=all ]

Chuck Williams updated AXIS2-632:
---------------------------------

    Attachment: WhiteSpaceAndExtensionTypes.zip

The attached archive has a fix for the whitespace problem.  This is serious as it causes generated parsing code to fail if there is whitespace between array element properties (and possibly other cases).  I beleive the fix should be included in the 1.0 release.

There is only one changed file:  ADBBeanTemplate.xsl.  The archive includes a patch and the new version of the file.

Also included is some simple test code in Main.java that reproduces this issue, verifying the whitespace problem is fixed but that the extension types issue remains.  The test case requires the generated classes from enterprise.wsdl as described by the submitter, except that I also used -ss to get the server side code.  This is so classes are unwrapped.  Else, the Stub is a 5 MB source file that breaks the netbeans source debugger and even some operations in emacs!



> get errors trying to parse valid response
> -----------------------------------------
>
>          Key: AXIS2-632
>          URL: http://issues.apache.org/jira/browse/AXIS2-632
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: databinding
>  Environment: Axis2.0 RC4, JDK 1.5.06, WinXP
>     Reporter: Simon Fell
>     Priority: Blocker
>  Attachments: WhiteSpaceAndExtensionTypes.zip
>
> A valid response from the query call (wsdl is the enterprise wsdl that's now part of the tests) fails to be de-serialized with an error.
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59718)
> 	at org.apache.axis2.SforceServiceStub.query(SforceServiceStub.java:2545)
> 	at client.main(client.java:19)
> Caused by: java.lang.RuntimeException: Unexpected subelement Name
> 	at org.apache.axis2.SforceServiceStub$QueryResult$Factory.parse(SforceServiceStub.java:57735)
> 	at org.apache.axis2.SforceServiceStub$QueryResponse$Factory.parse(SforceServiceStub.java:20706)
> 	at org.apache.axis2.SforceServiceStub.fromOM(SforceServiceStub.java:59594)
> 	... 2 more
> Here's the response msg it fails to deserialize
> <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:Account"><sf:Id>0013000000Bnr1qAAB</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 2</sf:Name></records><records xsi:type="sf:Account"><sf:Id>0013000000BnspUAAR</sf:Id><sf:AccountNumber>axis2Test</sf:AccountNumber><sf:Name>New Account 1</sf:Name></records><size>2</size></result></queryResponse></soapenv:Body></soapenv:Envelope>
> the client stub was generated with WSDL2Java -s -u -uri enterprise.wsdl
> The test code is
> 		SforceServiceStub stub = new SforceServiceStub();
> 		SforceServiceStub.Login l = new SforceServiceStub.Login();
> 		l.setUsername("*username*");
> 		l.setPassword("*password*");
> 		SforceServiceStub.LoginResponse lr = stub.login(l);
> 		
> 		SforceServiceStub.SessionHeader sh = new SforceServiceStub.SessionHeader();
> 		sh.setSessionId(lr.getResult().getSessionId());
> 		stub = new SforceServiceStub(lr.getResult().getServerUrl());
> 		
> 		SforceServiceStub.Query q = new SforceServiceStub.Query();
> 		q.setQueryString("select id, name, AccountNumber from Account where AccountNumber='axis2Test'");
> 		SforceServiceStub.QueryResponse qr = stub.query(q, sh, null);
> 		
> 		System.out.println("query returned " + qr.getResult().getSize() + " rows");
> 		
> 		for(SforceServiceStub.SObject o : qr.getResult().getRecords()) {
> 			SforceServiceStub.Account a = (SforceServiceStub.Account)o;
> 			System.out.println(a.getId() + " " + a.getName() + " " + a.getAccountNumber());
> 		}
> Also the generated stub has getId() returning an OMElement, and not a string.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira