So this is the client side that is sending the wrong request? Well thats
probably because the @SOAPBinding implementation is on the server impl,
not the interface - which the client typically uses.
If you're using the <jaxws:client> xml config, I think this can be fixed
by specifying a service class as your implementation class - in which
case @SOAPBinding will be read.
You can also trying supply the WSDL to the client proxy. I think this
can be done via the <wsdlLocation> element inside <jaxws:client>. In
this case, CXF will look at the WSDL to see how to build the service
model internally.
Cheers,
- Dan
Eric Miles wrote:
Dan,
I thought this might have to do with document vs wrapped, however I have
specified document style on the impl class as seen below:
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE, style =
SOAPBinding.Style.DOCUMENT)
@WebService(serviceName = "MobileService", endpointInterface =
"com.kronos.taws.services.mobile.MobileService",
portName="MobileServicePort", name="MobileService")
public class MobileServiceImpl implements MobileService,
InitializingBean {
...
...
}
The style property from the xfire spring configuration might be an old
artifact that was left over during prototyping...sorry if that gave any
confusion as to how the service was configured via annotations. Any
more information I can provide to help diagnose my problem?
Thanks again,
Eric
On Mon, 2007-09-10 at 15:35 -0400, Dan Diephouse wrote:
Hi Eric,
This is because you've specified "document" style on the ServiceBean
inside xfire. Try adding this annotation to your service impl:
@SOAPBinding(parameterStyle=ParameterStyle.BARE)
This will tell CXF not to operate in wrapped mode, but in
document/bare/literal.
Cheers,
- Dan
Eric Miles wrote:
I'm testing our upgrade from XFire 1.2.6 to CXF 2.1-SNAPSHOT and it
seems there is some additional wrapping of the message body requests and
responses for our services. Under XFire, a request coming from the
XFire client libraries (XFireProxyFactory using JaxbServiceFactory)
looks like such:
<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>
<RetrRefTc
xmlns="http://taws.kronos.com/services/MobileService" />
</soap:Body>
</soap:Envelope>
Under CXF (using JaxWsProxyFactoryBean):
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:retrRefTc
xmlns:ns1="http://mobile.services.taws.kronos.com/">
<RetrRefTc
xmlns="http://taws.kronos.com/services/MobileService" />
</ns1:retrRefTc>
</soap:Body>
</soap:Envelope>
FYI, the actual java implementation's method name is retrRefTc, so I
think that's where this wrapping name is coming from.
The responses are such, first the XFire response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<RetrRefTcResp
xmlns="http://taws.kronos.com/services/MobileService">
</RetrRefTcResp>
</soap:Body>
</soap:Envelope>
Then the CXF response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:RetrRefTcResponse
xmlns:ns1="http://taws.kronos.com/services/MobileService">
<RetrRefTcResp
xmlns="http://taws.kronos.com/services/MobileService">
</RetrRefTcResp>
</ns1:RetrRefTcResponse>
</soap:Body>
</soap:Envelope>
Again, you can see CXF is wrapping the response with a RetrRefTcResponse
element.
Here are the two Spring configurations.
First XFire:
<bean id="tawsMobileService"
class="org.codehaus.xfire.spring.ServiceBean">
<property name="serviceBean" ref="tawsMobileServiceImpl" />
<property name="serviceFactory" ref="xfire.jaxbServiceFactory"
/>
<property name="style" value="document" />
<property name="inHandlers">
<list>
<ref bean="domInHandler" />
<ref bean="wss4jHandler" />
<ref bean="authenticationHandler" />
</list>
</property>
<property name="schemas">
<list>
<value>com/kronos/taws/services/mobile/MobileService.xsd</value>
</list>
</property>
</bean>
Now CXF:
<jaxws:endpoint id="tawsMobileService"
implementor="#tawsMobileServiceImpl" name="MobileService"
address="/MobileService">
<jaxws:inInterceptors>
<ref bean="wss4jInterceptor"/>
<ref bean="saajInterceptor" />
<ref bean="wsAuthenticationInterceptor"/>
</jaxws:inInterceptors>
<jaxws:schemaLocations>
<jaxws:schemaLocation>classpath:com/kronos/taws/services/mobile/MobileService.xsd</jaxws:schemaLocation>
</jaxws:schemaLocations>
</jaxws:endpoint>
This wrapping behavior is not desired. If there is configuration
somewhere to keep this from happening, please let me know.
As I've stated at the top of the post, we have not changed ANY of our
java code, merely the configuration in Spring.
--
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com/blog