Re: Axis2: Unexpected subelement fees

2006-05-11 Thread Dennis Sosnoski
You have the element defined with nillable="true", so the correct way to 
do this is , where the xsi prefix is set 
to the schema instance namespace 
"http://www.w3.org/2001/XMLSchema-instance"; (the prefix can be 
different, but the namespace has to be exactly as given).


Personally, I prefer using minOccurs="0" to nillable="true" in an 
element definition. These are generally treated the same by data binding 
frameworks (or should be - my own JiBX data binding framework doesn't 
support nillable as of right now), but the difference is that 
minOccurs="0" says you can just leave the element out of the document if 
it doesn't have a value, while nillable="true" without minOccurs="0" 
says the element must always be present whether it has a value or not. I 
think the XML representation is cleaner when the elements with no values 
are left out.


 - Dennis

Dennis M. Sosnoski
SOA, Web Services, and XML
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117



Dan Washusen wrote:


Interesting, so how do I specify a null value for brokerage?

I found http://redrice.com/schemavalid/faq/xml-schema.html#c2 but it 
seems a little cumbersome/crap...


On 5/12/06, *Dennis Sosnoski* <[EMAIL PROTECTED] 
> wrote:


And the new error is very likely because your SOAP message has an
empty
 element, which is not valid for an xsd:decimal value.

  - Dennis

Dan Washusen wrote:

> Thanks for that Sanjiva, you were spot on.  I did have the elements
> out of order in the SOAP envolope...
>
> I'm not getting:
>
> [junit] Testcase:
> testprocess(org.apache.axis2.RetrieveClientDetailsTest):  Caused
> an ERROR
> [junit] java.lang.NumberFormatException: For input
string: ""
> [junit] java.lang.RuntimeException:
> java.lang.NumberFormatException : For input string: ""
> [junit] at
>
org.apache.axis2.RetrieveClientDetailsStub.fromOM(RetrieveClientDetailsStub.java:345)

> [junit] at
>
org.apache.axis2.RetrieveClientDetailsStub.process(RetrieveClientDetailsStub.java


> :114)
> [junit] at
>
org.apache.axis2.RetrieveClientDetailsTest.testprocess(RetrieveClientDetailsTest.java:24)

> [junit] Caused by: java.lang.NumberFormatException: For
input
> string: ""
> [junit] at
>
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)

> [junit] at java.lang.Long.parseLong(Long.java:415)
> [junit] at java.lang.Long.parseLong(Long.java:452)
> [junit] at
>
org.apache.axis2.databinding.utils.ConverterUtil.convertTolong(ConverterUtil.java:269)

> [junit] at
>
au.com.nxf.www.nxfmessagetypes.ClientDetailsType$Factory.parse(ClientDetailsType.java:571)

> [junit] at
>
au.com.nxf.www.retrieveclientdetails.RetrieveClientDetailsProcessResponse$Factory.parse

(RetrieveClien
> tDetailsProcessResponse.java:149)
> [junit] at
>
org.apache.axis2.RetrieveClientDetailsStub.fromOM(RetrieveClientDetailsStub.java

> :337)
> [junit] ... 17 more
>
>
> But that's probably a whole new issue...
>
> As a side note, if any of the Asix2 developers are listening.  You
> could possibly improve the user friendliness of Axis by making the
> exceptions a bit more informative...
>
> e.g. "Unexpected subelement fees, expected element contact.  It's
> possible the SOAP envelope doesn't adhere to the XSD" or
something...
>
>
>
> On 5/12/06, * Sanjiva Weerawarana* <[EMAIL PROTECTED]

> >>
wrote:
>
> On Fri, 2006-05-12 at 12:21 +1000, Dan Washusen wrote:
> > Hi All,
> > I'm getting a weird error and I was hoping someone could
tell me
> what
> > I'm doing wrong because I have no idea what's going on...
>
> >
> >> nillable="true"/>
> >> nillable="true"/>
> >> nillable="true"/>
> >> nillable="true"/>
> >> nillable="true" minOccurs="1" maxOccurs="unbounded"/>
> >> nillable="true" minOccurs="1" maxOccurs="unbounded"/>
> >   
>
> So according to your schema, before the  element,
there must
> be at
> least one  element and an  element.
>
> > 
> > 
> > 
> > 7.5
> > 10
> > 
>

Re: Axis2: Unexpected subelement fees

