Support of SoapHeader
See original GitHub issueHi,
It would be great, if there could be some support of SoapHeaders when you are using Feign for legacy Soap calls. I just recently came to legacy API, where it was mandatory.
And having something like this would be absolutely amazing as headers might be marshalled objects.
@RequestLine("POST /getObject")
@Headers({
"SOAPAction: getObject",
"Content-Type: text/xml"
})
MyJaxbObjectResponse getObject(@SoapHeader MyJaxbHeader header, MyJaxbObjectRequest request);
Second best thing would be method annotation where you could define per method interceptor @SoapHeader(MyJaxbHeaderInterceptor.class)
The simplest solution (which I chose as it is the simplest one and it fit my need) would be to add interceptor in builder (to encoder).
I created copy of SoapEncoder SoapEncoderWithHeader(JAXBContextFactory jaxbContextFactory, MyJaxbHeaderInterceptor headerInterceptor)
and I only had to add following two lines in encode method:
Marshaller headerMarshaller = jaxbContextFactory.createMarshaller(interceptor.getHeaderClass());
headerMarshaller.marshal(interceptor.createHeader(), soapMessage.getSOAPHeader());
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:8 (2 by maintainers)
Top Results From Across the Web
SOAPHeader (Java Platform SE 7 ) - Oracle Help Center
A SOAP header element consists of XML data that affects the way the application-specific content is processed by the message provider. For example,...
Read more >SoapHeader Class (System.Web.Services.Protocols)
Create a class that derives from SoapHeader representing the data passed into the SOAP header. Add a member to the class implementing an...
Read more >SOAP headers - IBM
Use a SOAP header to include application-specific context information in the web service SOAP request and response messages.
Read more >2.2. Adding SOAP Headers to a SOAP 1.1 Binding
As well as the mandatory message and part attributes, soap:header also supports the namespace , the use , and the encodingStyle attributes.
Read more >SoapHeader - Manual - PHP
The SoapHeader class ¶. (PHP 5, PHP 7, PHP 8). Introduction ¶. Represents a SOAP header. Class synopsis ¶.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@elesdoar that would add HTTP headers, but not a SOAP-ENV:Header in the Soap Envelope
Try extending a SOAPEncoder class: