Thanks for these answers.

I saw there is a writeXsiTypes property in AegisContext that would do
the trick ( http://cxf.apache.org/docs/aegis-21.html ).

However, I don't know how I could override the default writeXsiTypes
property. I've found older messages on this mailing list which
suggested to add mapping information with each aegis enabled classes.
But in my current setup, I won't be able to do this.

Is there no way to enable writeXsiTypes globally in DOSGI with some
properties ?

If not I'm thinking about recompiling it with writeXsiTypes set to
true, as my need is pretty specific and I know there won't be Objects
more complex than Map, String, Long and Double in my webservices. But
I can't add specific mappings for each of OSGI services exposed as
WebServices.

2010/10/12 Benson Margulies <bimargul...@gmail.com>:
> Aegis would be more helpful here. It's very fond of xsi:type.
>
> On Tue, Oct 12, 2010 at 1:42 PM, Daniel Kulp <dk...@apache.org> wrote:
>> On Tuesday 12 October 2010 2:01:41 am blaz wrote:
>>> Hi,
>>> I'm calling a cxf webservice from ksoap2, and ksoap2 seems to need the
>>> datatype directly in the SoapResponse in order to unmarshall it, in
>>> fact the datatype is present in the soaprequest from ksoap2.
>>
>> That would be a bug in ksoap2 as it should not be relying on those.   From
>> what I can tell, there isn't a way to force JAXB to generate xsi:type's on 
>> all
>> the elements so I don't really think there is a way to accomplish this.
>>
>> Dan
>>
>>
>>> Is there a way to enable it with cxf Distributed-OSGI ? Am I doing
>>> something wrong ?
>>> Here are the request elements:
>>>
>>> wsdl auto generated by cxf-dosgi:
>>> <wsdl:definitions name="Watchable"
>>> targetNamespace="http://watchable.portal.osgi.cnam.org/";
>>> xmlns:ns1="http://schemas.xmlsoap.org/wsdl/soap/http";
>>> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
>>> xmlns:tns="http://watchable.portal.osgi.cnam.org/";
>>> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>>>   <wsdl:types>
>>> <xsd:schema attributeFormDefault="qualified"
>>> elementFormDefault="qualified"
>>> targetNamespace="http://watchable.portal.osgi.cnam.org/";
>>> xmlns:tns="http://watchable.portal.osgi.cnam.org/";
>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>>>   <xsd:complexType name="string2stringMap">
>>>     <xsd:sequence>
>>>       <xsd:element maxOccurs="unbounded" minOccurs="0" name="entry">
>>>         <xsd:complexType>
>>>           <xsd:sequence>
>>>             <xsd:element name="key" type="xsd:string" />
>>>             <xsd:element minOccurs="0" name="value" type="xsd:string" />
>>>           </xsd:sequence>
>>>         </xsd:complexType>
>>>       </xsd:element>
>>>     </xsd:sequence>
>>>   </xsd:complexType>
>>>   <xsd:element name="getWatchableList" type="tns:getWatchableList" />
>>>   <xsd:complexType name="getWatchableList">
>>>     <xsd:sequence>
>>>       <xsd:element minOccurs="0" name="arg0" nillable="true"
>>> type="xsd:string" />
>>>     </xsd:sequence>
>>>   </xsd:complexType>
>>>   <xsd:element name="getWatchableListResponse"
>>> type="tns:getWatchableListResponse" />
>>>   <xsd:complexType name="getWatchableListResponse">
>>>     <xsd:sequence>
>>>       <xsd:element minOccurs="0" name="return" nillable="true"
>>> type="tns:string2stringMap" />
>>>     </xsd:sequence>
>>>   </xsd:complexType>
>>> </xsd:schema>
>>>   </wsdl:types>
>>>   <wsdl:message name="getWatchableListResponse">
>>>     <wsdl:part element="tns:getWatchableListResponse" name="parameters">
>>>     </wsdl:part>
>>>   </wsdl:message>
>>>   <wsdl:message name="getWatchableList">
>>>     <wsdl:part element="tns:getWatchableList" name="parameters">
>>>     </wsdl:part>
>>>   </wsdl:message>
>>>   <wsdl:portType name="WatchablePortType">
>>>     <wsdl:operation name="getWatchableList">
>>>       <wsdl:input message="tns:getWatchableList" name="getWatchableList">
>>>     </wsdl:input>
>>>       <wsdl:output message="tns:getWatchableListResponse"
>>> name="getWatchableListResponse">
>>>     </wsdl:output>
>>>     </wsdl:operation>
>>>   </wsdl:portType>
>>>   <wsdl:binding name="WatchableSoapBinding" type="tns:WatchablePortType">
>>>     <soap:binding style="document"
>>> transport="http://schemas.xmlsoap.org/soap/http"; />
>>>     <wsdl:operation name="getWatchableList">
>>>       <soap:operation soapAction="" style="document" />
>>>       <wsdl:input name="getWatchableList">
>>>         <soap:body use="literal" />
>>>       </wsdl:input>
>>>       <wsdl:output name="getWatchableListResponse">
>>>         <soap:body use="literal" />
>>>       </wsdl:output>
>>>     </wsdl:operation>
>>>   </wsdl:binding>
>>>   <wsdl:service name="Watchable">
>>>     <wsdl:port binding="tns:WatchableSoapBinding" name="WatchablePort">
>>>       <soap:address location="http://blaz.is-a-geek.org:8888/watchable/"; />
>>>     </wsdl:port>
>>>   </wsdl:service>
>>> </wsdl:definitions>
>>>
>>> SoapRequest from ksoap2:
>>> <v:Envelope xmlns:c="http://schemas.xmlsoap.org/soap/encoding/";
>>> xmlns:d="http://www.w3.org/2001/XMLSchema";
>>> xmlns:i="http://www.w3.org/2001/XMLSchema-instance";
>>> xmlns:v="http://schemas.xmlsoap.org/soap/envelope/";>
>>> <v:Header/>
>>> <v:Body>
>>> <n0:getWatchableList xmlns:n0="http://watchable.portal.osgi.cnam.org/";
>>> c:root="1" id="o0">
>>> <n0:arg0 i:type="d:string">FOO</n0:arg0>
>>> </n0:getWatchableList>
>>> </v:Body>
>>> </v:Envelope>
>>>
>>> SoapResponse from cxf-DOSGI:
>>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
>>> <soap:Body>
>>> <ns1:getWatchableListResponse
>>> xmlns:ns1="http://watchable.portal.osgi.cnam.org/";>
>>> <ns1:return>
>>> <ns1:entry>
>>> <ns1:key>FOO</ns1:key>
>>> <ns1:value>BAR</ns1:value>
>>> </ns1:entry>
>>> </ns1:return>
>>> </ns1:getWatchableListResponse>
>>> </soap:Body>
>>> </soap:Envelope>
>>
>> --
>> Daniel Kulp
>> dk...@apache.org
>> http://dankulp.com/blog
>>
>

Reply via email to