What You May Need to Know About Multiple Schema Elements in a WSDL Types Section

If there are multiple <schema> elements in a wsdl <types> section, getElement() method takes only the first <schema> element in the following scenarios:
  • If there are no targetNamespace elements.

  • If <schema> elements under <wsdl:types> have the same targetNamespace.

To avoid this, ensure that each schema element contains:
  • A targetNamespace element.

  • Each targetNamespace element is different from the other in each schema.

The following is the example of <wsdl:types> section with different targetNamespace elements.

<wsdl:types> 
  <schema xmlns="http://www.example.com/2001/XMLSchema" 
	targetNamespace="http://namespace1.name/"> 
    <import namespace="http://xmlns.example.com/singleString" 
	schemaLocation="../Schemas/singleString.xsd" /> 
  </schema> 

  <schema xmlns="http://www.example.com/2001/XMLSchema" 
	targetNamespace="http://namespace2.name/"> 
    <import namespace="http://xmlns.example.com/pcbpel/samples/expense" 
	schemaLocation="../Schemas/mqresponse.xsd" /> 
  </schema> 
</wsdl:types>