1

I'm importing a WSDL in SoapUI and getting the following error:

Error: Could not find type 'MonthType'. Do you mean to refer to the type named MonthType@http://www.sainsburys.co.uk/eai/canonical/types/v1.0 (in sendPaymentOverride_v0.2.wsdl)?

I have an element of type ComplexType, that references a SimpleType as an extension. And SoapUI doesn't seem to like this...any idea how I can get around this? I think the WSDL is valid.

Appreciate all the help I can get!

<xs:schema targetNamespace="http://www.sainsburys.co.uk/eai/canonical/types/v1.0" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="PaymentCardOverride">
    <xs:complexType id="PaymentCardOverrideType">
      <xs:sequence>
        <xs:element name="OrderNumber" type="xs:string" minOccurs="1" maxOccurs="1"/>
        <xs:element name="RequestPayment" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
        <xs:element name="PurgeSecurePaymentDetails" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
        <xs:element name="CardNumber" type="xs:string" minOccurs="1" maxOccurs="1"/>
        <xs:element name="PreserveExistingCard" type="xs:boolean" use="required"/>
        <xs:element name="ExpiryMonth" type="ExpiryMonthType" minOccurs="1" maxOccurs="1" nillable="true"/>
        <xs:element name="ExpiryYear" type="ExpiryYearType" minOccurs="1" maxOccurs="1"/>
        <xs:element name="StoreNumber" type="xs:integer" minOccurs="1" maxOccurs="1"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:simpleType name="MonthType">
     <xs:union>
        <xs:simpleType>
           <xs:restriction base="xs:integer">
              <xs:minInclusive value="1"/>
              <xs:maxInclusive value="12"/>
           </xs:restriction>
        </xs:simpleType>
        <xs:simpleType>
          <xs:restriction base='xs:string'>
            <xs:length value='0'/>
          </xs:restriction>
        </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:complexType name="ExpiryMonthType">
     <xs:simpleContent>
       <xs:extension base="MonthType">
         <xs:attribute name="PreserveExisting" type="xs:boolean" use="required"/>    
       </xs:extension>
     </xs:simpleContent>
  </xs:complexType>
  <xs:simpleType name="YearType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:integer">
          <xs:minInclusive value="2015"/>
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base='xs:string'>
          <xs:length value='0'/>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
 </xs:simpleType>
 <xs:complexType name="ExpiryYearType">
   <xs:simpleContent>
     <xs:extension base="YearType">
       <xs:attribute name="PreserveExisting" type="xs:boolean" use="required"/>
     </xs:extension>
   </xs:simpleContent>
 </xs:complexType>
</xs:schema>
RubioRic
  • 2,442
  • 4
  • 28
  • 35
Simon Edge
  • 141
  • 2
  • 10

1 Answers1

2

It's because I wasn't referencing the right namespace. Should have been:

<xs:element name="ExpiryMonth" type="tns2:ExpiryMonthType" 
            minOccurs="1" maxOccurs="1" nillable="true"/>

and

<xs:complexType name="ExpiryMonthType">
   <xs:simpleContent>
      <xs:extension base="tns2:MonthType">
            <xs:attribute name="PreserveExisting" type="xs:boolean" use="required"/>    
      </xs:extension>
   </xs:simpleContent>
</xs:complexType>
RubioRic
  • 2,442
  • 4
  • 28
  • 35
Simon Edge
  • 141
  • 2
  • 10