0

I created a web service endpoint with Spring-WS:

@Endpoint
public class MyEndpoint{

@PayloadRoot(namespace = NAMESPACE, localPart = "MyRequest"
@ResponsePayload
public final MyResponse MyService(@RequestPayload final MyRequest request, SoapHeader header) {

... implementation that creates the reponse ...

return response;
}

this creates me the service and generates the WSDL for the service. But, the section in my WSDL remains empty.

So, what do I have to do in order to 'populate' the header?

1 Answer 1

1

SoapHeader doesn't represent an individual header block, but the soap:Header element which contains all header blocks as children. This means that your service definition doesn't provide enough metadata to generate a WSDL with a message part bound to a header block. You would have to declare a SoapHeaderElement argument with a @SoapHeader annotation that specifies the name of the header block. In theory, that would provide enough metadata to generate the expected WSDL, but I believe that in practice Spring-WS doesn't support this. Note that that doesn't mean that the generated WSDL is incorrect. The reason is that it is not mandatory to declare header blocks in the WSDL.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.