Sunday, July 1, 2012

"XML-24500: (Error) Can not build schema" due to embedded schemas

Problem:

We developed a simple composite that maps from a custom schema to the ItemEBM schema (which is based on the AIA Foundation Pack's ItemEBO canonical). It maps fine in JDeveloper 11g, but during compilation, we receive the following error:
Buildfile: C:\Oracle\jdev\jdeveloper\bin\ant-sca-compile.xml

scac:
     [scac] Validating composite "C:\Project1\composite.xml"
     [scac]
     [scac] XML-24500: (Error) Can not build schema ' ' located at 'urn:oracle:bpel:top-xsd:noNamespaceXSD:TEMP_TOP.__OAUX_GENXSD_.TOP.XSD'
     [scac] error: location {/ns:composite/ns:import[@location='http://dev.ipnweb.com:8001/soa-infra/services/EBS/ItemEBS/ItemEBS.wsdl']}(17,30): Load of wsdl "http://dev.ipnweb.com:8001/soa-infra/services/EBS/ItemEBS/ItemEBS.wsdl with Message part element undefined in wsdl [http://dev.ipnweb.com:8001/soa-infra/services/EBS/ItemEBS/apps/AIAMetaData/AIAComponents/EnterpriseBusinessServiceLibrary/Core/EBO/Item/V2/ItemEBS.wsdl] part name = UpdateItemResponseEBM    type = {http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/Item/V2}UpdateItemResponseEBM" failed
     [scac] error: location {/ns:composite/ns:import[@location='http://dev.ipnweb.com:8001/soa-infra/services/EBS/ItemEBS/apps/AIAMetaData/AIAComponents/EnterpriseBusinessServiceLibrary/Core/EBO/Item/V2/ItemEBS.wsdl']}: Load of wsdl "http://dev.ipnweb.com:8001/soa-infra/services/EBS/ItemEBS/ItemEBS.wsdl with Message part element undefined in wsdl [http://dev.ipnweb.com:8001/soa-infra/services/EBS/ItemEBS/apps/AIAMetaData/AIAComponents/EnterpriseBusinessServiceLibrary/Core/EBO/Item/V2/ItemEBS.wsdl] part name = UpdateItemResponseEBM    type = {http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/Item/V2}UpdateItemResponseEBM" failed

BUILD FAILED
C:\Oracle\jdev\jdeveloper\bin\ant-sca-compile.xml:269: Java returned: 1 Check log file : C:\Project1\SCA-INF\classes\scac.log for errors

Total time: 23 seconds

Analysis:

The error seems to indicate that there is perhaps an issue with one of the underlying schemas. Wrong! This error is completely misleading.

This is our simple composite.



The exposed service on the left (Mediator1_ep) is based off of a custom WSDL (Mediator1.wsdl). The external reference on the right is based off the fully qualified HTTP URL to the ItemEBS (http://dev.ipnweb.com:8001/soa-infra/services/EBS/ItemEBS/ItemEBS_ep?WSDL) of which it imports the ItemEBM.xsd from the MDS.

It turns out that Mediator1.wsdl has three embedded schemas (i.e., the schema is not an external file but rather included in the WSDL) and each schema has a different namespace. So Mediator1.wsdl has something that looks like the following:
<wsdl:types>
  <schema targetNamespace="http://ns1.ipnweb.com" ...>
    .
    .
    .
  </schema>
  <schema targetNamespace="http://ns2.ipnweb.com" ...>
    .
    .
    .
  </schema>
  <schema targetNamespace="http://ns3.ipnweb.com" ...>
    .
    .
    .
  </schema>
</wsdl:types>
This WSDL of the exposed service was the root cause of our issue.


Solution:

1. Inspect the WSDL of the exposed service.

2. If the WSDL of the exposed service has embedded schemas, then move them out to their own XSD files and import them from the WSDL instead.

3. Refer to the other links in the reference section for other possible solutions to this error.


Applicable Versions:
  • Oracle AIA Foundation Pack 11g (11.1.1.5)
  • Oracle SOA Suite 11g (11.1.1.5)


References:

Ahmed Aboulnaga

No comments: