axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Russell Butek" <bu...@us.ibm.com>
Subject Re: interpretation of minoccurs/maxoccurs in sequence elements
Date Wed, 30 Jan 2002 20:50:22 GMT
After a bit more investigation, I've discovered that we must treat this as
an array of Strings rather than just a String.  String happens to work OK
because a String can be null, in other words, occur 0 times.  But what
about minOccurs=0 maxOccurs=1 type=xsd:int?  You cannot say an int occurs 0
times.  But an array of int can have 0 elements.

I'm still working on what AXIS sends vs what it should send, and why it
fails.

Russell Butek
butek@us.ibm.com


Simon Fell <soap@zaks.demon.co.uk> on 01/29/2002 11:12:08 AM

Please respond to axis-dev@xml.apache.org

To:    axis-dev@xml.apache.org
cc:
Subject:    Re: interpretation of minoccurs/maxoccurs in sequence elements



looking through the WSDL, its using doc/literal with element
references in the parts, so with

<message name="GetCardTypeSoapIn">
  <part name="parameters" element="s0:GetCardType" />
</message>

<s:element name="GetCardType">
  <s:complexType>
    <s:sequence>
      <s:element minOccurs="0" maxOccurs="1"
  name="CardNumber" type="s:string" />
    </s:sequence>
  </s:complexType>
</s:element>

The correct serializations are
[occurs=0]
<ns:GetCardType>
</ns:GetCardType>

or [occurs=1]
<ns:GetCardType>
<ns:CardNumber>1234</ns:CardNumber>
</ns:GetCardType>

Cheers
Simon
www.pocketsoap.com

On Tue, 29 Jan 2002 09:49:32 -0600, in soap you wrote:

>(I'm cross posting this to axis-dev.)
>
>Matthew, do you know whether this is a common convention?  It's ALMOST the
>same as nillable=true and from my knowledge, that is more prevalent.
>
>The spec is probably too loose here.  What do other folks think?  How
>should this type be interpreted?
>
>Russell Butek
>butek@us.ibm.com
>
>
>"J. Matthew Pryor" <matthew_pryor@versata.com> on 01/27/2002 09:36:45 PM
>
>Please respond to axis-user@xml.apache.org
>
>To:    <axis-user@xml.apache.org>
>cc:
>Subject:    interpretation of minoccurs/maxoccurs in sequence elements
>
>
>
>Hello,
>
>The WSDL at this address (
>http://www.richsolutions.com/RichPayments/RichCardValidator.asmx?WSDL )
>uses
>a convention to define the input type of certain operations
>
><s:element name="GetCardType">
>  <s:complexType>
>    <s:sequence>
>      <s:element minOccurs="0" maxOccurs="1" name="CardNumber"
>type="s:string" />
>    </s:sequence>
>  </s:complexType>
></s:element>
>
>Now WSDL2Java interprets that as meaning an Array of java.lang.String with
>Zero or One elements and generates code that marshals it as such, i.e.
>
><CardNumber>
>  <item>1111222233334444</item>
></CardNumber>
>
>However invoking this service returns an error
>
>    <soap:Fault>
>      <faultcode>soap:Client</faultcode>
>      <faultstring>Server was unable to read request. --&gt; There is an
>error in XML document (6, 6). --&gt; 'Element' is an invalid node type.
>Line
>6, position 6.</faultstring>
>      <detail />
>    </soap:Fault>
>
>If I change the WSDL to specify exactly one in the sequence element i.e.
><s:element name="GetCardType">
>  <s:complexType>
>    <s:sequence>
>      <s:element minOccurs="1" maxOccurs="1" name="CardNumber"
>type="s:string" />
>    </s:sequence>
>  </s:complexType>
></s:element>
>
>Of course I get code generated that just expects a single String, and I
can
>invoke the service without error.
>
>My question is this, who is mis-interpreting the XML Schema to Java type
>mapping ?
>
>I must confess I really don't know what standard this would be covered
>under.
>
>I can imagine that this may be under-specified and we have to differing
>interpretations, but I was wondering if there is a definitive statement.
>
>I have very little .Net experience, but many of the .Net services I have
>seen WSDL for use this convention and it would be nice for AXIS developed
>clients to be able to inter-operate.
>
>Thanks for any clarification
>
>Matthew
>---
>
>




Mime
View raw message