You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Damir Suban <da...@t-mobile.hr> on 2004/12/10 10:54:10 UTC

WSDL problem

Hi all!

I have installed Axis 1.1, and I am pretty new to Axis. It has worked well
for me so far, but I have found something that looks strange to me. 

In the following WSDL file fragment, 

<xsd:element name="termElem" type="termType"/>

<xsd:simpleType name="termType">
	<xsd:restriction base="xsd:string">
		<xsd:pattern value="[0-9]"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="maliIntType">
	<xsd:restriction base="xsd:integer">
		<xsd:minInclusive value="0"/>
		<xsd:maxInclusive value="100"/>
	</xsd:restriction>
</xsd:simpleType>

I have put some restrictions on the string and integer types, but somehow
Axis does not accept this. It generates both types as Java classes
"TermType" and "MaliIntType", but when I call the service, it accepts
anything (e.g. letters for TermType, numbers larger than 100 for
MaliIntType). When I call the service with the ?wsdl, I get this:

<complexType name="termType">
 <simpleContent>
  <extension base="xsd:string" /> 
  </simpleContent>
</complexType>

<complexType name="maliIntType">
<simpleContent>
  <extension base="xsd:integer" /> 
</simpleContent>
</complexType>

Obvously, Axis didn't get it... Or I am doing something wrong.

On the other hand, if I create the restriction like this:

<xsd:simpleType name="termType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="01"/>
		<xsd:enumeration value="02"/>
		<xsd:enumeration value="03"/>
	</xsd:restriction>
</xsd:simpleType>

everything goes well. Any suggestions? This part of WSDL functionality is
vital for our usage, so please help! Thanks in advance!
 
 
T-Mobile Hrvatska
Sektor za IT (T6)

Damir Suban
Ulica grada Vukovara 23
HR-10 000 Zagreb, Hrvatska
+385 98 262604 (Moj T-Mobile)
+385 1 4984326 (tel)
+385 1 4983666 (faks)
E-Mail: damir.suban@t-mobile.hr 
www.t-mobile.hr



RE: WSDL problem

Posted by Damir Suban <da...@t-mobile.hr>.
I've just found that my problem was actually a bug in Axis (#Axis-346). 


-----Original Message-----
From: Damir Suban [mailto:damir.suban@t-mobile.hr] 
Sent: Friday, December 10, 2004 10:54 AM
To: axis-user@ws.apache.org
Subject: WSDL <restriction> problem

Hi all!

I have installed Axis 1.1, and I am pretty new to Axis. It has worked well
for me so far, but I have found something that looks strange to me. 

In the following WSDL file fragment, 

<xsd:element name="termElem" type="termType"/>

<xsd:simpleType name="termType">
	<xsd:restriction base="xsd:string">
		<xsd:pattern value="[0-9]"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="maliIntType">
	<xsd:restriction base="xsd:integer">
		<xsd:minInclusive value="0"/>
		<xsd:maxInclusive value="100"/>
	</xsd:restriction>
</xsd:simpleType>

I have put some restrictions on the string and integer types, but somehow
Axis does not accept this. It generates both types as Java classes
"TermType" and "MaliIntType", but when I call the service, it accepts
anything (e.g. letters for TermType, numbers larger than 100 for
MaliIntType). When I call the service with the ?wsdl, I get this:

<complexType name="termType">
 <simpleContent>
  <extension base="xsd:string" /> 
  </simpleContent>
</complexType>

<complexType name="maliIntType">
<simpleContent>
  <extension base="xsd:integer" /> 
</simpleContent>
</complexType>

Obvously, Axis didn't get it... Or I am doing something wrong.

On the other hand, if I create the restriction like this:

<xsd:simpleType name="termType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="01"/>
		<xsd:enumeration value="02"/>
		<xsd:enumeration value="03"/>
	</xsd:restriction>
</xsd:simpleType>

everything goes well. Any suggestions? This part of WSDL functionality is
vital for our usage, so please help! Thanks in advance!
 
 
T-Mobile Hrvatska
Sektor za IT (T6)

Damir Suban
Ulica grada Vukovara 23
HR-10 000 Zagreb, Hrvatska
+385 98 262604 (Moj T-Mobile)
+385 1 4984326 (tel)
+385 1 4983666 (faks)
E-Mail: damir.suban@t-mobile.hr 
www.t-mobile.hr