MissingPropertyException: No such property: Error in Groovy script - groovy

I execute the following Groovy script in my SoapUI
import com.*
import javax.xml.XMLConstants
import javax.xml.transform.stream.StreamSource
import javax.xml.validation.SchemaFactory
def xsd = '''
<xs:schema targetNamespace="http://maps.googleapis.com" elementFormDefault="qualified" xmlns="http://maps.googleapis.com" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="GeocodeResponse" type="_GeocodeResponse"/>
<xs:complexType name="result_geometry">
<xs:sequence>
<xs:element name="location" type="geometry_location"/>
<xs:element name="location_type" type="xs:string"/>
<xs:element name="viewport" type="geometry_viewport"/>
<xs:element name="bounds" type="geometry_bounds"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="viewport_southwest">
<xs:sequence>
<xs:element name="lat" type="xs:decimal"/>
<xs:element name="lng" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="bounds_northeast">
<xs:sequence>
<xs:element name="lat" type="xs:decimal"/>
<xs:element name="lng" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="geometry_viewport">
<xs:sequence>
<xs:element name="southwest" type="viewport_southwest"/>
<xs:element name="northeast" type="viewport_northeast"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="geometry_bounds">
<xs:sequence>
<xs:element name="southwest" type="bounds_southwest"/>
<xs:element name="northeast" type="bounds_northeast"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="bounds_southwest">
<xs:sequence>
<xs:element name="lat" type="xs:decimal"/>
<xs:element name="lng" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="viewport_northeast">
<xs:sequence>
<xs:element name="lat" type="xs:decimal"/>
<xs:element name="lng" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="_GeocodeResponse">
<xs:sequence>
<xs:element name="status" type="xs:string"/>
<xs:element name="result" type="GeocodeResponse_result"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="address_component">
<xs:sequence>
<xs:element name="long_name" type="xs:string"/>
<xs:element name="short_name" type="xs:string"/>
<xs:element name="type" type="xs:string" maxOccurs="2"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="GeocodeResponse_result">
<xs:sequence>
<xs:element name="type" type="xs:string" maxOccurs="2"/>
<xs:element name="formatted_address" type="xs:string"/>
<xs:element name="address_component" type="address_component" maxOccurs="3"/>
<xs:element name="geometry" type="result_geometry"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="geometry_location">
<xs:sequence>
<xs:element name="lat" type="xs:decimal"/>
<xs:element name="lng" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
'''.trim()
def factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI)
def schema = factory.newSchema(new StreamSource(new StringReader(xsd)))
def validator = schema.newValidator()
validator.validate(new StreamSource(new StringReader(XmlExamples.G_RECORDS)))
XmlExamples.groovy is located in C:\Program Files\SmartBear\SoapUI-4.6.1\bin\ext\com
i.e.
class XmlExamples {
static def G_RECORDS = '''
<GeocodeResponse>
<status>OK</status>
.....
</bounds>
</geometry>
</result>
</GeocodeResponse>
'''
}
But problem is I am getting following error in SoapUI
:ERROR:groovy.lang.MissingPropertyException: No such property: XmlExamples for class: Script1
groovy.lang.MissingPropertyException: No such property: XmlExamples for class: Script1
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at Script1.run(Script1.groovy:86)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:149)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:239)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:148)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:43)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
What could be the possible root causes. Is there anything to do with CLASSPATH? I believe the default location would be .......bin/ext
Cheers

The class XmlExamples seems to be missing the correct package declaration. Since it resides in a package called com you should have the following class:
package com
class XmlExamples {
static def G_RECORDS = '''
<GeocodeResponse>
<status>OK</status>
.....
</bounds>
</geometry>
</result>
</GeocodeResponse>
'''
}

It appears that you are trying to validate an xml with the xsd using the example and the same sample code is successfully got executed in SoapUI tool when I tried both code snippets copied in same groovy script. May be you would want to try like that to isolate the problem.

Related

Copying .xsd code into a wsdl

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>?

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.

Java Code for creating child elements within an element

I want to generate the following XSD Schema using JAXB and ObjectFactory class of org/w3/_2001/xmlschema
<xs:element name="result">
<xs:complexType>
<xs:sequence>
<xs:element name="sfobject" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="id"/>
<xs:element type="xs:string" name="type"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
But I am getting XSD as :
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="result">
<xs:complexType>
<xs:sequence/>
</xs:complexType>
</xs:element>
<xs:element name="sfobject" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence/>
</xs:complexType>
</xs:element>
<xs:element type="xs:string" name="id"/>
<xs:element type="xs:string" name="type"/>
</xs:schema>
I am not able to add one element inside other element. How do I do that in Java using JAXB and ObjectFactory methods.
Sample Code:
List schemaElementList = schema.getSimpleTypeOrComplexTypeOrGroup();
TopLevelElement resultElement = xsdObjFactory.createTopLevelElement();
resultElement.setName("result");
LocalComplexType resultCompType = xsdObjFactory.createLocalComplexType();
resultElement.setComplexType(resultCompType);
resultCompType.setSequence(expGroup);
Element sfElement = (Element)xsdObjFactory.createLocalElement();
sfElement.setName("sfobject");
sfElement.setMaxOccurs("unbounded");
sfElement.setMinOccurs(new BigInteger("0"));
LocalComplexType sfCompType = xsdObjFactory.createLocalComplexType();
sfElement.setComplexType(sfCompType);
schemaElementList.add(resultElement);

