none
Simple Types not generated from wsdl RRS feed

  • Question

  • Hi , 

    I am in Contract first development. I have a wsdl which has simple types defined , For eg:

    - <xs:simpleType name="sourceSystem">
    - <xs:restriction base="xs:string">
      <xs:pattern value="[a-zA-Z0-9]{4}" />
      </xs:restriction>
      </xs:simpleType>

    But when I generate code using wsdl.exe or wscf.blue, these simple types are ignored and the properties of these simple types are defined as per their xs type (in this case string) .  Also the pattern validation and length validation is lost.

    How can i import simple types while code generation.

    Tuesday, January 28, 2014 7:30 PM

All replies

  • firstly i have concerns over the xsd imports:

     <import namespace="http://schemas.ocbc.com/soa/emf/common/header"
                schemaLocation="../../../../Schemas/XML/CommonHeader.xsd"/>
        <import namespace="http://schemas.ocbc.com/soa/emf/common/body"
                schemaLocation="../../../../Schemas/XML/CommonBody.xsd"/>
        <import namespace="http://schemas.ocbc.com/soa/emf/service/CBS-CustAddress-I"
                schemaLocation="CBS-CustAddress-I.xsd"/>
    

    The Schema locations need to be checked if they refer to proper location or not..to check this it will be ideal to check it via a IDE like JDeveloper. It will give u warnings in case it finds issues. Try to place these schema in the same location as the all the WSDL and XSDs and also similarly change the path.

    The error that you see might be because of the below code:

    <attributeGroup name="encodingStyle">
        <attribute ref="emf-envelope:encodingStyle"/>
    </attributeGroup>
    

    It refers to a location to find the definition but fails.

    My suggestions are mainly 2:

    1) Try to simplify the XSD if possible. 2) Try to use a different IDE than eclipse. I prefer Oracle Jdeveloper as it has simple wizard.

    Hope this helps

    Thursday, January 30, 2014 1:18 PM