Topic
  • 4 replies
  • Latest Post - ‏2011-04-20T19:59:52Z by SystemAdmin
EduardoB
EduardoB
3 Posts

Pinned topic SCA contribution exporting/importing

‏2011-04-19T21:40:15Z |
Hi,

I'm exporting and importing some schemas via sca-contribution.
I have SCA project A and B. Project A exports all the XSDs and the WSDLs that we use and project B import these schemas.
When we try to create a SDO in project B it throws an IllegalArgumentException.
We are able to generate a requestObj correctly, but we can't create a request.

This is were we try to create the SDO:
context.getDataFactory().create("Namespace1", "request");

--------------------*EXCEPTION*--------------------
java.lang.IllegalArgumentException
at com.ibm.xml.sdo.helper.DataFactoryImpl.create(Unknown Source)

These are the files we have:
*WSDL.wsdl:
<wsdl:definitions name="xxxx"

targetNamespace="Namespace1"

xmlns:tns="Namespace1"

xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>

<xsd:schema

targetNamespace="Namespace1"

xmlns:tns="Namespace1"

xmlns="http://www.w3.org/2001/XMLSchema">

<xsd:include schemaLocation="WS.xsd"></xsd:include>

</xsd:schema>

</wsdl:types>

<wsdl:message name="messageRequest">
<wsdl:part name="parameters" element="tns:request"></wsdl:part>
</wsdl:message>

*WS.xsd:

<xsd:schema version="1.0"
targetNamespace="Namespace1"
xmlns:tns="Namespace1"
xmlns:info="Namespace1/Doc"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

...

<xsd:element name="request">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="request" type="requestObj" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

*Doc.xsd:

<xsd:schema version="1.0"
targetNamespace="Namespace1/Doc"
xmlns:tns="Namespace1/Doc"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

...

<xsd:complexType name="requestObj">
<xsd:complexContent>
<xsd:extension base="BasicRequest">
<xsd:sequence>
<xsd:element minOccurs="0" form="qualified" name="message"
type="Alpha" />
<xsd:element minOccurs="0" name="attr1" type="Alpha" />
<xsd:element minOccurs="0" name="attr1" type="Alpha" />
<xsd:element minOccurs="0" name="attr1" type="Alpha" />
<xsd:element minOccurs="0" name="attr1" type="Alpha" />
<xsd:element minOccurs="0" name="attr1" type="Alpha" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

*A SCA contribution:
<?xml version="1.0" encoding="UTF-8"?>
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0">

...

<import namespace="Namespace1"></import>
<import namespace="Namespace1/Doc"></import>
</contribution>

*B SCA contribution:
<?xml version="1.0" encoding="UTF-8"?>
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0">

...

<import namespace="Namespace1"></import>
<import namespace="Namespace1/Doc"></import>
</contribution>

Any help would be appreciated.

Thanks
Updated on 2011-04-20T19:59:52Z at 2011-04-20T19:59:52Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: SCA contribution exporting/importing

    ‏2011-04-20T14:31:29Z  
    I have already reply to this question in the following thread http://www.ibm.com/developerworks/forums/thread.jspa?threadID=368608&tstart=0
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: SCA contribution exporting/importing

    ‏2011-04-20T16:19:15Z  
    I have already reply to this question in the following thread http://www.ibm.com/developerworks/forums/thread.jspa?threadID=368608&tstart=0
    Eduardo,

    Whether or not Adrian's point on the contribution XML mistake addresses your problem, let me note something else.

    Your schema included:
    
    <xsd:element name=
    "request"> <xsd:complexType> <xsd:sequence> <xsd:element name=
    "request" type=
    "requestObj" >
    


    So there is a parent, global "request" element and a child "request" element.

    In doing:

    
    context.getDataFactory().create(
    "Namespace1", 
    "request");
    


    were you trying to create an object at the level of the parent or the child?

    The "typical" app will only deal with the child-level object. This assumes you're following the doc-lit-wrapped pattern, (which is the default mapping of WSDL-to-Java in SCA including for SDO). Typically only the runtime serialization/deserialization interacts with the wrapper (the parent) itself.

    So your most typical SCA app would only be creating an instance of the "requestObj" and passing it as a service parameter or return value.

    Of course, there are other things you could do in the app besides working with service parms, so your question is valid in any case. I just thought this would be interesting to note.

    Scott Kurz
    WAS SCA
  • EduardoB
    EduardoB
    3 Posts

    Re: SCA contribution exporting/importing

    ‏2011-04-20T17:57:43Z  
    Eduardo,

    Whether or not Adrian's point on the contribution XML mistake addresses your problem, let me note something else.

    Your schema included:
    <pre class="jive-pre"> <xsd:element name= "request"> <xsd:complexType> <xsd:sequence> <xsd:element name= "request" type= "requestObj" > </pre>

    So there is a parent, global "request" element and a child "request" element.

    In doing:

    <pre class="jive-pre"> context.getDataFactory().create( "Namespace1", "request"); </pre>

    were you trying to create an object at the level of the parent or the child?

    The "typical" app will only deal with the child-level object. This assumes you're following the doc-lit-wrapped pattern, (which is the default mapping of WSDL-to-Java in SCA including for SDO). Typically only the runtime serialization/deserialization interacts with the wrapper (the parent) itself.

    So your most typical SCA app would only be creating an instance of the "requestObj" and passing it as a service parameter or return value.

    Of course, there are other things you could do in the app besides working with service parms, so your question is valid in any case. I just thought this would be interesting to note.

    Scott Kurz
    WAS SCA
    Hi, sorry for the contributions, my mistake, this is how we're using them:

    *A SCA contribution:
    <?xml version="1.0" encoding="UTF-8"?>
    <contribution xmlns="http://www.osoa.org/xmlns/sca/1.0">

    ...

    <export namespace="Namespace1"></export>
    <export namespace="Namespace1/Doc"></export>
    </contribution>

    *B SCA contribution:
    <?xml version="1.0" encoding="UTF-8"?>
    <contribution xmlns="http://www.osoa.org/xmlns/sca/1.0">

    ...

    <import namespace="Namespace1"></import>
    <import namespace="Namespace1/Doc"></import>
    </contribution>

    Also, Scott, just to let you know we're trying to generate a parent type, request.
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: SCA contribution exporting/importing

    ‏2011-04-20T19:59:52Z  
    • EduardoB
    • ‏2011-04-20T17:57:43Z
    Hi, sorry for the contributions, my mistake, this is how we're using them:

    *A SCA contribution:
    <?xml version="1.0" encoding="UTF-8"?>
    <contribution xmlns="http://www.osoa.org/xmlns/sca/1.0">

    ...

    <export namespace="Namespace1"></export>
    <export namespace="Namespace1/Doc"></export>
    </contribution>

    *B SCA contribution:
    <?xml version="1.0" encoding="UTF-8"?>
    <contribution xmlns="http://www.osoa.org/xmlns/sca/1.0">

    ...

    <import namespace="Namespace1"></import>
    <import namespace="Namespace1/Doc"></import>
    </contribution>

    Also, Scott, just to let you know we're trying to generate a parent type, request.
    I already respond to this in the thread http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14608845#14608845

    Can we use just one of the threads to follow from here? this is getting messy.