Creating multiple element name with sequence.

Below is the sample xml which has multiple <rulex> that starts with sequence 1 and it can end up to many rule like <rule1> , <rule2>, <rule3> etc....
<?xml version="1.0" encoding="UTF-8"?>
<AddressChange_181>
<rules>
<rule1>
<conditions>xya</conditions>
<response_path>abc</response_path>
</rule1>
<rule2>
<conditions>xxxx</conditions>
<response_path>aaaa</response_path>
</rule2>
<rule3>
<conditions>yyyyy</conditions>
<response_path>ffff</response_path>
</rule3>
<rule4>
<conditions>zzzz</conditions>
<response_path>yyyy</response_path>
</rule4>
<default>
<response_path>uuuuu</response_path>
</default>
</rules>
</AddressChange_181>
Below is the schema where i tried creating dynamic <rulex> element name for the above xml.
when i generate xml from this schema i do not get the same xml format as above xml.
can you please let me know how to create schema with multiple element name that starts with a sequence number.
My requirement is to add more than one rule (<rule1>,<rule2>,<rule3> etc...) in xml file and this xml file should be validated against schema.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="mock_rule_list">
<xs:complexType>
<xs:sequence>
<xs:element ref="rules" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="rules">
<xs:complexType>
<xs:sequence>
<xs:element ref="rule" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="default" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="rule">
<xs:complexType>
<xs:simpleContent>
<xs:restriction base="xs:anyType">
<xs:pattern value="rule/d{1,3}"></xs:pattern>
</xs:restriction>
</xs:simpleContent>
<xs:sequence>
<xs:element ref="conditions" minOccurs="1" maxOccurs="1"/>
<xs:element ref="response_path" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="default">
<xs:complexType>
<xs:sequence>
<xs:element ref="response_path"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="conditions" type="xs:string">
</xs:element>
<xs:element name="response_path" type="xs:string"/>
</xs:schema>
Thanks,
Madhu
There is no way to define such a structure using XSD if the number of ruleX tags is arbitrarily defined. If you can constrain the upper bound to a maximum, and you really have to stick with ruleX naming convention, than you can define a complex type such as ruleType, then a bunch of rule1, rule2,... , ruleN elements of that type - I would call this messy... I wouldn't recommend this.
XSD (with a maximum of 6):
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="mock_rule_list">
<xs:complexType>
<xs:sequence>
<xs:element ref="rules" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="rules">
<xs:complexType>
<xs:sequence>
<xs:element ref="rule1" minOccurs="0"/>
<xs:element ref="rule2" minOccurs="0"/>
<xs:element ref="rule3" minOccurs="0"/>
<xs:element ref="rule4" minOccurs="0"/>
<xs:element ref="rule5" minOccurs="0"/>
<xs:element ref="rule6" minOccurs="0"/>
<xs:element ref="default"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="ruleType">
<xs:sequence>
<xs:element ref="conditions" minOccurs="1" maxOccurs="1"/>
<xs:element ref="response_path" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:element name="default">
<xs:complexType>
<xs:sequence>
<xs:element ref="response_path"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="conditions" type="xs:string">
</xs:element>
<xs:element name="response_path" type="xs:string"/>
<xs:element name="rule1" type="ruleType"/>
<xs:element name="rule2" type="ruleType"/>
<xs:element name="rule3" type="ruleType"/>
<xs:element name="rule4" type="ruleType"/>
<xs:element name="rule5" type="ruleType"/>
<xs:element name="rule6" type="ruleType"/>
</xs:schema>
Alternatively, you could have a tag named "rule" with a #sequence attribute.
XSD:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="mock_rule_list">
<xs:complexType>
<xs:sequence>
<xs:element ref="rules" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="rules">
<xs:complexType>
<xs:sequence>
<xs:element ref="rule" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="default"/>
</xs:sequence>
</xs:complexType>
<xs:unique name="SequenceKey">
<xs:selector xpath="rule"/>
<xs:field xpath="#sequence"/>
</xs:unique>
</xs:element>
<xs:complexType name="ruleType">
<xs:sequence>
<xs:element ref="conditions" minOccurs="1" maxOccurs="1"/>
<xs:element ref="response_path" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="sequence" type="xs:int" use="required"/>
</xs:complexType>
<xs:element name="default">
<xs:complexType>
<xs:sequence>
<xs:element ref="response_path"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="conditions" type="xs:string">
</xs:element>
<xs:element name="response_path" type="xs:string"/>
<xs:element name="rule" type="ruleType"/>
</xs:schema>
Sample XML:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- Sample XML generated by QTAssistant (http://www.paschidev.com) -->
<rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<rule sequence="1">
<conditions>conditions1</conditions>
<response_path>response_path1</response_path>
</rule>
<rule sequence="2">
<conditions>conditions2</conditions>
<response_path>response_path2</response_path>
</rule>
<default>
<response_path>response_path1</response_path>
</default>
</rules>
Or it could also be that one could simply use the index of the <rule/> within the parent collection .

Resources