You might want to start WSDL first and then run the tuscany-sdo-plugin in maven
to generate the java interface.
When you use the anyType, it will use a DataObject.
There is a good article on IBM’s site about using SDO in Tuscany that explains
it, but you need to:
Add this to the namespace on your composite file header:
in xml header, add this ns:
xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
Add this to your composite file to load the wsdl:
<dbsdo:import.sdo location="wsdl/your.wsdl"/>
Add this to your composite file to load the wsdl:
<component name="yourWebService">
<implementation.java class="com.you.YourImpl"/>
<service name="YourWebService">
<interface.wsdl
interface="http://webservices.yournamespace.com/yourqualifier#wsdl.interface(yourWebService)"
wsdli:wsdlLocation="http://webservices.yournamespace.com/yourqualifier
wsdl/your.wsdl"/>
<binding.ws
endpoint="http://webservices.yournamespace.com/yourqualifier
#wsdl.endpoint(yourWebService/SoapPort)" location="wsdl/your.wsdl" uri=""/>
</service>
</component>
From: 路经纬 [mailto:[email protected]]
Sent: Sunday, March 29, 2009 6: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.