-1

I am using a WSDL file to pull data from an external source.

The data pull works from Postman. If I add the header "SOAPAction" it fails with the message "The configured protocol is not SOAP, which has been requested."

The same error happens when I run the request from Java Spring with the WSDL file. The problem is that I am not finding a way to remove this header from the request. In my Spring application I am using 'jakarta.xml.ws' to handle the request flow.

I tried creating a "HandlerResolver" to intercept the request and adjust the headers. This seems to only work for manually added header field, because my "SOAPAction" field is not showing in the list of headers.

This question suggests adding an interceptor, but my client class has no function "getOutInterceptors" where I can add my custom interceptor.

Is there any way to intercept the request properly after all headers have been added? Is there another way to remove this header field from the request?

I hope I provided all information necessary. If not I am happy to provide more information!

Thanks in advance!

P D
  • 19
  • 4
  • That header will only be added if required by the WSDL else it wouldn't be there in the first place. – M. Deinum Aug 03 '23 at 13:38
  • There is a part in the WSDL that says SOAPAction="" but if I remove it, the header will still be there, but with empty content (SOAPAction=""). Thats why I am trying to remove it completely one step later. – P D Aug 04 '23 at 07:49
  • If it is part of the WSDL you need to send it as the receiving end needs it to properly invoke the soap endpoint. You cannot just modify a contract to your own needs, it is a contract you got from another party hence you need to adhere to it. – M. Deinum Aug 04 '23 at 07:50
  • I agree, but when I adhere to it it fails.. I am in contact with the issuer of the WSDL. I hope they can help me. Thanks for verifying that it is not my fault :D – P D Aug 04 '23 at 08:21

0 Answers0