Hi,

There are a few related issues for the usage of dynamic SDO with Tuscany/SCA:

1. (Java to WSDL/XSD) How to map the commonj.sdo.DataObject java type (used for parameters or return value of a java method) to an XSD type?
   * As xsd:anyType
* Map to a type such as Customer. It requires additional information to provide the XML metadata.

2. (WSDL/XSD to Java) How to map the XSD types/elements into SDO commonj.sdo.DataObject?

We could generate the java interfaces using the commonj.sdo.DataObject from a WSDL. The commonj.sdo.DataObject java interface itself doesn't contain the XML metadata that can be introspected unless it is associated with the XSD either by QNames or location.

Unlike JAXB, the mapping of XSD types into commonj.sdo.DataObject doesn't provide the XML schema information to bind the DataObject into an XML element/type. We'll have to invent something here in Tuscany/SCA.

3. How to tell the Tuscany runtime what XSDs are providing the SDO types for a given java interface?

* In Tuscany today, you can add an <import.sdo location="..xsd"/> in the composite file (see an example at [1]). Ideally, we should align this sdo related metadata with the SCA contributions.

[1] http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/itest/properties/src/main/resources/PropertyTest.composite

In a way, we need to come up a dynamic SDO programming model in SCA.

Thanks,
Raymond

From: ??????
Sent: Sunday, March 29, 2009 3:48 AM
To: [email protected]
Subject: about sca and sdo and webservice


Hi ,when I write java interface like:
public DataObject test(DataObject param);
then use binding:ws in define service,then the wsdl generated by tuscany like following:
....
<wsdl:types>
<xs:schema attributeFormDefault="qualified" elementFormDefault="unqualified"
targetNamespace="http://baseinfo.demo.tuscany.wiscom.com/"; xmlns:ns0="http://sdo.commonj/";
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
<xs:import namespace="http://sdo.commonj/"/>
<xs:element name="test">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="arg0" nillable="true" type="ns0:dataObject"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="testResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="ns0:dataObject"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>

so It will force webservice consumer use sdo too,It seems not a good idea.
any advice?

And I try to modify the generated wsdl to replace '<wsdl:types>...sdo.commonj...' in with following common style:

....

<xsd:complexType name="BaseInfo">
<xsd:sequence>
<xsd:element name="id" type="xsd:int"/>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="bornDate" type="xsd:date"/>
<xsd:element name="graduated" type="xsd:boolean"/>
<xsd:element name="address" type="Address"/>
<xsd:element name="familyMembers" type="FamilyMembers"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="Address">
<xsd:sequence>
<xsd:element name="conntry" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
....

then modify binding:ws to using existing wsdl file,but It seems that tuscany generate new wsdl insistently,any config-example is appreciated.

Reply via email to