Using that WSDL I see the same data on the server and client sides.  Thanks for 
the all the help guys.

-----Original Message-----
From: Raymond Feng [mailto:[email protected]] 
Sent: Tuesday, September 01, 2009 16:36
To: [email protected]
Subject: Re: Issue using JAXB generated classes in SCA remotable service

Hi,

Hmm, it seems to be an issue in JAXB. Now the only option is to add 
@XmlSeeAlso support for the interface as JAX-WS wsimport does. I'm trying it 
with the 2.x stream:

@Remotable
@XmlSeeAlso({abs.ObjectFactory.class, conc.ObjectFactory.class})
public interface TestService {

    public DataType getData();

}

After fixing the j2w codegen, it produces the following wsdl. Can you try 
this WSDL to see if it works? Meanwhile, I'll try to port the fix into 1.x 
after more tests.


<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="TestServiceService" 
targetNamespace="http://server.test/"; xmlns:tns="http://server.test/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/";>
  <wsdl:types>
    <xs:schema elementFormDefault="qualified" targetNamespace="abs" 
version="1.0" xmlns:ns1="conc" xmlns:tns="abs" 
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
<xs:import namespace="conc"/>
<xs:element name="IdentifierAbstract" type="xs:anyType"/>
<xs:complexType name="DataType"><xs:choice><xs:element 
ref="tns:IdentifierAbstract"/><xs:element 
ref="ns1:Identifier"/></xs:choice></xs:complexType>
</xs:schema>
    <xs:schema targetNamespace="conc" version="1.0" xmlns:ns1="abs" 
xmlns:tns="conc" xmlns:xs="http://www.w3.org/2001/XMLSchema";>
<xs:import namespace="abs"/>
<xs:element name="Identifier" type="tns:StringType"/>
<xs:element name="TestData" type="ns1:DataType"/>
<xs:simpleType name="StringType"><xs:restriction 
base="xs:string"/></xs:simpleType>
</xs:schema>
    <xs:schema attributeFormDefault="qualified" 
elementFormDefault="unqualified" targetNamespace="http://server.test/"; 
xmlns:ns0="abs" xmlns:xs="http://www.w3.org/2001/XMLSchema";><xs:import 
namespace="abs"/><xs:element 
name="getDataResponse"><xs:complexType><xs:sequence><xs:element 
minOccurs="0" name="return" nillable="true" 
type="ns0:DataType"/></xs:sequence></xs:complexType></xs:element><xs:element 
name="getData"><xs:complexType/></xs:element></xs:schema>
  </wsdl:types>
  <wsdl:message name="getDataResponse">
    <wsdl:part name="getDataResponse" element="tns:getDataResponse">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="getData">
    <wsdl:part name="getData" element="tns:getData">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="TestService">
    <wsdl:operation name="getData">
      <wsdl:input message="tns:getData">
    </wsdl:input>
      <wsdl:output message="tns:getDataResponse">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="TestServiceBinding" type="tns:TestService">
    <SOAP:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getData">
      <SOAP:operation/>
      <wsdl:input>
        <SOAP:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <SOAP:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="TestServiceService">
    <wsdl:port name="TestServicePort" binding="tns:TestServiceBinding">
      <SOAP:address 
location="http://192.168.1.102:8080/TestServiceComponent/TestService"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

Thanks,
Raymond

--------------------------------------------------
From: "Phillips, Chad" <[email protected]>
Sent: Tuesday, September 01, 2009 10:53 AM
To: <[email protected]>
Subject: RE: Issue using JAXB generated classes in SCA remotable service

> Adding ObjectFactory to that annotation has the effect of creating a 
> complex type objectFactory in the WSDL:
>
> <xs:schema targetNamespace="conc" version="1.0">
> <xs:complexType name="objectFactory">
> <xs:sequence/>
> </xs:complexType>
> </xs:schema>
>
> -----Original Message-----
> From: Raymond Feng [mailto:[email protected]]
> Sent: Tuesday, September 01, 2009 10:18
> To: [email protected]
> Subject: Re: Issue using JAXB generated classes in SCA remotable service
>
> Hi,
>
> I just came back from vacation to catch the discussion.
>
> Can you try to use @XmlSeeAlso to add the conc.ObjectFactory.class instead
> of conc.StringType.class? It seems that there is information in the
> ObjectFactory.class to describe the element substitutionGroup.
>
> Thanks,
> Raymond
> --------------------------------------------------
> From: "Phillips, Chad" <[email protected]>
> Sent: Tuesday, September 01, 2009 9:43 AM
> To: <[email protected]>
> Subject: RE: Issue using JAXB generated classes in SCA remotable service
>
>> The WSDL generated by Tuscany is missing the Identifier element that is
>> present in the XSD used on the server side.  Maybe I'm still missing an
>> annotation?  Here is the data on the server side before it's returned to
>> the client:
>>
>> <DataType xmlns:ns2="conc" xmlns="abs">
>>    <ns2:Identifier>FOO</ns2:Identifier>
>> </DataType>
>>
>> And here is what the client receives:
>>
>> <DataType xmlns="abs">
>>    <IdentifierAbstract xsi:nil="true"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
>> </DataType>
>>
>> Some of the clients that will be using the WS are not under my control so
>> they'll most likely not being using Tuscany to access the service (I
>> believe most are using JAX-WS or Axis2).
>>
>> -----Original Message-----
>> From: Scott Kurz [mailto:[email protected]]
>> Sent: Tuesday, September 01, 2009 09:07
>> To: [email protected]
>> Subject: Re: Issue using JAXB generated classes in SCA remotable service
>>
>> On Tue, Sep 1, 2009 at 11:33 AM, Phillips, Chad<[email protected]>
>> wrote:
>>> Anyone get a chance to look at this yet?  It's a pretty major issue for
>>> my project as we can't return data in the required format.
>>
>> Chad, I'm not sure I'm totally following every step here... not sure
>> what you mean by "...WSDL is not being generated correctly".  I
>> haven't actually run your app.
>>
>> But would you say that the service-side is sending back the correct
>> XML, and you are having some problem on the client side?
>>
>> If so, I wonder if it would be useful to try using a Tuscany client w/
>> a reference with <binding.ws>?
>>
>> Scott
> 

Reply via email to