Take the 2-minute tour ×

I'm trying to write a web service that has only one massage param and the rest are header params. My web service looks like this:

    @WebService(targetNamespace = WS_NAMESPACE + "/FileSvc")
    public interface FileSvc
        void uploadFile(@WebParam(name = "dataHandler") @XmlMimeType("application/octet-stream")DataHandler dataHandler,
                    @WebParam(header = true, name = "fileName") String fileName,
                    @WebParam(header = true, name = "fileSize") long fileSize);

The services factory is defined like this:

    <bean id="fileSvcProxyFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
            <property name="serviceClass" value="com....FileSvc"/>
            <property name="address" value="http://.../FileSvc"/>
            <property name="bus" ref="client_bus"/>
            <property name="dataBinding" ref="globalJAXBDataBinding" />

When I try testing this service -from a java client I get this error when I try loading the service:

Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Message part {http://.../FileSvc}fileName of Message {http://.../FileSvc}uploadFile cannot be processed. This can be caused by the use of JAX-WS-specific types without the JAX-WS service factory bean.

Can anyone explain to me how this webParam works?


share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Try removing the globalJAXBDataBinding thing and seeing if that helps. Alternatively, add @RequestWrapper and @ResponseWrapper annotations to the interface methods to point at appropriate wrapper types. Not 100% sure that will work, but worth a shot.

If it still doesn't work, a small full testcase would be appreciated.

share|improve this answer
I removed the globalJAXBDataBinding (its a wrapper we wrote for CXFs JAXBDataBinding) and it looks like it works. Thanks –  user1799339 May 2 '13 at 8:28
Can you explane to me why this should work. I really need to use the globalJAXBDataBinding because we have more the 5,000 classes and about 20 web services. So we have to use a global binding. I don't see how using a wrapper helps (I have to have the whole massage body only for the DataHandler or the C# client can't use the service), it makes no deference. Do I have more options or will it help you to see the whole picture? –  user1799339 May 2 '13 at 11:58
add comment

Your Answer