2006-05-11 Thread Dan Washusen
Interesting, so how do I specify a null value for brokerage?I found http://redrice.com/schemavalid/faq/xml-schema.html#c2 but it seems a little cumbersome/crap... 
On 5/12/06, Dennis Sosnoski <[EMAIL PROTECTED]> wrote:
And the new error is very likely because your SOAP message has an empty element, which is not valid for an xsd:decimal value.  - DennisDan Washusen wrote:> Thanks for that Sanjiva, you were spot on.  I did have the elements
> out of order in the SOAP envolope...>> I'm not getting:>> [junit] Testcase:> testprocess(org.apache.axis2.RetrieveClientDetailsTest):  Caused> an ERROR
> [junit] java.lang.NumberFormatException: For input string: ""> [junit] java.lang.RuntimeException:> java.lang.NumberFormatException : For input string: ""> [junit] at
> org.apache.axis2.RetrieveClientDetailsStub.fromOM(RetrieveClientDetailsStub.java:345)> [junit] at> org.apache.axis2.RetrieveClientDetailsStub.process(RetrieveClientDetailsStub.java
> :114)> [junit] at> org.apache.axis2.RetrieveClientDetailsTest.testprocess(RetrieveClientDetailsTest.java:24)> [junit] Caused by: java.lang.NumberFormatException: For input
> string: ""> [junit] at> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)> [junit] at java.lang.Long.parseLong(Long.java:415)
> [junit] at java.lang.Long.parseLong(Long.java:452)> [junit] at> org.apache.axis2.databinding.utils.ConverterUtil.convertTolong(ConverterUtil.java:269)> [junit] at
> au.com.nxf.www.nxfmessagetypes.ClientDetailsType$Factory.parse(ClientDetailsType.java:571)> [junit] at> au.com.nxf.www.retrieveclientdetails.RetrieveClientDetailsProcessResponse$Factory.parse
(RetrieveClien> tDetailsProcessResponse.java:149)> [junit] at> org.apache.axis2.RetrieveClientDetailsStub.fromOM(RetrieveClientDetailsStub.java> :337)> [junit] ... 17 more
>>> But that's probably a whole new issue...>> As a side note, if any of the Asix2 developers are listening.  You> could possibly improve the user friendliness of Axis by making the
> exceptions a bit more informative...>> e.g. "Unexpected subelement fees, expected element contact.  It's> possible the SOAP envelope doesn't adhere to the XSD" or something...>
>>> On 5/12/06, * Sanjiva Weerawarana* <[EMAIL PROTECTED]> [EMAIL PROTECTED]>> wrote:
>> On Fri, 2006-05-12 at 12:21 +1000, Dan Washusen wrote:> > Hi All,> > I'm getting a weird error and I was hoping someone could tell me> what> > I'm doing wrong because I have no idea what's going on...
>> >> >   > > nillable="true"/>> >   > > nillable="true"/>> >   > > nillable="true"/>> >   > > nillable="true"/>> >   > > nillable="true" minOccurs="1" maxOccurs="unbounded"/>
> >   > > nillable="true" minOccurs="1" maxOccurs="unbounded"/>> >   
>> So according to your schema, before the  element, there must> be at> least one  element and an  element.>> > 
> > > > > > 7.5> > 10
> > > >  5.75> > > > >
> But the SOAP message doesn't have it. It looks like whoever generated> the SOAP envelope is not adhering to the schema.>> Sanjiva.>>>


Re: Axis2: Unexpected subelement fees

2006-05-11 Thread Dennis Sosnoski
And the new error is very likely because your SOAP message has an empty 
 element, which is not valid for an xsd:decimal value.


 - Dennis

Dan Washusen wrote:

Thanks for that Sanjiva, you were spot on.  I did have the elements 
out of order in the SOAP envolope...


I'm not getting:

[junit] Testcase:
testprocess(org.apache.axis2.RetrieveClientDetailsTest):  Caused
an ERROR
[junit] java.lang.NumberFormatException: For input string: ""
[junit] java.lang.RuntimeException:
java.lang.NumberFormatException : For input string: ""
[junit] at

org.apache.axis2.RetrieveClientDetailsStub.fromOM(RetrieveClientDetailsStub.java:345)
[junit] at

org.apache.axis2.RetrieveClientDetailsStub.process(RetrieveClientDetailsStub.java
:114)
[junit] at

org.apache.axis2.RetrieveClientDetailsTest.testprocess(RetrieveClientDetailsTest.java:24)
[junit] Caused by: java.lang.NumberFormatException: For input
string: ""
[junit] at

