Apache

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Axis2: Unexpected subelement fees

    7 answers - 4429 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    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
    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(
    ): Caused an ERRR
    [junit] java.lang.RuntimeException: Unexpected subelement fees
    [junit] java.lang.RuntimeException: java.lang.RuntimeException:
    Unexpected subelement fees
    [junit] at (
    )
    [junit] at (
    )
    [junit] at (
    )
    [junit] Caused by: java.lang.RuntimeException: Unexpected subelement
    fees
    [junit] at
    $Factory.parse(
    ClientDetailsType.java:579)
    [junit] at
    $Factory.parse
    ()
    [junit] at (
    )
    [junit] 17 more
    My XSD looks like this (well here's the relevant bit of it):
    <xsd:complexType name="ClientDetailsType">
    <xsd:sequence>
    <xsd:element name="partyId" type="xsd:long"/>
    <xsd:element name="externalId" type="xsd:string"/>
    <xsd:element name="description" type="xsd:string" nillable="true"/>
    <xsd:element name="company" type="xsd:string" nillable="true"/>
    <xsd:element name="abnacn" type="xsd:string" nillable="true"/>
    <xsd:element name="cmtAccount1Id" type="xsd:long" nillable="true"/>
    <xsd:element name="cmtAccount2Id" type="xsd:long" nillable="true"/>
    <xsd:element name="contact" type="ContactType" nillable="true"
    ="1" ="unbounded"/>
    <xsd:element name="address" type="SiteType" nillable="true"
    ="1" ="unbounded"/>
    <xsd:element name="fees" type="ClientFeesType"/>
    <xsd:element name="lastStatement" type="xsd:date" nillable="true"/>
    <xsd:element name="status" type="status" nillable="true"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ClientFeesType">
    <xsd:sequence>
    <xsd:element name="lineFee" type="xsd:decimal" nillable="true"/>
    <xsd:element name="shortFee" type="xsd:decimal" nillable="true"/>
    <xsd:element name="brokerage" type="xsd:decimal" nillable="true"/>
    <xsd:element name="interestRate" type="xsd:decimal"
    nillable="true"/>
    <xsd:element name="rebate" type="xsd:decimal" nillable="true"/>
    </xsd:sequence>
    </xsd:complexType>
    And the SAP envelope looks like this:
    <><client:StatusMsg><ns1:Status>0</
    ns1:Status>
    <ns1:StatusDetailedMsg/>
    </client:StatusMsg>
    <client:ClientDetails><ns1:partyId>13</ns1:partyId>
    <ns1:externalId>TEST1</ns1:externalId>
    <ns1:description>Client 1</ns1:description>
    <ns1:company/>
    <ns1:abnacn/>
    <ns1:fees><ns1:lineFee>7.5</ns1:lineFee>
    <ns1:shortFee>10</ns1:shortFee>
    <ns1:brokerage/>
    <ns1:interestRate>5.75</ns1:interestRate>
    <ns1:rebate/>
    </ns1:fees>
    <ns1:lastStatement/>
    <ns1:status>ACTIVE</ns1:status>
    <ns1:contact primary="*Y*" ><ns1:contactId>2529</ns1:contactId>
    <ns1:partyId>13</ns1:partyId>
    <ns1:title>Lord</ns1:title>
    <ns1:given/>
    <ns1:surname>Dorman</ns1:surname>
    <ns1:phone1>5555 5555</ns1:phone1>
    <ns1:phone2>5555 5554</ns1:phone2>
    <ns1:fax/>
    <ns1:mobile>9999 9999 99</ns1:mobile>
    <ns1:email>foo (AT) bar (DOT) com</ns1:email>
    </ns1:contact>
    <ns1:address primary="*Y*" ><ns1:siteId>1717</ns1:siteId>
    <ns1:partyId>13</ns1:partyId>
    <ns1:description>asdfasdf</ns1:description>
    <ns1:line1/>
    <ns1:line2>1 Elizabeth Street</ns1:line2>
    <ns1:city>Sydney</ns1:city>
    <ns1:state>NSW</ns1:state>
    <ns1:postcode>2000</ns1:postcode>
    <ns1:country>AU</ns1:country>
    </ns1:address>
    </client:ClientDetails>
    </>
    I found a Jira issue that seems to be related but I don't really follow the
    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.
  • No.1 | | 5010 bytes | |

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

    5/11/06, Dan Washusen <dan.washusen (AT) gmail (DOT) comwrote:

    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 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(
    ): Caused an ERRR
    [junit] java.lang.RuntimeException: Unexpected subelement fees
    [junit] java.lang.RuntimeException: java.lang.RuntimeException:
    Unexpected subelement fees
    [junit] at (
    )
    [junit] at (
    )
    [junit] at
    (
    )
    [junit] Caused by: java.lang.RuntimeException: Unexpected subelement
    fees
    [junit] at
    $Factory.parse(
    ClientDetailsType.java :579)
    [junit] at
    $Factory.parse
    ()
    [junit] at (
    )
    [junit] 17 more
    --
    My XSD looks like this (well here's the relevant bit of it):

    <xsd:complexType name="ClientDetailsType">
    <xsd:sequence>
    <xsd:element name="partyId" type="xsd:long"/>
    <xsd:element name="externalId" type="xsd:string"/>
    <xsd:element name="description" type="xsd:string"
    nillable="true"/>
    <xsd:element name="company" type="xsd:string" nillable="true"/>
    <xsd:element name="abnacn" type="xsd:string" nillable="true"/>
    <xsd:element name="cmtAccount1Id" type="xsd:long"
    nillable="true"/>
    <xsd:element name="cmtAccount2Id" type="xsd:long"
    nillable="true"/>
    <xsd:element name="contact" type="ContactType" nillable="true"
    ="1" ="unbounded"/>
    <xsd:element name="address" type="SiteType" nillable="true"
    ="1" ="unbounded"/>
    <xsd:element name="fees" type="ClientFeesType"/>
    <xsd:element name="lastStatement" type="xsd:date"
    nillable="true"/>
    <xsd:element name="status" type="status" nillable="true"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ClientFeesType">
    <xsd:sequence>
    <xsd:element name="lineFee" type="xsd:decimal" nillable="true"/>
    <xsd:element name="shortFee" type="xsd:decimal" nillable="true"/>
    <xsd:element name="brokerage" type="xsd:decimal" nillable="true"/>

    <xsd:element name="interestRate" type="xsd:decimal"
    nillable="true"/>
    <xsd:element name="rebate" type="xsd:decimal" nillable="true"/>
    </xsd:sequence>
    </xsd:complexType>
    >
    >
    >

    And the SAP envelope looks like this:

    <><client:StatusMsg ><ns1:Status>0</
    ns1:Status >
    <ns1:StatusDetailedMsg/>
    </client:StatusMsg >
    <client:ClientDetails><ns1:partyId >13</ns1:partyId>
    <ns1:externalId >TEST1</ns1:externalId>
    <ns1:description >Client 1</ns1:description>
    <ns1:company />
    <ns1:abnacn/>
    <ns1:fees ><ns1:lineFee>7.5</ns1:lineFee >
    <ns1:shortFee>10</ns1:shortFee >
    <ns1:brokerage/>
    <ns1:interestRate >5.75</ns1:interestRate>
    <ns1:rebate />
    </ns1:fees>
    <ns1:lastStatement />
    <ns1:status>ACTIVE</ns1:status >
    <ns1:contact primary="*Y*" ><ns1:contactId>2529</ns1:contactId >
    <ns1:partyId>13</ns1:partyId >
    <ns1:title>Lord</ns1:title >
    <ns1:given/>
    <ns1:surname >Dorman</ns1:surname>
    <ns1:phone1 >5555 5555</ns1:phone1>
    <ns1:phone2 >5555 5554</ns1:phone2>
    <ns1:fax />
    <ns1:mobile>9999 9999 99</ ns1:mobile>
    <ns1:email>foo (AT) bar (DOT) com </ns1:email>
    </ns1:contact>
    <ns1:address primary="*Y*" ><ns1:siteId>1717</ns1:siteId >
    <ns1:partyId>13</ns1:partyId >
    <ns1:description>asdfasdf</ns1:description >
    <ns1:line1/>
    <ns1:line2>1 Elizabeth Street</ns1:line2>
    <ns1:city>Sydney</ns1:city>
    <ns1:state>NSW</ns1:state>
    <ns1:postcode>2000</ns1:postcode>
    <ns1:country>AU</ns1:country>
    </ ns1:address>
    </client:ClientDetails>
    </>
    --
    I found a Jira issue that seems to be related but I don't really follow
    the 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.
    >
    >
    >
  • No.2 | | 2636 bytes | |

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

    I'm not getting:

    [junit] Testcase: testprocess(
    ): Caused an ERRR
    [junit] For input string: ""
    [junit] java.lang.RuntimeException:
    For input string: ""
    [junit] at (
    )
    [junit] at (
    )
    [junit] at (
    )
    [junit] Caused by: For input string:
    ""
    [junit] at (
    NumberFormatException.java:48)
    [junit] at java.lang.Long.parseLong(Long.java:415)
    [junit] at java.lang.Long.parseLong(Long.java:452)
    [junit] at
    (
    ConverterUtil.java:269)
    [junit] at
    $Factory.parse(
    ClientDetailsType.java:571)
    [junit] at
    $Factory.parse
    (RetrieveClien
    )
    [junit] at (
    )
    [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 SAP envelope doesn't adhere to the XSD" or something

    5/12/06, Sanjiva Weerawarana <sanjiva (AT) opensource (DOT) lkwrote:

    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
    --
    <xsd:element name="company" type="xsd:string"
    nillable="true"/>
    <xsd:element name="abnacn" type="xsd:string"
    nillable="true"/>
    <xsd:element name="cmtAccount1Id" type="xsd:long"
    nillable="true"/>
    <xsd:element name="cmtAccount2Id" type="xsd:long"
    nillable="true"/>
    <xsd:element name="contact" type="ContactType"
    nillable="true" ="1" ="unbounded"/>
    <xsd:element name="address" type="SiteType"
    nillable="true" ="1" ="unbounded"/>
    <xsd:element name="fees" type="ClientFeesType"/>

    So according to your schema, before the <feeselement, there must be at
    least one <contactelement and an <addresselement.

    <ns1:company/>
    <ns1:abnacn/>
    <ns1:fees>
    <ns1:lineFee>7.5</ns1:lineFee>
    <ns1:shortFee>10</ns1:shortFee>
    <ns1:brokerage/>
    <ns1:interestRate>5.75</ns1:interestRate>
    <ns1:rebate/>
    </ns1:fees>

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

    Sanjiva.
    >
    >
    >
  • No.3 | | 1343 bytes | |

    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

    <xsd:element name="company" type="xsd:string"
    nillable="true"/
    <xsd:element name="abnacn" type="xsd:string"
    nillable="true"/>
    <xsd:element name="cmtAccount1Id" type="xsd:long"
    nillable="true"/
    <xsd:element name="cmtAccount2Id" type="xsd:long"
    nillable="true"/>
    <xsd:element name="contact" type="ContactType"
    nillable="true" ="1" ="unbounded"/
    <xsd:element name="address" type="SiteType"
    nillable="true" ="1" ="unbounded"/>
    <xsd:element name="fees" type="ClientFeesType"/

    So according to your schema, before the <feeselement, there must be at
    least one <contactelement and an <addresselement.

    <ns1:company/>
    <ns1:abnacn/>
    <ns1:fees>
    <ns1:lineFee>7.5</ns1:lineFee>
    <ns1:shortFee>10</ns1:shortFee>
    <ns1:brokerage/>
    <ns1:interestRate>5.75</ns1:interestRate>
    <ns1:rebate/>
    </ns1:fees>

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

    Sanjiva.
  • No.4 | | 5331 bytes | |

    Here is the wsdl2java call:
    <wsdl2java output="${target.dir}/output" testcase="true"
    unpackClasses="true" wsdlfilename="
    "
    />

    I've also attached the wsdl

    Cheers,
    Dan

    5/12/06, robert lazarski <robertlazarski (AT) gmail (DOT) comwrote:

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

    --
    5/11/06, Dan Washusen <dan.washusen (AT) gmail (DOT) comwrote:

    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
    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(
    ): Caused an ERRR
    [junit] java.lang.RuntimeException: Unexpected subelement fees
    [junit] java.lang.RuntimeException: java.lang.RuntimeException:
    Unexpected subelement fees
    [junit] at (
    )
    [junit] at (
    )
    [junit] at
    (
    )
    [junit] Caused by: java.lang.RuntimeException: Unexpected
    subelement fees
    [junit] at
    $Factory.parse(
    ClientDetailsType.java :579)
    [junit] at
    $Factory.parse
    ()
    [junit] at (
    )
    [junit] 17 more
    --
    My XSD looks like this (well here's the relevant bit of it):

    <xsd:complexType name="ClientDetailsType">
    <xsd:sequence>
    <xsd:element name="partyId" type="xsd:long"/>
    <xsd:element name="externalId" type="xsd:string"/>
    <xsd:element name="description" type="xsd:string"
    nillable="true"/>
    <xsd:element name="company" type="xsd:string" nillable="true"/>
    <xsd:element name="abnacn" type="xsd:string" nillable="true"/>
    <xsd:element name="cmtAccount1Id" type="xsd:long"
    nillable="true"/>
    <xsd:element name="cmtAccount2Id" type="xsd:long"
    nillable="true"/>
    <xsd:element name="contact" type="ContactType" nillable="true"
    ="1" ="unbounded"/>
    <xsd:element name="address" type="SiteType" nillable="true"
    ="1" ="unbounded"/>
    <xsd:element name="fees" type="ClientFeesType"/>
    <xsd:element name="lastStatement" type="xsd:date"
    nillable="true"/>
    <xsd:element name="status" type="status" nillable="true"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ClientFeesType">
    <xsd:sequence>
    <xsd:element name="lineFee" type="xsd:decimal" nillable="true"/>

    <xsd:element name="shortFee" type="xsd:decimal"
    nillable="true"/>
    <xsd:element name="brokerage" type="xsd:decimal"
    nillable="true"/>
    <xsd:element name="interestRate" type="xsd:decimal"
    nillable="true"/>
    <xsd:element name="rebate" type="xsd:decimal" nillable="true"/>
    </xsd:sequence>
    </xsd:complexType>
    >
    >
    >

    And the SAP envelope looks like this:

    <><client:StatusMsg ><ns1:Status>0
    </ns1:Status >
    <ns1:StatusDetailedMsg/>
    </client:StatusMsg >
    <client:ClientDetails><ns1:partyId >13</ns1:partyId>
    <ns1:externalId >TEST1</ns1:externalId>
    <ns1:description >Client 1</ns1:description>
    <ns1:company />
    <ns1:abnacn/>
    <ns1:fees ><ns1:lineFee>7.5</ns1:lineFee >
    <ns1:shortFee>10</ns1:shortFee >
    <ns1:brokerage/>
    <ns1:interestRate >5.75</ns1:interestRate>
    <ns1:rebate />
    </ns1:fees>
    <ns1:lastStatement />
    <ns1:status>ACTIVE</ns1:status >
    <ns1:contact primary="*Y*" ><ns1:contactId>2529</ns1:contactId >
    <ns1:partyId>13</ns1:partyId >
    <ns1:title>Lord</ns1:title >
    <ns1:given/>
    <ns1:surname >Dorman</ns1:surname>
    <ns1:phone1 >5555 5555</ns1:phone1>
    <ns1:phone2 >5555 5554</ns1:phone2>
    <ns1:fax />
    <ns1:mobile>9999 9999 99</ ns1:mobile>
    <ns1:email>foo (AT) bar (DOT) com </ns1:email>
    </ns1:contact>
    <ns1:address primary="*Y*" ><ns1:siteId>1717</ns1:siteId >
    <ns1:partyId>13</ns1:partyId >
    <ns1:description>asdfasdf</ns1:description >
    <ns1:line1/>
    <ns1:line2>1 Elizabeth Street</ns1:line2>
    <ns1:city>Sydney</ns1:city>
    <ns1:state>NSW</ns1:state>
    <ns1:postcode>2000</ns1:postcode>
    <ns1:country>AU</ns1:country>
    </ ns1:address>
    </client:ClientDetails>
    </>
    --
    I found a Jira issue that seems to be related but I don't really follow
    the 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.
    >
    >
    >
    >
  • No.5 | | 3244 bytes | |

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

    I found #c2 but it seems a
    little cumbersome/crap

    5/12/06, Dennis Sosnoski <dms (AT) sosnoski (DOT) comwrote:

    And the new error is very likely because your SAP message has an empty
    <ns1:brokerage/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 SAP envolope

    I'm not getting:

    [junit] Testcase:
    testprocess(): Caused
    an ERRR
    [junit] For input string: ""
    [junit] java.lang.RuntimeException:
    : For input string: ""
    [junit] at
    (
    )
    [junit] at
    (
    RetrieveClientDetailsStub.java
    :114)
    [junit] at
    (
    )
    [junit] Caused by: For input
    string: ""
    [junit] at
    (
    NumberFormatException.java:48)
    [junit] at java.lang.Long.parseLong(Long.java:415)
    [junit] at java.lang.Long.parseLong(Long.java:452)
    [junit] at
    (
    ConverterUtil.java:269)
    [junit] at
    $Factory.parse(
    ClientDetailsType.java:571)
    [junit] at

    $Factory.parse
    (RetrieveClien
    )
    [junit] at
    (
    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 SAP envelope doesn't adhere to the XSD" or something
    >
    >
    >

    5/12/06, * Sanjiva Weerawarana* <sanjiva (AT) opensource (DOT) lk
    <mailto:sanjiva (AT) opensource (DOT) lk>wrote:

    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
    --
    <xsd:element name="company" type="xsd:string"
    nillable="true"/>
    <xsd:element name="abnacn" type="xsd:string"
    nillable="true"/>
    <xsd:element name="cmtAccount1Id" type="xsd:long"
    nillable="true"/>
    <xsd:element name="cmtAccount2Id" type="xsd:long"
    nillable="true"/>
    <xsd:element name="contact" type="ContactType"
    nillable="true" ="1" ="unbounded"/>
    <xsd:element name="address" type="SiteType"
    nillable="true" ="1" ="unbounded"/>
    <xsd:element name="fees" type="ClientFeesType"/>

    So according to your schema, before the <feeselement, there must
    be at
    least one <contactelement and an <addresselement.

    <ns1:company/>
    <ns1:abnacn/>
    <ns1:fees>
    <ns1:lineFee>7.5</ns1:lineFee>
    <ns1:shortFee>10</ns1:shortFee>
    <ns1:brokerage/>
    <ns1:interestRate5.75</ns1:interestRate>
    <ns1:rebate/>
    </ns1:fees>

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

    Sanjiva.
    >
    >
    >
    >
  • No.6 | | 2959 bytes | |

    And the new error is very likely because your SAP message has an empty
    <ns1:brokerage/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 SAP envolope

    I'm not getting:

    [junit] Testcase:
    testprocess(): Caused
    an ERRR
    [junit] For input string: ""
    [junit] java.lang.RuntimeException:
    : For input string: ""
    [junit] at
    ()
    [junit] at
    (RetrieveClientDetailsStub.java
    :114)
    [junit] at
    ()
    [junit] Caused by: For input
    string: ""
    [junit] at
    (NumberFormatException.java:48)
    [junit] at java.lang.Long.parseLong(Long.java:415)
    [junit] at java.lang.Long.parseLong(Long.java:452)
    [junit] at
    (ConverterUtil.java:269)
    [junit] at
    $Factory.parse(ClientDetailsType.java:571)
    [junit] at
    $Factory.parse(RetrieveClien
    )
    [junit] at
    (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 SAP envelope doesn't adhere to the XSD" or something

    --
    5/12/06, * Sanjiva Weerawarana* <sanjiva (AT) opensource (DOT) lk
    <mailto:sanjiva (AT) opensource (DOT) lk>wrote:

    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
    --
    <xsd:element name="company" type="xsd:string"
    nillable="true"/>
    <xsd:element name="abnacn" type="xsd:string"
    nillable="true"/>
    <xsd:element name="cmtAccount1Id" type="xsd:long"
    nillable="true"/>
    <xsd:element name="cmtAccount2Id" type="xsd:long"
    nillable="true"/>
    <xsd:element name="contact" type="ContactType"
    nillable="true" ="1" ="unbounded"/>
    <xsd:element name="address" type="SiteType"
    nillable="true" ="1" ="unbounded"/>
    <xsd:element name="fees" type="ClientFeesType"/>

    So according to your schema, before the <feeselement, there must
    be at
    least one <contactelement and an <addresselement.

    <ns1:company/>
    <ns1:abnacn/>
    <ns1:fees>
    <ns1:lineFee>7.5</ns1:lineFee>
    <ns1:shortFee>10</ns1:shortFee>
    <ns1:brokerage/>
    <ns1:interestRate5.75</ns1:interestRate>
    <ns1:rebate/>
    </ns1:fees>

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

    Sanjiva.
    >
    >
    >
  • No.7 | | 4539 bytes | |

    You have the element defined with nillable="true", so the correct way to
    do this is <ns1:brokerage xsi:nil="true"/>, where the xsi prefix is set
    to the schema instance namespace
    "" (the prefix can be
    different, but the namespace has to be exactly as given).

    Personally, I prefer using ="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
    ="0" says you can just leave the element out of the document if
    it doesn't have a value, while nillable="true" without ="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
    SA, 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 #c2 but it
    seems a little cumbersome/crap

    5/12/06, *Dennis Sosnoski* <dms (AT) sosnoski (DOT) com
    <mailto:dms (AT) sosnoski (DOT) com>wrote:

    And the new error is very likely because your SAP message has an
    empty
    <ns1:brokerage/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 SAP envolope

    I'm not getting:

    [junit] Testcase:
    testprocess(): Caused
    an ERRR
    [junit] For input
    string: ""
    [junit] java.lang.RuntimeException:
    : For input string: ""
    [junit] at

    ()
    [junit] at

    (RetrieveClientDetailsStub.java

    :114)
    [junit] at

    ()
    [junit] Caused by: For
    input
    string: ""
    [junit] at

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

    (ConverterUtil.java:269)
    [junit] at

    $Factory.parse(ClientDetailsType.java:571)
    [junit] at

    $Factory.parse
    (RetrieveClien
    )
    [junit] at

    (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 SAP envelope doesn't adhere to the XSD" or
    something
    >
    >
    >

    5/12/06, * Sanjiva Weerawarana* <sanjiva (AT) opensource (DOT) lk
    <mailto:sanjiva (AT) opensource (DOT) lk>
    <mailto:sanjiva (AT) opensource (DOT) lk <mailto:sanjiva (AT) opensource (DOT) lk
    wrote:

    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
    --
    <xsd:element name="company" type="xsd:string"
    nillable="true"/>
    <xsd:element name="abnacn" type="xsd:string"
    nillable="true"/>
    <xsd:element name="cmtAccount1Id"
    type="xsd:long"
    nillable="true"/>
    <xsd:element name="cmtAccount2Id"
    type="xsd:long"
    nillable="true"/>
    <xsd:element name="contact" type="ContactType"
    nillable="true" ="1" ="unbounded"/>
    <xsd:element name="address" type="SiteType"
    nillable="true" ="1" ="unbounded"/>
    <xsd:element name="fees"
    type="ClientFeesType"/>

    So according to your schema, before the <feeselement,
    there must
    be at
    least one <contactelement and an <addresselement.

    <ns1:company/>
    <ns1:abnacn/>
    <ns1:fees>
    <ns1:lineFee>7.5</ns1:lineFee>
    <ns1:shortFee>10</ns1:shortFee>
    <ns1:brokerage/>
    <ns1:interestRate5.75</ns1:interestRate>
    <ns1:rebate/>
    </ns1:fees>

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

    Sanjiva.
    >
    >
    >
    >
    >

Re: Axis2: Unexpected subelement fees


max 4000 letters.
Your nickname that display:
In order to stop the spam: 4 + 3 =
QUESTION ON "Apache"

EMSDN.COM