4 Replies Latest reply: May 22, 2009 11:31 AM by hbuelow RSS

    Composite won't compile after adding Business Rule: Bad Schema Include NS

    tbeets
      I'm doing Chapter 7 of the SOA 11g Foundation Tutorial -- Rules. At the deploy step, the composite compilation throws many errors and the deploy fails. All the errors stem from the OracleRules1_DecisionService_1.wsdl file that was automatically created in the previous tutorial steps.

      Looking at that wsdl, JDeveloper warns "Incorrect namespace definition for xsd/OracleRules1_DecisionService_1Types.xsd. Indeed, it looks like the code generators have a mismatch between the targetNamespace of the importing wsdl and the allowed targetNamespace of the imported xsd. Both are auto-generated by the Rules editor...

      Importing WSDL: targetNamespace="http://xmlns.oracle.com/ApprovalRule/OracleRules1_DecisionService_1"
      Imported XSD: targetNamespace="http://xmlns.oracle.com/OracleRules1/OracleRules1_DecisionService_1"

      This causes all downstream references in the WSDL to the imported types to fail.

      The only deviation I did from the tutorial was that I made the Dictionary Name in Step #2 of Section 7.3 "ApprovalRule" instead of "ManualApproval".



      Example compile error:
      Load of wsdl "OracleRules1_DecisionService_1.wsdl with Message part element undefined in wsdl [file:/usr/local/workspace/mywork/eap11gR1/SOA11gFoundationTutorial/po/POProcessing/POProcessing/receivePO.wsdl] part name = request     type = {http://xmlns.oracle.com/ns/order}PurchaseOrder" failed
      java.lang.Exception: Message part element undefined in wsdl [file:/usr/local/workspace/mywork/eap11gR1/SOA11gFoundationTutorial/po/POProcessing/POProcessing/receivePO.wsdl] part name = request     type = {http://xmlns.oracle.com/ns/order}PurchaseOrder
           at oracle.soa.scac.WSDLValidator.validateMessageParts(WSDLValidator.java:121)
           at oracle.soa.scac.WSDLValidator.validateMessages(WSDLValidator.java:88)
           at oracle.soa.scac.WSDLValidator.validate(WSDLValidator.java:47)
           at oracle.soa.scac.WSDLValidator.validate(WSDLValidator.java:40)
           at oracle.soa.scac.ValidateComposite.loadWSDLs(ValidateComposite.java:779)
           at oracle.soa.scac.ValidateComposite.doValidation(ValidateComposite.java:516)
           at oracle.soa.scac.ValidateComposite.main(ValidateComposite.java:205)
      OracleRules1_DecisionService_1.wsdl:
          <wsdl:types>
              <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xmlns.oracle.com/ApprovalRule/OracleRules1_DecisionService_1"
                   attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:tns="http://xmlns.oracle.com/ApprovalRule/OracleRules1_DecisionService_1"
                   xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bpelpm="http://xmlns.oracle.com/bpel"
                   xmlns:rules="http://xmlns.oracle.com/bpel/rules">
                  <include schemaLocation="xsd/OracleRules1_DecisionService_1Types.xsd"/>
              </schema>
      xsd/OracleRules1_DecisionService_1Types.xsd:
      <?xml version="1.0" encoding="UTF-8"?>
      <xsd:schema blockDefault="#all" 
                  attributeFormDefault="unqualified" 
                  elementFormDefault="qualified"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                  xmlns="http://xmlns.oracle.com/OracleRules1/OracleRules1_DecisionService_1"
                  xmlns:bpelpm="http://xmlns.oracle.com/bpel"
                  xmlns:tns="http://xmlns.oracle.com/OracleRules1/OracleRules1_DecisionService_1"
                  targetNamespace="http://xmlns.oracle.com/OracleRules1/OracleRules1_DecisionService_1">
        • 1. Re: Composite won't compile after adding Business Rule: Bad Schema Include NS
          tbeets
          I peeked at the seeded Chapter 7 tutorial solution. In the imported rules XSD, the targetNamespace is correct in that it matches the importing WSDL's namespace (i.e. reflecting the "ManualApproval" rule creation in this case):
          <xsd:schema blockDefault="#all" ^M
                      attributeFormDefault="unqualified" ^M
                      elementFormDefault="qualified"^M
                      xmlns:xsd="http://www.w3.org/2001/XMLSchema"^M
                      xmlns="http://xmlns.oracle.com/ManualApproval/OracleRules1_DecisionService_1"^M
                      xmlns:bpelpm="http://xmlns.oracle.com/bpel"^M
                      xmlns:tns="http://xmlns.oracle.com/ManualApproval/OracleRules1_DecisionService_1"^M
                      targetNamespace="http://xmlns.oracle.com/ManualApproval/OracleRules1_DecisionService_1">^M
          • 2. Re: Composite won't compile after adding Business Rule: Bad Schema Include NS
            hbuelow
            We haven't seen this before. Can you reproduce it? I just tried it using RC3 - trying various order of things - and can't make it happen.

            Heidi.
            • 3. Re: Composite won't compile after adding Business Rule: Bad Schema Include NS
              tbeets
              I created a new project, dropped a Rule component in and named it ApprovalRule. The error didn't reproduce.

              I TAR'd up the original project with the namespace discrepancy before fixing it just in case you want to examine.

              These intermittent problems are the worst kind -- I had that other intermittent problem (posted to this OTN forum) where JDev mixed up the deploy profile of one project with another project.

              I should tell you that I'm doing all my work with the Java-neutral JDeveloper package, running it on Solaris 10 x86-64 (i.e. not on Windows XP or Linux like most everyone else). It has worked flawlessly thus far, so I'm not really trying to imply that this is a source of these never-seen before glitches.

              Todd
              • 4. Re: Composite won't compile after adding Business Rule: Bad Schema Include NS
                hbuelow
                Thanks, Todd. We'll keep an eye out for the problem. But dev can't do anything until we can reproduce it.

                Heidi.