java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
[junit] at java.lang.Long.parseLong(Long.java:415)
[junit] at java.lang.Long.parseLong(Long.java:452)
[junit] at

org.apache.axis2.databinding.utils.ConverterUtil.convertTolong(ConverterUtil.java:269)
[junit] at

au.com.nxf.www.nxfmessagetypes.ClientDetailsType$Factory.parse(ClientDetailsType.java:571)
[junit] at

au.com.nxf.www.retrieveclientdetails.RetrieveClientDetailsProcessResponse$Factory.parse(RetrieveClien
tDetailsProcessResponse.java:149)
[junit] at

org.apache.axis2.RetrieveClientDetailsStub.fromOM(RetrieveClientDetailsStub.java
:337)
[junit] ... 17 more


But that's probably a whole new issue...

As a side note, if any of the Asix2 developers are listening.  You 
could possibly improve the user friendliness of Axis by making the 
exceptions a bit more informative...


e.g. "Unexpected subelement fees, expected element contact.  It's 
possible the SOAP envelope doesn't adhere to the XSD" or something...
 



On 5/12/06, * Sanjiva Weerawarana* <[EMAIL PROTECTED] 
> wrote:


On Fri, 2006-05-12 at 12:21 +1000, Dan Washusen wrote:
> Hi All,
> I'm getting a weird error and I was hoping someone could tell me
what
> I'm doing wrong because I have no idea what's going on...

>
>nillable="true"/>
>nillable="true"/>
>nillable="true"/>
>nillable="true"/>
>nillable="true" minOccurs="1" maxOccurs="unbounded"/>
>nillable="true" minOccurs="1" maxOccurs="unbounded"/>
>   

So according to your schema, before the  element, there must
be at
least one  element and an  element.

> 
> 
> 
> 7.5
> 10
> 
>  5.75
> 
> 

But the SOAP message doesn't have it. It looks like whoever generated
the SOAP envelope is not adhering to the schema.

Sanjiva.





Re: Axis2: Unexpected subelement fees

2006-05-11 Thread Dan Washusen
Thanks for that Sanjiva, you were spot on.  I did have the elements out of order in the SOAP envolope...I'm not getting:
    [junit] Testcase: testprocess(org.apache.axis2.RetrieveClientDetailsTest):  Caused an ERROR    [junit] java.lang.NumberFormatException: For input string: ""    [junit] java.lang.RuntimeException: java.lang.NumberFormatException
: For input string: ""    [junit] at org.apache.axis2.RetrieveClientDetailsStub.fromOM(RetrieveClientDetailsStub.java:345)    [junit] at org.apache.axis2.RetrieveClientDetailsStub.process(RetrieveClientDetailsStub.java
:114)    [junit] at org.apache.axis2.RetrieveClientDetailsTest.testprocess(RetrieveClientDetailsTest.java:24)    [junit] Caused by: java.lang.NumberFormatException: For input string: ""    [junit] at 
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)    [junit] at java.lang.Long.parseLong(Long.java:415)    [junit] at java.lang.Long.parseLong(Long.java:452)    [junit] at 
org.apache.axis2.databinding.utils.ConverterUtil.convertTolong(ConverterUtil.java:269)    [junit] at au.com.nxf.www.nxfmessagetypes.ClientDetailsType$Factory.parse(ClientDetailsType.java:571)    [junit] at 
au.com.nxf.www.retrieveclientdetails.RetrieveClientDetailsProcessResponse$Factory.parse(RetrieveClientDetailsProcessResponse.java:149)    [junit] at org.apache.axis2.RetrieveClientDetailsStub.fromOM(RetrieveClientDetailsStub.java
:337)    [junit] ... 17 moreBut that's probably a whole new issue...As a side note, if any of the Asix2 developers are listening.  You could possibly improve the user friendliness of Axis by making the exceptions a bit more informative...
e.g. "Unexpected subelement fees, expected element contact.  It's possible the SOAP envelope doesn't adhere to the XSD" or something... On 5/12/06, 
Sanjiva Weerawarana <[EMAIL PROTECTED]> wrote:
On Fri, 2006-05-12 at 12:21 +1000, Dan Washusen wrote:> Hi All,> I'm getting a weird error and I was hoping someone could tell me what> I'm doing wrong because I have no idea what's going on...
>>   > nillable="true"/>>   > nillable="true"/>>   > nillable="true"/>>   > nillable="true"/>>   > nillable="true" minOccurs="1" maxOccurs="unbounded"/>
>   > nillable="true" minOccurs="1" maxOccurs="unbounded"/>>   
So according to your schema, before the  element, there must be atleast one  element and an  element.> > 
> > 7.5> 10> > 
5.75> > But the SOAP message doesn't have it. It looks like whoever generatedthe SOAP envelope is not adhering to the schema.
Sanjiva.


