Could somebody explain why in WeatherServiceImpl it has the annotation
@SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.BARE) and 
And services.xml has <style>document</style>




-----Original Message-----
From: Dan Diephouse [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 08, 2007 6:57 AM
To: [email protected]
Subject: Re: [xfire-user] Jaxb2 example, client question

Hi Eric, if you are using the JaxbServiceFactory it should pick up the
@WebService(style=BARE) attribute. Are you configuring your service as
document style via annotations or via properties? If the later, then
you also need to set that property on your client.

- Dan

On 1/2/07, Eric Miles <[EMAIL PROTECTED]> wrote:
>
>  I figured out the problem, although I'm not sure if this is a
documented
> feature or a defect.  In order to get the XFireProxyFactory to work
with the
> Jaxb2 example service, I had to provide a Map of properties that
specified
> the service as "document" style.  I would think the proxy libraries
should
> be able to inspect a service's annotations to determine if it is
document vs
> wrapped?  Anyways, here is the small change to the client code I used
to get
> it to work:
>
>          JaxbServiceFactory factory = new JaxbServiceFactory();
>          Map props = new HashMap<String, String>();
>          props.put(ObjectServiceFactory.STYLE, "document");
>          Service serviceModel =
factory.create(WeatherServiceImpl.class,
> props);
>
>  Where as before I was trying:
>
>          JaxbServiceFactory factory = new JaxbServiceFactory();
>          Service serviceModel =
factory.create(WeatherServiceImpl.class);
>
>
>  When they get an opportunity, can someone from the project respond
and let
> me know if this SHOULD be taken care of by the proxy classes given
> annotations are present on the interface and implementation that
identify it
> as a JAXB2 service?
>
>  Thanks!
>  Eric Miles
>
>
>
>
>  On Tue, 2007-01-02 at 08:57 -0500, Eric Miles wrote:
>
>  Any feeback on why the proxy classes do not work but the generated
classes
> from the WSDL do?
>
>  Thanks!
>
>
>  On Wed, 2006-12-27 at 22:21 -0500, Eric Miles wrote:
>
>  I was playing around with the Jaxb2 example provided in Xfire 1.2.3
> (WeatherService) and I can not get a client to work using the
interface and
> implementation provided in the example with XFireProxyFactory.  In
debug
> mode, when the service is called, the service endpoint receives a null
for
> the zipcode value.  Upon the service implementation returning a value,
I get
> the following exception client side:
>
>  Exception in thread "main"
> org.codehaus.xfire.XFireRuntimeException: Could not invoke
> service.. Nested exception is
> org.codehaus.xfire.fault.XFireFault: Could not unmarshall
> type.
>  org.codehaus.xfire.fault.XFireFault: Could not unmarshall
> type.
>  at
> org.codehaus.xfire.jaxb2.JaxbType.readObject(JaxbType.java:211)
>  at
>
org.codehaus.xfire.aegis.AegisBindingProvider.readParameter(AegisBinding
Provider.java:160)
>  at
>
org.codehaus.xfire.service.binding.AbstractBinding.read(AbstractBinding.
java:206)
>  at
>
org.codehaus.xfire.service.binding.WrappedBinding.readMessage(WrappedBin
ding.java:50)
>  at
>
org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(SoapBodyHandler.j
ava:42)
>  at
>
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:1
31)
>  at
> org.codehaus.xfire.client.Client.onReceive(Client.java:382)
>  at
>
org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.
java:139)
>  at
>
org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
>  at
>
org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java
:26)
>  at
>
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:1
31)
>  at
> org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
>  at
> org.codehaus.xfire.client.Client.invoke(Client.java:335)
>  at
> org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
>  at
> org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
>  at $Proxy12.GetWeatherByZipCode(Unknown Source)
>  at
> org.codehaus.xfire.jaxb.WeatherClient.main(WeatherClient.java:35)
>  Caused by: javax.xml.bind.UnmarshalException: unexpected
> element (uri:"http://www.webservicex.net";,
> local:"GetWeatherByZipCodeResult"). Expected elements are
>
<{http://www.webservicex.net}GetWeatherByZipCode>,<{http://www.webservic
ex.net}GetWeatherByZipCodeResponse>
>  at
>
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEven
t(UnmarshallingContext.java:525)
>  at
>
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:
199)
>  at
>
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:
194)
>  at
>
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildEle
ment(Loader.java:71)
>  at
>
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRoo
tLoader.childElement(UnmarshallingContext.java:922)
>  at
>
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElem
ent(UnmarshallingContext.java:366)
>  at
>
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startEleme
nt(UnmarshallingContext.java:347)
>  at
>
com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElemen
t(InterningXmlVisitor.java:35)
>  at
>
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStart
Element(StAXStreamConnector.java:201)
>  at
>
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAX
StreamConnector.java:135)
>  at
>
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unm
arshallerImpl.java:337)
>  at
>
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unma
rshallerImpl.java:309)
>  at
> org.codehaus.xfire.jaxb2.JaxbType.readObject(JaxbType.java:196)
>  ... 16 more
>  Caused by: javax.xml.bind.UnmarshalException: unexpected
> element (uri:"http://www.webservicex.net";,
> local:"GetWeatherByZipCodeResult"). Expected elements are
>
<{http://www.webservicex.net}GetWeatherByZipCode>,<{http://www.webservic
ex.net}GetWeatherByZipCodeResponse>
>  ... 29 more
>
>
>
>  Keep in mind, I have not altered any of the classes provided by the
example
> whatsoever...I merely built and deployed.  Conversely, I used WsGen to
> generate client classes per the WSDL generated by XFire and those work
fine.
>  What am I doing wrong in my client?
>
>  Attached is the client class I wrote using the XFireProxyFactory.
>
>  Thanks,
>  Eric Miles
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>  http://xircles.codehaus.org/manage_email
>
>


-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to