Hello, this is a repost.
I hope somebody can help me: How to perform a validation of the resquest 
parameters against according to the wsdl schema ?


am writing wsdl to generate both client and server side java code.
wsdl is xml and supporte schemas.
With schema we can apply some restrictions also called facets to data like:
  <xsd:simpleType name="cardNumberType">
      <xsd:restriction base="xsd:string">
           <xsd:pattern value="[0-9]{16}"/>
      </xsd:restriction>
  </xsd:simpleType>
I am using beta2.
For each type with a restriction, wsdl2java generate a Class describing the 
type:
  public class CardNumberType implements java.io.Serializable, 
org.apache.axis.encoding.SimpleType {
      private java.lang.String value;
      public CardNumberType()...
      public java.lang.String getValue()..
      public void setValue(java.lang.String value)...
      public CardNumberType(java.lang.String value)
      private Object __equalsCalc = null;
      public synchronized boolean equals(Object obj)...
      private boolean __hashCodeCalc = false;
      public synchronized int hashCode()...
      public static org.apache.axis.encoding.Serializer getSerializer()..
      public static org.apache.axis.encoding.Deserializer getDeserializer()..
  }

That 's good, but the generated class doesn't check the format to be sure 
it is valid with the wsdl/schema definition.
If the request send a "malformed" data, all is working without any "format 
error", that is, there is no automatic validation of the data performed by 
axis based on the wsdl and the schema.

How can I perform this validation, should I:
- add the validation in each Class type generate by the wsdl2java?
or
- create an handler that parse the request and validate it accordingly to 
the wsdl and schema?
or
- other idea?
Is there something planed to do the job in further version?
Or did I miss something ?

Many thanks,
Cedric

Reply via email to