Re: Axis2: Unexpected subelement fees

2006-05-11 Thread Sanjiva Weerawarana
On Fri, 2006-05-12 at 12:21 +1000, Dan Washusen wrote:
> Hi All, 
> I'm getting a weird error and I was hoping someone could tell me what
> I'm doing wrong because I have no idea what's going on...

> 
>nillable="true"/> 
>nillable="true"/>
>nillable="true"/> 
>nillable="true"/>
>nillable="true" minOccurs="1" maxOccurs="unbounded"/> 
>nillable="true" minOccurs="1" maxOccurs="unbounded"/>
>

So according to your schema, before the  element, there must be at
least one  element and an  element.

> 
> 
> 
> 7.5
> 10
> 
> 5.75
> 
> 

But the SOAP message doesn't have it. It looks like whoever generated
the SOAP envelope is not adhering to the schema.

Sanjiva.




Re: Axis2: Unexpected subelement fees

2006-05-11 Thread Dan Washusen
Here is the wsdl2java call:
http://ws008:9700/orabpel/default/RetrieveClientDetails/1.0/RetrieveClientDetails?wsdl" />I've also attached the wsdl...Cheers,DanOn 5/12/06, 
robert lazarski <[EMAIL PROTECTED]> wrote:
Even though it may be big, could you attach your entire wsdl ?  It
also may help us figure out the problem is you show us you params you
passed to wsdl2java. One other thing: Is the client request making it
to the server, and perhaps returning a reponse the client can't parse?
(late here, sorry if I'm not making sense ;-) ) 

Robert
http://www.braziloutsource.com/
On 5/11/06, Dan Washusen <[EMAIL PROTECTED]
> wrote:
Hi All, I'm getting a weird error and I was hoping someone could tell me what I'm doing wrong because I have no idea what's going on...I've generated a client using the org.apache.axis2.tool.ant.AntCodegenTask


class and filled in the todos in the generated test case, however when
I run the test Axis spits out the following error:
    [junit] Testcase: testprocess(org.apache.axis2.RetrieveClientDetailsTest):  Caused an ERROR
    [junit] java.lang.RuntimeException: Unexpected subelement fees    [junit] java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement fees    [junit] at org.apache.axis2.RetrieveClientDetailsStub.fromOM


(RetrieveClientDetailsStub.java:345)    [junit] at org.apache.axis2.RetrieveClientDetailsStub.process(RetrieveClientDetailsStub.java:114)    [junit] at org.apache.axis2.RetrieveClientDetailsTest.testprocess


(RetrieveClientDetailsTest.java:24)    [junit] Caused by: java.lang.RuntimeException: Unexpected subelement fees    [junit] at au.com.nxf.www.nxfmessagetypes.ClientDetailsType$Factory.parse(ClientDetailsType.java


:579)    [junit] at au.com.nxf.www.retrieveclientdetails.RetrieveClientDetailsProcessResponse$Factory.parse(RetrieveClientDetailsProcessResponse.java:149)    [junit] at org.apache.axis2.RetrieveClientDetailsStub.fromOM


(RetrieveClientDetailsStub.java:337)    [junit] ... 17 moreMy XSD looks like this (well here's the relevant bit of it):


        
    
    
   

     
    
              
    
    
        And the SOAP envelope looks like this:


0ns1:Status
>client:StatusMsg
>13ns1:partyId>TEST1ns1:externalId>Client 1ns1:description>7.5ns1:lineFee
>10ns1:shortFee
>5.75ns1:interestRate>ns1:fees>ACTIVEns1:status
>2529ns1:contactId
>13ns1:partyId
>Lordns1:title
>Dormanns1:surname> ns1:phone1> 5554ns1:phone2>  99
ns1:mobile>[EMAIL PROTECTED]


ns1:email>ns1:contact>
1717ns1:siteId
>13ns1:partyId
>asdfasdfns1:description
>
1 Elizabeth Streetns1:line2>
Sydneyns1:city>
NSWns1:state>
2000ns1:postcode>
AUns1:country>ns1:address>client:ClientDetails>
RetrieveClientDetailsProcessResponse>I found a Jira issue that seems to be related but I don't really follow the comments:
http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377038
Any ideas?Cheers,Dan 
p.s. I'm running Axis2 1.0 on a Windows XP machine with JDK 1.4.2_11.  





http://www.nxf.com.au/RetrieveClientDetails";
 xmlns="http://schemas.xmlsoap.org/wsdl/";
 xmlns:tns="http://www.nxf.com.au/RetrieveClientDetails";
 xmlns:ns1="http://www.nxf.com.au/NXFMessageTypes";
 xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/";
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
 xmlns:client="http://www.nxf.com.au/RetrieveClientDetails";
>

http://www.nxf.com.au/RetrieveClientDetails";
 xmlns="http://www.w3.org/2001/XMLSchema"; xmlns:client="http://www.nxf.com.au/RetrieveClientDetails";
 xmlns:ns1="http://www.nxf.com.au/NXFMessageTypes"; xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/";>
http://www.nxf.com.au/NXFMessageTypes"; schemaLocation="http://devserver01.domaina.local:/DataModelDev/NXFMessageTypes.xsd"/>


































Re: Axis2: Unexpected subelement fees

2006-05-11 Thread robert lazarski
Even though it may be big, could you attach your entire wsdl ?  It
also may help us figure out the problem is you show us you params you
passed to wsdl2java. One other thing: Is the client request making it
to the server, and perhaps returning a reponse the client can't parse?
(late here, sorry if I'm not making sense ;-) ) 

Robert
http://www.braziloutsource.com/
On 5/11/06, Dan Washusen <[EMAIL PROTECTED]> wrote:
Hi All, I'm getting a weird error and I was hoping someone could tell me what I'm doing wrong because I have no idea what's going on...I've generated a client using the org.apache.axis2.tool.ant.AntCodegenTask

class and filled in the todos in the generated test case, however when
I run the test Axis spits out the following error:
    [junit] Testcase: testprocess(org.apache.axis2.RetrieveClientDetailsTest):  Caused an ERROR
    [junit] java.lang.RuntimeException: Unexpected subelement fees    [junit] java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement fees    [junit] at org.apache.axis2.RetrieveClientDetailsStub.fromOM

(RetrieveClientDetailsStub.java:345)    [junit] at org.apache.axis2.RetrieveClientDetailsStub.process(RetrieveClientDetailsStub.java:114)    [junit] at org.apache.axis2.RetrieveClientDetailsTest.testprocess

(RetrieveClientDetailsTest.java:24)    [junit] Caused by: java.lang.RuntimeException: Unexpected subelement fees    [junit] at au.com.nxf.www.nxfmessagetypes.ClientDetailsType$Factory.parse(ClientDetailsType.java

:579)    [junit] at au.com.nxf.www.retrieveclientdetails.RetrieveClientDetailsProcessResponse$Factory.parse(RetrieveClientDetailsProcessResponse.java:149)    [junit] at org.apache.axis2.RetrieveClientDetailsStub.fromOM

(RetrieveClientDetailsStub.java:337)    [junit] ... 17 moreMy XSD looks like this (well here's the relevant bit of it):

        
    
    
   

     
    
              
    
    
        And the SOAP envelope looks like this:

0ns1:Status
>client:StatusMsg
>13ns1:partyId>TEST1ns1:externalId>Client 1ns1:description>7.5ns1:lineFee
>10ns1:shortFee
>5.75ns1:interestRate>ns1:fees>ACTIVEns1:status
>2529ns1:contactId
>13ns1:partyId
>Lordns1:title
>Dormanns1:surname> ns1:phone1> 5554ns1:phone2>  99
ns1:mobile>[EMAIL PROTECTED]

ns1:email>ns1:contact>
1717ns1:siteId
>13ns1:partyId
>asdfasdfns1:description
>
1 Elizabeth Streetns1:line2>
Sydneyns1:city>
NSWns1:state>
2000ns1:postcode>
AUns1:country>ns1:address>client:ClientDetails>
RetrieveClientDetailsProcessResponse>I found a Jira issue that seems to be related but I don't really follow the comments:
http://issues.apache.org/jira/browse/AXIS2-632?page=comments#action_12377038
Any ideas?Cheers,Dan 
p.s. I'm running Axis2 1.0 on a Windows XP machine with JDK 1.4.2_11.