Copying .xsd code into a wsdl - xsd

I have a wsdl that includes a couple of import schema statements, as follows:
<types>
**<xsd:schema>
<xsd:import namespace="http://quickfeedback.ws.cdb.skoda.vwg"
schemaLocation="CDBQuickFeedbackService_schema1.xsd"/>
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://common.ws.cdb.skoda.vwg"
schemaLocation="CDBQuickFeedbackService_schema2.xsd"/>
</xsd:schema>**
I am using a tool (wsdl2rpg) that will create interfaces into the wsdl, but unfortunately, it does not support/recognise imports. Therefore I need to copy the code from the .xsd into the wsdl.
As a complete newbie to this, I am not sure exactly what code I should copy. Below is schema1, can somebody please advise what I should copy and where to ? I have tried a couple of times, with what I think are logical blocks etc., but they do not seem to work (i.e. the tool still does not pick up the copied code).
<?xml version="1.0" encoding="UTF-8"?><!--Generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build IBM 2.2.3-11/25/2013 12:35 PM(foreman)-)
See http://java.sun.com/xml/jaxb --><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://quickfeedback.ws.cdb.skoda.vwg" xmlns:ns1="http://common.ws.cdb.skoda.vwg" version="1.0" targetNamespace="http://quickfeedback.ws.cdb.skoda.vwg">
<xs:import namespace="http://common.ws.cdb.skoda.vwg" schemaLocation="CDBQuickFeedbackService_schema2.xsd"></xs:import>
<xs:element name="GetQuickFeedbackEventsRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="BID" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Brand" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Type" type="xs:integer" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetQuickFeedbackEventsResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="ResultSet" type="ns1:ResultSetType" minOccurs="0"></xs:element>
<xs:element name="EventSet" type="tns:QuickFeedbackEventSetType" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetQuickFeedbackResultsRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Date" type="xs:date" minOccurs="0"></xs:element>
<xs:element name="BID" type="xs:string" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetQuickFeedbackResultsResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="QuickFeedbackResultSet" type="tns:QuickFeedbackResultSetType" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetRejectedAgreementCustomersCountRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="RejectionDate" type="xs:date" minOccurs="0"></xs:element>
<xs:element name="BID" type="xs:string" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetRejectedAgreementCustomersCountResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="ResulSet" type="ns1:ResultSetType" minOccurs="0"></xs:element>
<xs:element name="Count" type="xs:int"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetRejectedAgreementCustomersRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="RejectionDate" type="xs:date" minOccurs="0"></xs:element>
<xs:element name="BID" type="xs:string" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetRejectedAgreementCustomersResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="ResulSet" type="ns1:ResultSetType" minOccurs="0"></xs:element>
<xs:element name="DataSet" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="tns:GetRejectedAgreementCustomerType" minOccurs="0" maxOccurs="unbounded"></xs:element>
</xs:sequence>
<xs:attribute name="Count" type="xs:int" use="required"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InsertQuickFeedbackEventsRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="EventSet" type="tns:QuickFeedbackEventSetType"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InsertQuickFeedbackEventsResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="ResultSet" type="ns1:ResultSetType" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InsertQuickFeedbackResultsRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="QuickFeedbackResultSet" type="tns:QuickFeedbackResultSetType" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InsertQuickFeedbackResultsResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="ResultSet" type="ns1:ResultSetType" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="GetRejectedAgreementCustomerType">
<xs:sequence>
<xs:element name="ID" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Email" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Phone" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Details" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Detail" maxOccurs="unbounded">
<xs:complexType>
<xs:complexContent>
<xs:extension base="tns:QuickFeedbackCustomerType">
<xs:sequence>
<xs:element name="Date" type="xs:dateTime"></xs:element>
</xs:sequence>
<xs:attribute name="Number" type="xs:int"></xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="Count" type="xs:int"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Cars" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Car" type="tns:CarType" maxOccurs="unbounded"></xs:element>
</xs:sequence>
<xs:attribute name="Count" type="xs:int"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="StudyId" type="xs:integer" minOccurs="0"></xs:element>
<xs:element name="Period" type="xs:integer" minOccurs="0"></xs:element>
<xs:element name="SurveyNumber" type="xs:integer" minOccurs="0"></xs:element>
<xs:element name="DeliveryDate" type="xs:date" minOccurs="0"></xs:element>
<xs:element name="EventType" type="xs:integer" minOccurs="0"></xs:element>
<xs:element name="ReturnReason" type="xs:integer" minOccurs="0"></xs:element>
<xs:element name="QuestionnaireDate" type="xs:date" minOccurs="0"></xs:element>
</xs:sequence>
<xs:attribute name="Number" type="xs:int"></xs:attribute>
</xs:complexType>
<xs:complexType name="QuickFeedbackCustomerType">
<xs:sequence>
<xs:element name="Salutation" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Firstname" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Lastname" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Email" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Phone" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Street" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="City" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="PostalCode" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Country" type="xs:string" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CarType">
<xs:sequence>
<xs:element name="Brand" type="xs:string"></xs:element>
<xs:element name="VIN" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Model" type="xs:string" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuickFeedbackEventType">
<xs:sequence>
<xs:element name="StudyId" type="xs:integer" minOccurs="0"></xs:element>
<xs:element name="Period" type="xs:integer" minOccurs="0"></xs:element>
<xs:element name="SurveyNumber" type="xs:integer" minOccurs="0"></xs:element>
<xs:element name="Date" type="xs:dateTime"></xs:element>
<xs:element name="Type" type="xs:integer"></xs:element>
<xs:element name="Customer">
<xs:complexType>
<xs:complexContent>
<xs:extension base="tns:QuickFeedbackCustomerType">
<xs:sequence>
<xs:element name="ID" type="xs:string" minOccurs="0"></xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="Car" type="tns:CarType"></xs:element>
<xs:element name="Organization" type="tns:OrganizationType" minOccurs="0"></xs:element>
<xs:element name="Importer" type="tns:ImporterType"></xs:element>
<xs:element name="ManualImport" type="xs:integer"></xs:element>
</xs:sequence>
<xs:attribute name="Number" type="xs:int" use="required"></xs:attribute>
</xs:complexType>
<xs:complexType name="OrganizationType">
<xs:sequence>
<xs:element name="Country" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Code" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="EngineerCode" type="xs:string" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ImporterType">
<xs:sequence>
<xs:element name="BID" type="xs:string"></xs:element>
<xs:element name="Country" type="xs:string" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuickFeedbackResultSetType">
<xs:sequence>
<xs:element name="QuickFeedbackResult" type="tns:QuickFeedbackResultType" maxOccurs="unbounded"></xs:element>
</xs:sequence>
<xs:attribute name="Count" type="xs:int" use="required"></xs:attribute>
</xs:complexType>
<xs:complexType name="QuickFeedbackResultType">
<xs:sequence>
<xs:element name="StudyId" type="xs:integer" minOccurs="0"></xs:element>
<xs:element name="Period" type="xs:integer" minOccurs="0"></xs:element>
<xs:element name="SurveyNumber" type="xs:integer" minOccurs="0"></xs:element>
<xs:element name="DeliveryDate" type="xs:date" minOccurs="0"></xs:element>
<xs:element name="EventType" type="xs:integer" minOccurs="0"></xs:element>
<xs:element name="ReturnReason" type="xs:integer" minOccurs="0"></xs:element>
<xs:element name="QuestionnaireDate" type="xs:date" minOccurs="0"></xs:element>
<xs:element name="Customer" type="tns:CustomerIdType"></xs:element>
<xs:element name="BID" type="xs:string"></xs:element>
</xs:sequence>
<xs:attribute name="Number" type="xs:int" use="required"></xs:attribute>
</xs:complexType>
<xs:complexType name="CustomerIdType">
<xs:sequence>
<xs:element name="ID" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Email" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Phone" type="xs:string" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuickFeedbackEventSetType">
<xs:sequence>
<xs:element name="Event" type="tns:QuickFeedbackEventType" maxOccurs="unbounded"></xs:element>
</xs:sequence>
<xs:attribute name="Count" type="xs:int" use="required"></xs:attribute>
</xs:complexType>
</xs:schema>

