Hi there,

I have been working with Axis to create a wrapped (document/literal) service 
and I have noticed a strange problem that perhaps someone can explain to me.  
If I have the following XML schema snippet:

<xsd:schema
    xmlns:book="http://pshillan.dyndns.org/web/book";
    xmlns="http://pshillan.dyndns.org/web/book";
    targetNamespace="http://pshillan.dyndns.org/web/book";
  <xsd:complexType name="bookType">
    <xsd:sequence>
      <xsd:element name="title" type="xsd:string"/>
      <xsd:element name="author" type="xsd:string"/>
      <xsd:element name="isbn" type="xsd:string"/>
      <xsd:element name="month" type="xsd:string"/>
      <xsd:element name="year" type="xsd:short"/>
      <xsd:element name="publisher" type="xsd:string"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>

The element names for the Axis generated WSDL are something like:

<element name="bookType>title"/>

which is bogus because of the '>' in the middle.  All is well if I use the 
following though:

<xsd:schema
    xmlns:book="http://pshillan.dyndns.org/web/book";
    xmlns="http://pshillan.dyndns.org/web/book";
    targetNamespace="http://pshillan.dyndns.org/web/book";
  <xsd:element name="title" type="xsd:string"/>
  <xsd:element name="author" type="xsd:string"/>
  <xsd:element name="isbn" type="xsd:string"/>
  <xsd:element name="month" type="xsd:string"/>
  <xsd:element name="year" type="xsd:short"/>
  <xsd:element name="publisher" type="xsd:string"/>

  <xsd:complexType name="bookType">
    <xsd:sequence>
      <xsd:element ref="book:title"/>
      <xsd:element ref="book:author"/>
      <xsd:element ref="book:isbn"/>
      <xsd:element ref="book:month"/>
      <xsd:element ref="book:year"/>
      <xsd:element ref="book:publisher"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>

Can someone tell me why the latter works but the former does not?

Cheers,

Peter Shillan.

Reply via email to