Please try with a nighly build. I build with the current code base.
And the generated EndUserIdenfier class has the following method
public void setEndUserIdentifier(java.lang.String param) {
if ((1 <= java.lang.String.valueOf(param).length()) && (
java.lang.String.valueOf(param).length() <= 255)) {
this.localEndUserIdentifier = param;
} else {
throw new java.lang.RuntimeException();
}
}
so this is checked at the setter method.
thanks,
Amila.
On Thu, Mar 6, 2008 at 6:21 AM, David Bunzli <[EMAIL PROTECTED]>
wrote:
> Hi all,
>
> I haven't been able to get restrictions to consistently work -
> enumerations work, but not length restrictions. I've tried both Axis2
> v1.1.1 (my production version) and Axis2 v1.3 (just in case v1.3 fixed
> this) with no success. Does anyone have any ideas why?
>
> To help, here are the relevant types...
>
> <!-- This restriction works. The generated class checks for these
> values -->
> <xsd:simpleType name="CrlChecking">
> <xsd:restriction base="xsd:string">
> <xsd:enumeration value="Not required" />
> <xsd:enumeration value="Desirable" />
> <xsd:enumeration value="Mandatory" />
> </xsd:restriction>
> </xsd:simpleType>
>
> <!-- This restriction doesn't work. The generated class doesn't contain
> any length checks -->
> <xsd:simpleType name="EndUserIdentifier">
> <xsd:restriction base="xsd:string">
> <xsd:minLength value="1" />
> <xsd:maxLength value="255" />
> </xsd:restriction>
> </xsd:simpleType>
>
> Here is the complete WSDL...
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <wsdl:definitions
> xmlns:eSig="urn:SigningServices_v1_0_0.secureServices.health.qld.gov.au"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
> name="SigningServices_v1_0_0"
>
>
> targetNamespace="urn:SigningServices_v1_0_0.secureServices.health.qld.gov.au">
> <wsdl:types>
> <xsd:schema
>
>
> targetNamespace="urn:SigningServices_v1_0_0.secureServices.health.qld.gov.au"
>
> xmlns:eSig="urn:SigningServices_v1_0_0.secureServices.health.qld.gov.au">
> <xsd:import namespace="http://www.w3.org/2005/05/xmlmime"
> schemaLocation="xmlmime.xsd" />
>
> <!-- This restriction works -->
> <xsd:simpleType name="CrlChecking">
> <xsd:restriction base="xsd:string">
> <xsd:enumeration value="Not required" />
> <xsd:enumeration value="Desirable" />
> <xsd:enumeration value="Mandatory" />
> </xsd:restriction>
> </xsd:simpleType>
>
> <!-- This restriction doesn't work -->
> <xsd:simpleType name="EndUserIdentifier">
> <xsd:restriction base="xsd:string">
> <xsd:minLength value="1" />
> <xsd:maxLength value="255" />
> </xsd:restriction>
> </xsd:simpleType>
>
> <xsd:complexType name="Document">
> <xsd:sequence>
> <xsd:element name="ID" type="xsd:string" minOccurs="1" maxOccurs="1"
> />
> <xsd:element name="File" type="xmime:base64Binary" minOccurs="1"
> maxOccurs="1" xmime:expectedContentTypes="application/binary" />
> <xsd:element name="Filename" type="xsd:string" minOccurs="1"
> maxOccurs="1" />
> </xsd:sequence>
> </xsd:complexType>
>
> <xsd:complexType name="Certificate">
> <xsd:sequence>
> <xsd:element name="Issuer" type="xsd:string" minOccurs="1"
> maxOccurs="1" />
> <xsd:element name="Subject" type="xsd:string" minOccurs="1"
> maxOccurs="1" />
> <xsd:element name="SerialNumber" type="xsd:string" minOccurs="0"
> maxOccurs="1" />
> <xsd:element name="ValidFrom" type="xsd:dateTime" minOccurs="0"
> maxOccurs="1" />
> <xsd:element name="ValidTo" type="xsd:dateTime" minOccurs="0"
> maxOccurs="1" />
> </xsd:sequence>
> </xsd:complexType>
>
> <xsd:element name="VerifyRequest">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="SignID" type="xsd:long" minOccurs="1"
> maxOccurs="1" />
> <xsd:element name="EndUserIdentifier" type="eSig:EndUserIdentifier"
> minOccurs="1" maxOccurs="1" />
> <xsd:element name="Document" type="eSig:Document" minOccurs="1"
> maxOccurs="2" />
> <xsd:element name="CrlChecking" type="eSig:CrlChecking"
> minOccurs="0" maxOccurs="1" />
> <xsd:element name="SignatoryDetailsRequired" type="xsd:boolean"
> minOccurs="0" maxOccurs="1" />
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
>
> <xsd:element name="VerifyResponse">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="RequestID" type="xsd:string" minOccurs="0"
> maxOccurs="1" />
> <xsd:element name="isVerified" type="xsd:boolean" minOccurs="1"
> maxOccurs="1" />
> <xsd:element name="CrlStatus" type="xsd:string" minOccurs="0"
> maxOccurs="1" />
> <xsd:element name="Certificate" type="eSig:Certificate"
> maxOccurs="1" minOccurs="0" />
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
>
>
> <xsd:complexType name="SigningServiceError">
> <xsd:sequence>
> <xsd:element minOccurs="0" maxOccurs="1" name="RequestID"
> type="xsd:string" />
> <xsd:element minOccurs="1" maxOccurs="1" name="Fault"
> type="xsd:string" />
> <xsd:element minOccurs="1" maxOccurs="1" name="Datetime"
> type="xsd:dateTime" />
> </xsd:sequence>
> </xsd:complexType>
>
> <xsd:element name="ApplicationError" type="eSig:SigningServiceError" />
> <xsd:element name="SystemError" type="eSig:SigningServiceError" />
> </xsd:schema>
> </wsdl:types>
>
> <wsdl:message name="VerifyRequest">
> <wsdl:part name="parameters" element="eSig:VerifyRequest" />
> </wsdl:message>
> <wsdl:message name="VerifyResponse">
> <wsdl:part name="parameters" element="eSig:VerifyResponse" />
> </wsdl:message>
> <wsdl:message name="ApplicationError">
> <wsdl:part element="eSig:ApplicationError" name="appFault" />
> </wsdl:message>
> <wsdl:message name="SystemError">
> <wsdl:part element="eSig:SystemError" name="sysFault" />
> </wsdl:message>
>
> <wsdl:portType name="SigningServices_v1_0_0">
> <wsdl:operation name="Verify">
> <wsdl:input message="eSig:VerifyRequest" />
> <wsdl:output message="eSig:VerifyResponse" />
> <wsdl:fault name="ApplicationError" message="eSig:ApplicationError" />
> <wsdl:fault name="SystemError" message="eSig:SystemError" />
> </wsdl:operation>
> </wsdl:portType>
>
> <wsdl:binding name="SigningServices_v1_0_0SOAP"
> type="eSig:SigningServices_v1_0_0">
> <soap:binding style="document" transport="
> http://schemas.xmlsoap.org/soap/http" />
> <wsdl:operation name="Verify">
> <soap:operation style="document"
> soapAction="urn:SigningServices_v1_0_0.secureServices.health.qld.gov.au/Verify"
> />
> <wsdl:input>
> <soap:body use="literal" />
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal" />
> </wsdl:output>
> <wsdl:fault name="ApplicationError">
> <soap:fault name="ApplicationError" use="literal" />
> </wsdl:fault>
> <wsdl:fault name="SystemError">
> <soap:fault name="SystemError" use="literal" />
> </wsdl:fault>
> </wsdl:operation>
> </wsdl:binding>
>
> <wsdl:service name="SigningServices_v1_0_0">
> <wsdl:documentation>
> This web service facilitates the digital signing and
> verification of content while avoiding the need to implement
> the technical, as well as physical and procedural,
> complexities within user applications.
> </wsdl:documentation>
> <wsdl:port binding="eSig:SigningServices_v1_0_0SOAP"
> name="SigningServices_v1_0_0SOAP">
> <soap:address location="
> http://localhost:8080/SecureServices/Services/Signing_v1_0_0" />
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
>
> >>> "David Bunzli" [EMAIL PROTECTED]> 25/02/2008 3:51 pm >><[EMAIL
> >>> PROTECTED]/02/2008+3:51+pm+%3E%3E>
> Hi,
>
> Where does Axis2 enforce WSDL element restrictions? For example, if you
> wish a string element to have a minLength of 1 and maxLength of 3, are
> requests rejected by Schema validation if they don't conform? Or are these
> restrictions in the generated classes from Wsdl2Java?
>
> Regards,
> David
>
> *****************************************************************
>
> This email, including any attachments sent with it, is
>
> confidential and for the sole use of the intended recipient(s).
>
> This confidentiality is not waived or lost, if you receive it and
>
> you are not the intended recipient(s), or if it is transmitted/
>
> received in error.
>
>
>
> Any unauthorised use, alteration, disclosure, distribution or
>
> review of this email is strictly prohibited. The information
>
> contained in this email, including any attachment sent with
>
> it, may be subject to a statutory duty of confidentiality if it
>
> relates to health service matters.
>
>
>
> If you are not the intended recipient(s), or if you have
>
> received this email in error, you are asked to immediately
>
> notify the sender by telephone collect on Australia
>
> +61 1800 198 175 or by return email. You should also
>
> delete this email, and any copies, from your computer
>
> system network and destroy any hard copies produced.
>
>
>
> If not an intended recipient of this email, you must not copy,
>
> distribute or take any action(s) that relies on it; any form of
>
> disclosure, modification, distribution and/or publication of this
>
> email is also prohibited.
>
>
>
> Although Queensland Health takes all reasonable steps to
>
> ensure this email does not contain malicious software,
>
> Queensland Health does not accept responsibility for the
>
> consequences if any person's computer inadvertently suffers
>
> any disruption to services, loss of information, harm or is
>
> infected with a virus, other malicious computer programme or
>
> code that may occur as a consequence of receiving this
>
> email.
>
>
>
> Unless stated otherwise, this email represents only the views
>
> of the sender and not the views of the Queensland Government.
>
> ****************************************************************
>
>
>
--
Amila Suriarachchi,
WSO2 Inc.