The <types> element may contain zero or various <xsd:schema> elements, and the content of each of those can be either an import of an external xsd file (or more than one) or the schema itself.
Note that in your schema1 you are also importing schema2.xsd
<xs:import namespace="http://common.ws.cdb.skoda.vwg" schemaLocation="CDBQuickFeedbackService_schema2.xsd"></xs:import>
In your case you have two options:
Create two schema elements inside types element
<definitions>
<types>
<xsd:schema>
<!-- content of schema2.xsd -->
</xsd:schema>
<xsd:schema>
<!-- content of schema1.xsd -->
</xsd:schema>
</types>
</definitions>
Create one combined schema element inside types element
This is also a straight-forward solution since you only have to dump the content of both xsd files into an element but you have to pay attention to the namespaces declared.
In schema1 you have these namespaces:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://common.ws.cdb.skoda.vwg"
targetNamespace="http://quickfeedback.ws.cdb.skoda.vwg"
xmlns:tns="http://quickfeedback.ws.cdb.skoda.vwg" >
ns1 was declared so you could use the types from that namespace, which refers to the targetnamespace of schema2.xsd. So if you open schema2.xsd you should see something like this:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://common.ws.cdb.skoda.vwg"
targetNamespace="http://common.ws.cdb.skoda.vwg"
xmlns:tns="http://common.ws.cdb.skoda.vwg" >
But now, since you are combining both schemas into one, you only need one targetnamespace and you already don't need ns1. So your wsdl should look like this:
<definitions>
<types>
<xs:schema targetNamespace="http://quickfeedback.ws.cdb.skoda.vwg" xmlns:tns="http://quickfeedback.ws.cdb.skoda.vwg" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- Here copy the content of schema2.xsd without the <xs:schema>element -->
<xs:element name="GetQuickFeedbackEventsRequest">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="BID" type="xs:string"/>
<xs:element minOccurs="0" name="Brand" type="xs:string"/>
<xs:element minOccurs="0" name="Type" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetQuickFeedbackEventsResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="ResultSet" type="tns:ResultSetType"/>
<xs:element minOccurs="0" name="EventSet" type="tns:QuickFeedbackEventSetType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetQuickFeedbackResultsRequest">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Date" type="xs:date"/>
<xs:element minOccurs="0" name="BID" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetQuickFeedbackResultsResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="QuickFeedbackResultSet" type="tns:QuickFeedbackResultSetType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetRejectedAgreementCustomersCountRequest">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="RejectionDate" type="xs:date"/>
<xs:element minOccurs="0" name="BID" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetRejectedAgreementCustomersCountResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="ResulSet" type="tns:ResultSetType"/>
<xs:element name="Count" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetRejectedAgreementCustomersRequest">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="RejectionDate" type="xs:date"/>
<xs:element minOccurs="0" name="BID" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetRejectedAgreementCustomersResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="ResulSet" type="tns:ResultSetType"/>
<xs:element minOccurs="0" name="DataSet">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Customer" type="tns:GetRejectedAgreementCustomerType"/>
</xs:sequence>
<xs:attribute name="Count" type="xs:int" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InsertQuickFeedbackEventsRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="EventSet" type="tns:QuickFeedbackEventSetType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InsertQuickFeedbackEventsResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="ResultSet" type="tns:ResultSetType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InsertQuickFeedbackResultsRequest">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="QuickFeedbackResultSet" type="tns:QuickFeedbackResultSetType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InsertQuickFeedbackResultsResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="ResultSet" type="tns:ResultSetType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="GetRejectedAgreementCustomerType">
<xs:sequence>
<xs:element minOccurs="0" name="ID" type="xs:string"/>
<xs:element minOccurs="0" name="Email" type="xs:string"/>
<xs:element minOccurs="0" name="Phone" type="xs:string"/>
<xs:element minOccurs="0" name="Details">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Detail">
<xs:complexType>
<xs:complexContent>
<xs:extension base="tns:QuickFeedbackCustomerType">
<xs:sequence>
<xs:element name="Date" type="xs:dateTime"/>
</xs:sequence>
<xs:attribute name="Number" type="xs:int"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="Count" type="xs:int"/>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="Cars">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Car" type="tns:CarType"/>
</xs:sequence>
<xs:attribute name="Count" type="xs:int"/>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="StudyId" type="xs:integer"/>
<xs:element minOccurs="0" name="Period" type="xs:integer"/>
<xs:element minOccurs="0" name="SurveyNumber" type="xs:integer"/>
<xs:element minOccurs="0" name="DeliveryDate" type="xs:date"/>
<xs:element minOccurs="0" name="EventType" type="xs:integer"/>
<xs:element minOccurs="0" name="ReturnReason" type="xs:integer"/>
<xs:element minOccurs="0" name="QuestionnaireDate" type="xs:date"/>
</xs:sequence>
<xs:attribute name="Number" type="xs:int"/>
</xs:complexType>
<xs:complexType name="QuickFeedbackCustomerType">
<xs:sequence>
<xs:element minOccurs="0" name="Salutation" type="xs:string"/>
<xs:element minOccurs="0" name="Firstname" type="xs:string"/>
<xs:element minOccurs="0" name="Lastname" type="xs:string"/>
<xs:element minOccurs="0" name="Email" type="xs:string"/>
<xs:element minOccurs="0" name="Phone" type="xs:string"/>
<xs:element minOccurs="0" name="Street" type="xs:string"/>
<xs:element minOccurs="0" name="City" type="xs:string"/>
<xs:element minOccurs="0" name="PostalCode" type="xs:string"/>
<xs:element minOccurs="0" name="Country" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CarType">
<xs:sequence>
<xs:element name="Brand" type="xs:string"/>
<xs:element minOccurs="0" name="VIN" type="xs:string"/>
<xs:element minOccurs="0" name="Model" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuickFeedbackEventType">
<xs:sequence>
<xs:element minOccurs="0" name="StudyId" type="xs:integer"/>
<xs:element minOccurs="0" name="Period" type="xs:integer"/>
<xs:element minOccurs="0" name="SurveyNumber" type="xs:integer"/>
<xs:element name="Date" type="xs:dateTime"/>
<xs:element name="Type" type="xs:integer"/>
<xs:element name="Customer">
<xs:complexType>
<xs:complexContent>
<xs:extension base="tns:QuickFeedbackCustomerType">
<xs:sequence>
<xs:element minOccurs="0" name="ID" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="Car" type="tns:CarType"/>
<xs:element minOccurs="0" name="Organization" type="tns:OrganizationType"/>
<xs:element name="Importer" type="tns:ImporterType"/>
<xs:element name="ManualImport" type="xs:integer"/>
</xs:sequence>
<xs:attribute name="Number" type="xs:int" use="required"/>
</xs:complexType>
<xs:complexType name="OrganizationType">
<xs:sequence>
<xs:element minOccurs="0" name="Country" type="xs:string"/>
<xs:element minOccurs="0" name="Code" type="xs:string"/>
<xs:element minOccurs="0" name="EngineerCode" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ImporterType">
<xs:sequence>
<xs:element name="BID" type="xs:string"/>
<xs:element minOccurs="0" name="Country" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuickFeedbackResultSetType">
<xs:sequence>
<xs:element maxOccurs="unbounded" name="QuickFeedbackResult" type="tns:QuickFeedbackResultType"/>
</xs:sequence>
<xs:attribute name="Count" type="xs:int" use="required"/>
</xs:complexType>
<xs:complexType name="QuickFeedbackResultType">
<xs:sequence>
<xs:element minOccurs="0" name="StudyId" type="xs:integer"/>
<xs:element minOccurs="0" name="Period" type="xs:integer"/>
<xs:element minOccurs="0" name="SurveyNumber" type="xs:integer"/>
<xs:element minOccurs="0" name="DeliveryDate" type="xs:date"/>
<xs:element minOccurs="0" name="EventType" type="xs:integer"/>
<xs:element minOccurs="0" name="ReturnReason" type="xs:integer"/>
<xs:element minOccurs="0" name="QuestionnaireDate" type="xs:date"/>
<xs:element name="Customer" type="tns:CustomerIdType"/>
<xs:element name="BID" type="xs:string"/>
</xs:sequence>
<xs:attribute name="Number" type="xs:int" use="required"/>
</xs:complexType>
<xs:complexType name="CustomerIdType">
<xs:sequence>
<xs:element minOccurs="0" name="ID" type="xs:string"/>
<xs:element minOccurs="0" name="Email" type="xs:string"/>
<xs:element minOccurs="0" name="Phone" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="QuickFeedbackEventSetType">
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Event" type="tns:QuickFeedbackEventType"/>
</xs:sequence>
<xs:attribute name="Count" type="xs:int" use="required"/>
</xs:complexType>
</xs:schema>
Unless schema2.xsd imports a third schema or it has something special I think this should work.
Just in case you have any issue with the copied content from schema2, note that now in this combined schema you only have one namespace prefix, and that is xs, you already don't have neither xsd nor ns1.
If you get all this headers right, the rest should give you no trouble since it's only a copy-pasted list of <xs:element> and <xs;complexType>.
Hope it helped.
Btw, what are those 2 asterisks in your wsdl before and after <xsd:schema>?

Related

Cannot read property 'myOperation' found in wsdl - issue while using NodeJs and soap client

In few words, there are around 100 soap web services and I need to expose them as rest via NodeJs. I mean, for each soap service there will a single rest service playing the role of a facade.
I install "npm install soap" as explained in https://github.com/vpulim/node-soap and https://github.com/23/node-soap. The example below is working properly so I understand the installation is fine.
So, my strach question is: how can I read the wsdl below? Kindly, see how I am trying by following the success example and I am getting certain error which seems I am missing some extra word in "client.CadastroService.CadastroServiceSoapBinding.consultarDados". Well, the wdls from such example has a small difference from my wsdl. The example relies on "wsdl:input wsaw:Action=..." and mine doesn't use wsaw:Action at all. I guess it doesn't change the way I have to call it. I am calling following this pattern: "wsdl:service name"."wsdl:binding name"."wsdl:message name"
Example working:
var soap = require('soap');
var url = "http://www.restfulwebservices.net/wcf/StockQuoteService.svc?wsdl";
var args = {"tns:request":"GOOG"};
soap.createClient(url, function(err, client){
client.CadastroService.BasicHttpBinding_IStockQuoteService.GetStockQuote(args, function(err, result){
if (err) throw err;
console.log(result);
});
});
My wsdl (obviously edited to make simpler):
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://service.ws.mycompany.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="CadastroService" targetNamespace="http://service.ws.mycompany.com/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://service.ws.mycompany.com/" elementFormDefault="unqualified" targetNamespace="http://service.ws.mycompany.com/" version="1.0">
<xs:element name="consultarDados" type="tns:consultarDados"/>
<xs:element name="root" nillable="true" type="xs:anyType"/>
<xs:complexType name="basicResponse">
<xs:sequence>
<xs:element minOccurs="0" name="codigoRetorno" type="xs:string"/>
<xs:element minOccurs="0" name="mensagemRetorno" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="consultarDados">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="tns:ConsultarInput"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ConsultarInput">
<xs:sequence>
<xs:element minOccurs="0" name="numCartao" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="consultarDadosResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="tns:ConsultarResponse"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ConsultarResponse">
<xs:complexContent>
<xs:extension base="tns:basicResponse">
<xs:sequence>
<xs:element minOccurs="0" name="blockCode" type="xs:string"/>
<xs:element minOccurs="0" name="blockCode2" type="xs:string"/>
<xs:element minOccurs="0" name="codBloqueioBoletimProtecao" type="xs:string"/>
<xs:element minOccurs="0" name="codLogo" type="xs:string"/>
<xs:element minOccurs="0" name="codMotivoEmissao2via" type="xs:string"/>
<xs:element minOccurs="0" name="codProdutoDN" type="xs:string"/>
<xs:element minOccurs="0" name="dataAberturaConta" type="xs:string"/>
<xs:element minOccurs="0" name="dataCancelamento" type="xs:string"/>
<xs:element minOccurs="0" name="dataEmissaoCartao" type="xs:string"/>
<xs:element minOccurs="0" name="dataExclusaoBoletimProtecao" type="xs:string"/>
<xs:element minOccurs="0" name="dataExpiracaoConta" type="xs:string"/>
<xs:element minOccurs="0" name="dataGeracaoPlastico" type="xs:string"/>
<xs:element minOccurs="0" name="dataInclusaoBoletimProtecao" type="xs:string"/>
<xs:element minOccurs="0" name="dataInicioAtraso" type="xs:string"/>
<xs:element minOccurs="0" name="dataNascimento" type="xs:string"/>
<xs:element minOccurs="0" name="dataProximoCorte" type="xs:string"/>
<xs:element minOccurs="0" name="dataProximoVencto" type="xs:string"/>
<xs:element minOccurs="0" name="dataUltimaAlteracaoLimite" type="xs:string"/>
<xs:element minOccurs="0" name="dataUltimaAlteracaoVencto" type="xs:string"/>
<xs:element minOccurs="0" name="dataUltimoPagamento" type="xs:string"/>
<xs:element minOccurs="0" name="dataValidadePlastico" type="xs:string"/>
<xs:element minOccurs="0" name="dataVenctoPenultimaFatura" type="xs:string"/>
<xs:element minOccurs="0" name="dataVenctoUltFatura" type="xs:string"/>
<xs:element minOccurs="0" name="dddCelular1" type="xs:string"/>
<xs:element minOccurs="0" name="dddCelular2" type="xs:string"/>
<xs:element minOccurs="0" name="dddComercial" type="xs:string"/>
<xs:element minOccurs="0" name="dddResidencial" type="xs:string"/>
<xs:element minOccurs="0" name="ddiCelular1" type="xs:string"/>
<xs:element minOccurs="0" name="ddiCelular2" type="xs:string"/>
<xs:element minOccurs="0" name="ddiComercial" type="xs:string"/>
<xs:element minOccurs="0" name="ddiResidencial" type="xs:string"/>
<xs:element minOccurs="0" name="descTipoPessoa" type="xs:string"/>
<xs:element minOccurs="0" name="diaCorteAtual" type="xs:string"/>
<xs:element minOccurs="0" name="diaVencimento" type="xs:string"/>
<xs:element minOccurs="0" name="endereco" type="xs:string"/>
<xs:element minOccurs="0" name="enderecoBairro" type="xs:string"/>
<xs:element minOccurs="0" name="enderecoCEP" type="xs:string"/>
<xs:element minOccurs="0" name="enderecoCidade" type="xs:string"/>
<xs:element minOccurs="0" name="enderecoComplemento" type="xs:string"/>
<xs:element minOccurs="0" name="enderecoNumero" type="xs:string"/>
<xs:element minOccurs="0" name="enderecoUF" type="xs:string"/>
<xs:element minOccurs="0" name="estadoCivilDesc" type="xs:string"/>
<xs:element minOccurs="0" name="flagTipoFaturamento" type="xs:string"/>
<xs:element minOccurs="0" name="indClienteVip" type="xs:string"/>
<xs:element minOccurs="0" name="indClienteVipDesc" type="xs:string"/>
<xs:element minOccurs="0" name="indDebitoAutomatico" type="xs:string"/>
<xs:element minOccurs="0" name="indEstadoCivil" type="xs:string"/>
<xs:element minOccurs="0" name="indLimiteSegregado" type="xs:string"/>
<xs:element minOccurs="0" name="indSexo" type="xs:string"/>
<xs:element minOccurs="0" name="indicadorCartaoBloqueado" type="xs:string"/>
<xs:element minOccurs="0" name="indicadorCartaoOuConta" type="xs:string"/>
<xs:element minOccurs="0" name="indicadorCompraParcelada" type="xs:string"/>
<xs:element minOccurs="0" name="indicadorContato" type="xs:string"/>
<xs:element minOccurs="0" name="indicadorTeleSaque" type="xs:string"/>
<xs:element minOccurs="0" name="nomeMae" type="xs:string"/>
<xs:element minOccurs="0" name="nomeOrg" type="xs:string"/>
<xs:element minOccurs="0" name="nomePai" type="xs:string"/>
<xs:element minOccurs="0" name="nomePortator" type="xs:string"/>
<xs:element minOccurs="0" name="numCartaoAnterior" type="xs:string"/>
<xs:element minOccurs="0" name="numCartaoTitular" type="xs:string"/>
<xs:element minOccurs="0" name="numCelular1" type="xs:string"/>
<xs:element minOccurs="0" name="numCelular2" type="xs:string"/>
<xs:element minOccurs="0" name="numChpras" type="xs:string"/>
<xs:element minOccurs="0" name="numComercial" type="xs:string"/>
<xs:element minOccurs="0" name="numConta" type="xs:string"/>
<xs:element minOccurs="0" name="numCpfCnpj" type="xs:string"/>
<xs:element minOccurs="0" name="numOrg" type="xs:string"/>
<xs:element minOccurs="0" name="numRG" type="xs:string"/>
<xs:element minOccurs="0" name="numResidencial" type="xs:string"/>
<xs:element name="qtdAdicionais" type="xs:int"/>
<xs:element name="qtdCompraParceladaAtual" type="xs:int"/>
<xs:element name="qtdDiasAtrasoUltimaFatura" type="xs:int"/>
<xs:element minOccurs="0" name="qtdVezesFaturamentoConta" type="xs:string"/>
<xs:element name="saldoAFaturar" type="xs:double"/>
<xs:element name="saldoAntepenultimaFatura" type="xs:double"/>
<xs:element name="saldoCompraInter" type="xs:double"/>
<xs:element name="saldoFaturaFechada" type="xs:double"/>
<xs:element name="saldoInterFatura" type="xs:double"/>
<xs:element name="saldoInterUltimaFaturaFechada" type="xs:double"/>
<xs:element minOccurs="0" name="sexoDesc" type="xs:string"/>
<xs:element minOccurs="0" name="situacaoConta" type="xs:string"/>
<xs:element minOccurs="0" name="situacaoContaDesc" type="xs:string"/>
<xs:element name="taxaCashProxPeriodo" type="xs:double"/>
<xs:element name="taxaJurosProxPeriodo" type="xs:double"/>
<xs:element minOccurs="0" name="tipoCartao" type="xs:string"/>
<xs:element minOccurs="0" name="tipoPessoa" type="xs:string"/>
<xs:element minOccurs="0" name="tipoPortador" type="xs:string"/>
<xs:element minOccurs="0" name="tipoPortadorDesc" type="xs:string"/>
<xs:element name="totalCashAFaturar" type="xs:double"/>
<xs:element name="valorAtraso" type="xs:double"/>
<xs:element name="valorLimiteCash" type="xs:double"/>
<xs:element name="valorLimiteCashInter" type="xs:double"/>
<xs:element name="valorLimiteCredito" type="xs:double"/>
<xs:element name="valorLimiteCreditoInter" type="xs:double"/>
<xs:element name="valorLimiteDispCash" type="xs:double"/>
<xs:element name="valorLimiteDispCashInter" type="xs:double"/>
<xs:element name="valorLimiteDispCredito" type="xs:double"/>
<xs:element name="valorLimiteDispCreditoInter" type="xs:double"/>
<xs:element name="valorLimiteParcDisponivelSegregado" type="xs:double"/>
<xs:element name="valorLimiteParcTotalSegregado" type="xs:double"/>
<xs:element name="valorPagtoMinimoUltFatura" type="xs:double"/>
<xs:element name="valorUltimoPagamento" type="xs:double"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="consultarDados">
<wsdl:part element="tns:consultarDados" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="Cadastro">
<wsdl:operation name="consultarDados">
<wsdl:input message="tns:consultarDados" name="consultarDados">
</wsdl:input>
<wsdl:output message="tns:consultarDadosResponse" name="consultarDadosResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CadastroServiceSoapBinding" type="tns:Cadastro">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="consultarDados">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="consultarDados">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="consultarDadosResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CadastroService">
<wsdl:port binding="tns:CadastroServiceSoapBinding" name="CadastroPort">
<soap:address location="http://myip...:myport/ws-myapp/cadastro"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Entire error:
demetrio#nodejs ~/dev/NodeJsSrc $ node consultaDados.js
/home/demetrio/dev/NodeJsSrc/consultaDados.js:9
client.CadastroService.CadastroServiceSoapBinding.consultarDados(args, function(err, result){
^
TypeError: Cannot read property 'consultarDados' of undefined
at /home/demetrio/dev/NodeJsSrc/consultaDados.js:9:54
at /home/demetrio/node_modules/soap/lib/soap.js:58:5
at null.callback (/home/demetrio/node_modules/soap/lib/soap.js:25:9)
at /home/demetrio/node_modules/soap/lib/wsdl.js:1073:12
at WSDL._processNextInclude (/home/demetrio/node_modules/soap/lib/wsdl.js:1148:12)
at WSDL.processIncludes (/home/demetrio/node_modules/soap/lib/wsdl.js:1191:8)
at /home/demetrio/node_modules/soap/lib/wsdl.js:1028:10
at nextTickCallbackWith0Args (node.js:419:9)
at process._tickCallback (node.js:348:13)
demetrio#nodejs ~/dev/NodeJsSrc $
How I am trying to read the soap web service (I basically followed the above example working)
var soap = require('soap');
var url = "http://myIp...:myPort/ws-myApp/cadastro?wsdl";
var args = {"tns:request":"GOOG"};
soap.createClient(url, function(err, client){
client.CadastroService.CadastroServiceSoapBinding.consultarDados(args, function(err, result){
if (err) throw err;
console.log(result);
});
});

CICS web services - XML parse error

I am currently working in CICS web services and new to XML/WSDL concepts. I got a WSDL file from middleware team and tried to execute the DFHWS2LS utility to create a COBOL language structure from that WSDL. I am getting the following error and was not able to fix this. And suggestions?
DFHPI9027E The XML parser has found an error: "XSD: The attribute
'minOccurs' is not permitted" at line "1" and column"19,015" in
document "file:/AIGNDVR/DEVL1/ELC/WSDL/MakeOkToSellServiceSOAP.wsdl".
DFHPI9558E ERRORS have been generated processing file
"/AIGNDVR/DEVL1/ELC/WSDL/ MakeOkToSellServiceSOAP.wsdl".
XML:
<?xml version="1.0" encoding="EBCDIC-CP-US"?>
<wsdl:definitions name="MakeOkToSell" targetNamespace="http://MakeOkToSell/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://MakeOkToSell/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl/" >
<wsdl:types>
<xs:schema targetNamespace="http://MakeOkToSell/">
<xs:element name="MakeOkToSellRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="RequestSystemName" type="xs:string"/>
<xs:element name="RequestSystemGearID" type="xs:int"/>
<xs:element name="transactionIdentifier" type="xs:string" minOccurs="0"/>
<xs:element name="OkToSellDetails">
<xs:complexType>
<xs:sequence>
<xs:element name="CompanyCode" type="xs:string" minOccurs="0"/>
<xs:element name="PolicyNumber" type="xs:string" minOccurs="0"/>
<xs:element name="UplineID" type="xs:string" minOccurs="0"/>
<xs:element name="SSN" type="xs:int" minOccurs="0"/>
<xs:element name="NPN" type="xs:string" minOccurs="0"/>
<xs:element name="AgencyCode" type="xs:string" minOccurs="0"/>
<xs:element name="First5digitSSNandLastName" type="xs:string" minOccurs="0"/>
<xs:element name="RequestType" type="xs:string" minOccurs="0"/>
<xs:element name="AgentPositionID" type="xs:string" minOccurs="0"/>
<xs:element name="PrimaryAgentID" type="xs:string" minOccurs="0"/>
<xs:element name="AgentFirstName" type="xs:string" minOccurs="0"/>
<xs:element name="AgentLastName" type="xs:string" minOccurs="0"/>
<xs:element name="ApplicationState" type="xs:string"/>
<xs:element name="ProductID" type="xs:string"/>
<xs:element name="ProductType" type="xs:string" minOccurs="0"/>
<xs:element name="ApplicationReceivedDate" type="xs:date"/>
<xs:element name="ApplicationSignedDate" type="xs:date"/>
<xs:element name="GrossPremium" type="xs:decimal" minOccurs="0"/>
<xs:element name="NetPremium" type="xs:decimal" minOccurs="0"/>
<xs:element name="AdditionalData" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Property" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" minOccurs="1">
<xs:attribute type="xs:string" name="name"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="MakeOkToSellResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="UID">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="EvaluationStatus">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="TaskID" type="xs:string" minOccurs="0"/>
<xs:element name="ErrorDetails" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ErrorCode" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ErrorType" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ErrorMessage" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ObjectType" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ObjectID" type="xs:string" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Warnings" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="WarningCode" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="WarningType" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="WarningMessage" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ObjectType" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ObjectID" type="xs:string" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="MakeOkToSellFault">
<xs:complexType>
<xs:all>
<xs:element name="errorMessage" type="xs:string" minOccurs="0"/>
<xs:element name="errorCode" type="xs:string" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="MakeOkToSellRequest">
<wsdl:part element="impl:MakeOkToSellRequest" name="parameters"/>
</wsdl:message>
<wsdl:message name="MakeOkToSellResponse">
<wsdl:part element="impl:MakeOkToSellResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="MakeOkToSellFault">
<wsdl:part element="impl:MakeOkToSellFault" name="parameters"/>
</wsdl:message>
<wsdl:portType name="MakeOkToSellService">
<wsdl:operation name="MakeOkToSell">
<wsdl:input message="impl:MakeOkToSellRequest" name="MakeOkToSellRequest"/>
<wsdl:output message="impl:MakeOkToSellResponse" name="MakeOkToSellResponse"/>
<wsdl:fault message="impl:MakeOkToSellFault" name="MakeOkToSellFault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="MakeOkToSellServiceBinding" type="impl:MakeOkToSellService">
<wsaw:UsingAddressing wsdl:required="false"/>
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="MakeOkToSell">
<wsdlsoap:operation soapAction="urn:MakeOkToSell"/>
<wsdl:input name="MakeOkToSellRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="MakeOkToSellResponse">
<wsdlsoap:body use="literal"/>enter code here
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="MakeOkToSellService">
<wsdl:documentation>WSDL File for MakeOkToSell</wsdl:documentation>
<wsdl:port binding="impl:MakeOkToSellServiceBinding" name="MakeOkToSellServiceSOAP">
<wsdlsoap:address location="http://localhost:9080/MakeOkToSellService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
DFHWS2Ls is presumably being run from JCL on the MF. I note that the WSDL document has an encoding of EBCDIC-CP-US, which makes sense, but that's not the encoding we're viewing it in. I presume that the WSDL has either been pretty-printed here for legibility, or a transcoding error caused everything to flow into one long line in the EBCDIC version.
I've loaded the WSDL up in a WSDL validator (I used the validator in the Eclipse Web Tools project). It reported the same problem, only this time at line 39: <xs:extension base="xs:string" minOccurs="1"> . I'm not sure what the WSDL author was trying to achieve, but that minOccurs is invalid in XML, I'd suggest deleting it.
[edited to correct markup on XML tags]

XSD/WSDL mapping in Smooks using WSO2 ESB

I am trying to map XSD to another XSD that has some different elements in Smooks. When I add both XSDs in Smooks it is not allowing me to map the elements. Is it possible in Smooks to map two different XSDs?
XSD1:CDM
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:RequestResponse="http://example.com/cdm/xsd/Person_01_RequestResponse_001"
xmlns:prsn="http:/example.com/cdm/xsd/Person_01"
attributeFormDefault="unqualified" elementFormDefault="qualified"
targetNamespace="http://example.com/cdm/xsd/Person_01_RequestResponse_001">
<!-- ************ import Employee Model ************ -->
<xs:import namespace="http://example.com/cdm/xsd/Person_01" schemaLocation="Person_01.xsd"/>
<!-- ********************************************* -->
<!-- Request Response Types -->
<!-- ********************************************* -->
<!-- For CreatePerson operation-->
<xs:element name="CreatePersonRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="PersonDetail" type="prsn:Person"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CreatePersonResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="ResponseCode" type="xs:string"/>
<xs:element name="ResponseMessage" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- For GetPerson operation-->
<xs:element name="GetPersonRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="PersonId" type="prsn:PersonIdType" nillable="false"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetPersonResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Person" type="prsn:Person" minOccurs="0" nillable="true"/>
<xs:element name="ResponseCode" type="xs:string"/>
<xs:element name="ResponseMessage" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
XSD2:LEGACY
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:RequestResponse="http://example.com/xsd/Person_01_RequestResponse_001"
xmlns:prsn="http://example.com/xsd/Person_01"
attributeFormDefault="unqualified" elementFormDefault="qualified"
targetNamespace="http://example.com/xsd/Person_01_RequestResponse_001">
<!-- ************ import Employee Model ************ -->
<xs:import namespace="http://example.com/xsd/Person_01" schemaLocation="Person_01.xsd"/>
<!-- ********************************************* -->
<!-- Request Response Types -->
<!-- ********************************************* -->
<!-- For CreatePerson operation-->
<xs:element name="CreatePersonRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="PersonDetail" type="prsn:Person"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CreatePersonResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="ResponseCode" type="xs:string"/>
<xs:element name="ResponseMessage" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- For GetPerson operation-->
<xs:element name="GetPersonRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="CNIC" type="xs:string" nillable="false" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetPersonResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Person" type="prsn:Person" minOccurs="0" nillable="true"/>
<xs:element name="ResponseCode" type="xs:string"/>
<xs:element name="ResponseMessage" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- For UpdatePerson operation-->
<xs:element name="UpdatePersonRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Person" type="prsn:Person"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="UpdatePersonResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="ResponseCode" type="xs:string"/>
<xs:element name="ResponseMessage" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- For deletePerson operation-->
<xs:element name="DeletePersonRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="CNIC" type="xs:string" nillable="false" minOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DeletePersonResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="ResponseCode" type="xs:string"/>
<xs:element name="ResponseMessage" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

Why won't my XML schema element take a number?

In XMLSpy, there is a validation error, "Value '18' is not allowed for attribute 'name'. Hint: A valid value would be 'NCName'. Error location: xs:schema / xs:element / xs:complexType / xs:choice / xs:element / xs:complexType / xs:choice / xs:element / #name" here:
<xs:element name="Age">
<xs:complexType>
<xs:choice>
<xs:element name="18" type="xs:int"/>
If I enter letters it validates, but I need numbers in that field.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://www.urent.com/Elmhurst" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.urent.com/Elmhurst" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="URent">
<xs:annotation>
</xs:annotation>
<xs:complexType>
<xs:choice>
<xs:element name="RentalPeriod">
<xs:complexType>
<xs:all>
<xs:element name="StartDate" type="xs:date"/>
<xs:element name="EndDate" type="xs:date"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="Age">
<xs:complexType>
<xs:choice>
<xs:element name="18" type="xs:int"/>
<xs:element name="19" type="xs:int"/>
<xs:element name="20" type="xs:int"/>
<xs:element name="21" type="xs:int"/>
<xs:element name="22" type="xs:int"/>
<xs:element name="23" type="xs:int"/>
<xs:element name="24" type="xs:int"/>
<xs:element name="25+" type="xs:int"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="RateCode">
<xs:complexType>
<xs:choice>
<xs:element name="Corporate" type="xs:string"/>
<xs:element name="Leisure" type="xs:string"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="TypeOfVehicle">
<xs:complexType>
<xs:all>
<xs:element name="Subcompact" type="xs:string"/>
<xs:element name="Compact" type="xs:string"/>
<xs:element name="Intermediate" type="xs:string"/>
<xs:element name="Standard" type="xs:string"/>
<xs:element name="Full Size" type="xs:string"/>
<xs:element name="Premium" type="xs:string"/>
<xs:element name="Luxury" type="xs:string"/>
<xs:element name="Standard Elite SUV" type="xs:string"/>
<xs:element name="Intermediate SUV" type="xs:string"/>
<xs:element name="Minivan" type="xs:string"/>
<xs:element name="Full Size SUV" type="xs:string"/>
<xs:element name="Standard SUV" type="xs:string"/>
<xs:element name="Premium SUV" type="xs:string"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="Residence">
<xs:complexType>
<xs:choice>
<xs:element name="US" type="xs:string"/>
<xs:element name="OutsideUS" type="xs:string"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="SpecialEquipment">
<xs:complexType>
<xs:choice>
<xs:element name="GPS Navigation" type="xs:string"/>
<xs:element name="XM Radio" type="xs:string"/>
<xs:element name="Fuel Service" type="xs:string"/>
<xs:element name="Child Safety Seats" type="xs:string"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="Customer Info">
<xs:complexType>
<xs:sequence>
<xs:element name="FirstName" type="xs:string"/>
<xs:element name="LastName" type="xs:string"/>
<xs:element name="EmailAddress" type="xs:string"/>
<xs:element name="PhoneNumber" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
Taken literally, your declaration says the set of valid Age elements includes <Age><18>45</18></Age> and <Age><25+>33</25+></Age>, though not <Age><45>18</45></Age>.
But '18' and '25+' are not allowed by XML as names of element types; like names of variables in most programming languages, names of element types in XML must begin with a letter. (They are also not allowed to contain blanks, so the element names "Full Size" and "Standard Elite SUV" will also raise errors.) So the examples given in the preceding paragraph are not XML, and you cannot define an XSD schema against which they would be valid.
It's not clear whether you need to review the basics of XML or the basics of XSD, but your work developing a schema will be more pleasant and productive if you have a better grasp of the technologies you are trying to use; that helps you work with the grain of the technology and not against it.

Validate repeating optional elements XML-Schema

I am try to create an xsd schema that validates the following xml:
<results>
<row>
<PersonID key="true">1</PersonID>
<FirstName>John</FirstName>
<Surname>Smith</Surname>
<LogonName>jsmith</LogonName>
</row>
<row>
<PersonID key="true">2</PersonID>
<FirstName>Steve</FirstName>
<Surname>Jones</Surname>
<LogonName>sjones</LogonName>
</row>
The results node and row node are mandatory, but the nodes inside each row are optional and may have other nodes that I have not listed. There could 1 row or many rows.
I have created the below but I am unable to validate correctly:
<xs:element name="results">
<xs:complexType>
<xs:sequence>
<xs:element name="row" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="PersonID" minOccurs="0">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:byte">
<xs:attribute type="xs:string" name="key" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:choice minOccurs="0">
<xs:element type="xs:string" name="FirstName" minOccurs="0"/>
<xs:element type="xs:string" name="Surname" minOccurs="0"/>
<xs:element type="xs:string" name="LogonName" minOccurs="0"/>
<xs:element type="xs:string" name="GroupName" minOccurs="0"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
Thanks.
If PersonID, FirstName etc. can occurr at most once - and in that specific order - try this:
<xs:element name="results">
<xs:complexType>
<xs:sequence>
<xs:element name="row" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="PersonID" minOccurs="0">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:byte">
<xs:attribute type="xs:string" name="key" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element type="xs:string" name="FirstName" minOccurs="0"/>
<xs:element type="xs:string" name="Surname" minOccurs="0"/>
<xs:element type="xs:string" name="LogonName" minOccurs="0"/>
<xs:element type="xs:string" name="GroupName" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
(basically just drop the choice element). If PersonID, FirstName etc. can occurr at most once but in any order you can use all:
<xs:element name="results">
<xs:complexType>
<xs:sequence>
<xs:element name="row" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:all>
<xs:element name="PersonID" minOccurs="0">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:byte">
<xs:attribute type="xs:string" name="key" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element type="xs:string" name="FirstName" minOccurs="0"/>
<xs:element type="xs:string" name="Surname" minOccurs="0"/>
<xs:element type="xs:string" name="LogonName" minOccurs="0"/>
<xs:element type="xs:string" name="GroupName" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
If you don't know elements can occur within row you can use:
<xs:element name="results">
<xs:complexType>
<xs:sequence>
<xs:element name="row" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
that accepts any element within row.

Resources