Hi Dan,
I have got this working by doing:
XmlBeansServiceFactory factory = new XmlBeansServiceFactory();
factory.setStyle("wrapped");
Service serviceModel = factory.create(TaxonAPI.class);
TaxonAPI service = (TaxonAPI) new XFireProxyFactory().create(serviceModel,
"http://localhost:8080/col2005/services/taxonApi");
I notice that the ObjectServiceFactory recognizes the service as being a
doc/lit/wrapped automatically but the XmlBeansServiceFactory needs it
explicitly set. Could this be a small bug?
In answer to your question though it is using spring and
<!-- Declare an xfire service factory -->
<bean id="xfire.xmlbeansServiceFactory"
class="org.codehaus.xfire.xmlbeans.XmlBeansServiceFactory"
singleton="true">
<property name="transportManager">
<ref bean="xfire.transportManager"/>
</property>
</bean>
<!-- Declare an xfire configuration from the service interface -->
<bean id="taxonApiWebService"
class="org.codehaus.xfire.spring.remoting.XFireExporter">
<property name="serviceFactory">
<ref bean="xfire.xmlbeansServiceFactory"/>
</property>
<property name="serviceBean">
<ref bean="taxonAPI"/>
</property>
<property name="serviceInterface">
<value>org.gbif.taxonapi.TaxonAPI</value>
</property>
<property name="style" value="wrapped" />
<property name="use" value="literal" />
</bean>
Thanks
Tim
-----Original Message-----
From: Dan Diephouse [mailto:[EMAIL PROTECTED]
Sent: Friday, March 24, 2006 10:46 PM
To: [email protected]
Subject: Re: [xfire-dev] XMLBeans Client
Can you show how you are creating your service on the server side
(whether that be java code or services.xml or spring...)
Thanks,
- Dan
Tim Robertson wrote:
>Thanks Dan,
>
>I made the change but noticed the following:
>
>When I make the single change from
>
> Service serviceModel = new ObjectServiceFactory().create(TaxonAPI.class);
>To
>
> Service serviceModel = new
>XmlBeansServiceFactory().create(TaxonAPI.class);
>
>It stops making valid requests and issues an empty body:
><?xml version='1.0' encoding='UTF-8'?><soap:Envelope
>xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body
>/></soap:Envelope>
>
>Whereas the ObjectServiceFactory issues:
><?xml version='1.0' encoding='UTF-8'?><soap:Envelope
>xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><GetRootTC
o
>ncepts xmlns="http://taxonapi.gbif.org" /></soap:Body></soap:Envelope>
>
>It's doc/lit/wrapped and this is for a method taking no args. A method
>taking args does receive the <in0
>xmlns="http://taxonapi.gbif.org"><string>1</string></in0> but it's not in
>the wrapped "method name" tag, so returns error.
>
>Does this mean the XmlBeansServiceFactory doesn't like the wrapped?
>
>Thanks
>
>Tim
>
>
>
--
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com