Showing posts with label XSD. Show all posts
Showing posts with label XSD. Show all posts

Thursday, April 11, 2013

Runtime invocation failing with .__OAUX_GENXSD_.TOP.XSD Error /duplicate elements in XSD



Recently I was working with BPEL process which had multiple service invocations and my job was to enhance it by adding some OSB invocations. When I started modifying the code for new service invocations and WSDL modifications, the process stopped compiling due to the .__OAUX_GENXSD_.TOP.XSD. It looked bit odd, one of the main issues was due to some shared XSD’s and some services had included the XSD’s some were importing it, some had different XSD implementations for same namespace. So after consolidating the entire included schemas and existing schemas the process started working.
The biemond blog was helpful. 
The problem I faced was when I starting testing, I had the location replaced at runtime and it started failing with the same .__OAUX_GENXSD_.TOP.XSD error. This was new to me as I thought it will be going through since all the wsdls will be looked up at compilation time. Each invocation will be different. But it isn’t so, so finally I had to tweak the abstract wsdl to make it concrete (by adding service tags) composite.xml and config plan for deployment.
Error stacktrace
Exception: Can not build schema 'http://geo.com/commons/schema/type' locate
d at 'http://geo.com/commons/schema/type.__OAUX_GENXSD_.TOP.XSD' [Cause=Can
not build schema 'http://geo.com/commons/schema/type' located at 'http://geo
.com/ commons/schema/type.__OAUX_GENXSD_.TOP.XSD']

Reference WSDL (named in location of composite.xml)
Add service tags in wsdl definitions and have a dummy address, which can be updated during deployment.




composite.xml
Add the the property endpointURI which will hold the runtime URI (without the ?wsdl)
Depoyment Plan(soa config plan)
In the deployment plan ,don’t update the location attribute to the runtime location, keep it your local wsdl.Update the endpointURI property to the environment specific URI.
Add separate search replace for the wsdl and update the location value to the environment specific URI
Environment is 11g PS4
Hope it helps

Monday, July 18, 2011

JDev11g PS2 - XSLT designer limitations

There will be scenarios when you need to pass a counter variable /any status value into a transformation. Since Jdev 11g design supports multiple source transformation it’s easy to pass multiple variables as input into XSLT. The only issue that developers will encounter is the below error.

"Source parts of variables are either simple type or complex type, thus cannot be used to create mapper file".

1.    If you try to use a variable which is a simple type created in BPEL, it will through up this error.
Workaround
As a workaround you can create an element in XSD which is of complex type
XSD file code snippet

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://www.geo.com/test"
            targetNamespace="http://www.geo.com/test"
            elementFormDefault="qualified">
  <xsd:element name="loopCounter" type="CounterType"/>
  <xsd:complexType name="CounterType">
    <xsd:sequence>
      <xsd:element name="count" type="xsd:int" />
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>

Create a variable in BPEL by using this element. This will work with XSLT designer.

2.    In case you are using a message type and the message type is added in a WSDL file which is not attached to any partner link, then the same error will occur.

WSDL file code snippet
<definitions targetNamespace="http://geo.com/test/"
             xmlns="http://schemas.xmlsoap.org/wsdl/"
             xmlns:tns="http://geo.com/test/"
             xmlns:tns1="http://www.geo.com/test"
             …………………….
/">
  <types>
    <xsd:schema targetNamespace="http://geo.com/test/types"
                elementFormDefault="qualified"/>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:import namespace="http://www.geo.com/test" schemaLocation="xsd/test.xsd"/>
        </xsd:schema>
  </types>
 
  <message name="Counter">
        <part name="body" element="tns1:loopCounter"/>
    </message>

</definitions>

Workaround
 You will have to copy the types and message type definition to the WSDL file which is associated with any of the partner link present in the process. This is not a good practice as we are modifying the end system /interacting system wsdls, for internal use of the process flow.

So the best approach will be to use the first workaround as it is clean and neat and serves the purpose.