0

I have generated code with wsdl2java which works fine with default Java JAX-WS implementation. When I add CXF my application stops working. I know that this because switching JAX-WS implementation( Why wsdl2java generated code use CXF dependencies at will?).

I was debugging what is specific reason of failure and I found out that all my parameters are sent in message body. This is odd because it looks like CXF ignores header = true argument. Just like this:

@WebParam(name = "auth", targetNamespace = "urn:ns", header = true)

Why is that so? What might be the reason?

Secondary question:

I think that debugging annotation processing might help me. I've read some articles about that, but I don't know where I can find annotation processor for @WebParam. Any ideas? Any additional hints?

Community
  • 1
  • 1
nervosol
  • 1,295
  • 3
  • 24
  • 46

2 Answers2

1

We had the exact same issue. How is your CXF endpoint defined? Apparently you have a wsdlURL attribute defined, pointing to the wsdl. You should remove that.

Ours was something like this:

<cxf:cxfEndpoint
    id="upsTrackEndpoint"
    address="${ups.service.endpoint.track}"
    wsdlURL="wsdl/Track.wsdl"
    serviceClass="com.ups.wsdl.xoltws.track.v2.TrackPortType">
</cxf:cxfEndpoint>

We changed it into this:

<cxf:cxfEndpoint
    id="upsTrackEndpoint"
    address="${ups.service.endpoint.track}"
    serviceClass="com.ups.wsdl.xoltws.track.v2.TrackPortType">
</cxf:cxfEndpoint>

It seems that when you define the wsdlURL property, the header attribute is completely ignored.

Nazeem
  • 746
  • 1
  • 10
  • 29
0

Remove all of your CXF-related JAR dependencies, then use the JARs defined here instead: http://cxf.apache.org/docs/using-cxf-with-maven.html

It should solve the problem.

sancho21
  • 3,511
  • 1
  • 39
  • 45