Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to send SOAP messages with content-type application/soap+xml #1641

Open
CodedNikls opened this issue Dec 4, 2024 · 6 comments
Open

Comments

@CodedNikls
Copy link

I'm trying to send SOAP messages using a CXF client which is set up via

@CXFClient("myClient")
myGeneratedInterface cxfClient;

It has been working for me so far, but now I'm trying to switch to SOAP 1.2, which is why I'm trying to use content type application/soap+xml now.
As per the documentation, i used the following property to set the content type:
quarkus.cxf.client.myClient.content-type=application/soap+xml

However, the messages being sent out still use content-type text/xml, which is causing issues for me.
Is there a solution I am missing or can this content type currently not be used?
Thanks in advance!

@ppalaga
Copy link
Contributor

ppalaga commented Dec 4, 2024

Thanks for the report, @CodedNikls!

If you are on Quarkus CXF 3.16.0 or newer, could you please try forcing

quarkus.cxf.client.myClient.http-conduit-factory = URLConnectionHTTPConduitFactory

so that we can see whether there is something missing in the new default VertxHttpClientHTTPConduit?

@ppalaga
Copy link
Contributor

ppalaga commented Dec 4, 2024

I have added a test for quarkus.cxf.client.myClient.content-type and it IMO works as expected with or without quarkus.cxf.client.contentType.http-conduit-factory = URLConnectionHTTPConduitFactory. It would be great, if you could change the test so that it demonstrates the issue.

@CodedNikls
Copy link
Author

Hey, thanks for the quick answer! I am currently on quarkus cxf 3.13.1, will update now to see if that solves the issue.

@CodedNikls
Copy link
Author

CodedNikls commented Dec 10, 2024

We have updated to quarkus and quarkus-cxf 3.17.3 now and the issue was sadly not resolved that way. To go into further detail:
Our CXF-Client is configured via the following properties:

quarkus.cxf.client.myClient.client-endpoint-url=[target url]
quarkus.cxf.client.myClient.soap-binding=http://www.w3.org/2003/05/soap/bindings/HTTP/
quarkus.cxf.client.myClient.out-interceptors=org.apache.cxf.interceptor.LoggingOutInterceptor
quarkus.cxf.client.myClient.content-type=application/soap+xml

The message that is being logged via the LoggingOutInterceptor looks like this:

ID: 1
Address: [...]
Encoding: UTF-8
Http-Method: POST
Content-Type: text/xml; charset=UTF-8
Headers: {Accept=[*/*], Connection=[Keep-Alive]}
Payload: <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body>[...]</soap:Body></soap:Envelope>

As you can see, the content type remains text/xml, apparently disregarding the config property.
Ultimately, we want to have the following format in the content-type, as is standard for SOAP 1.2 messages:

Content-Type: application/soap+xml; charset=utf-8; action="[...]"

Are we configuring something wrong? Are you able to reproduce this problem?
Thank you in advance.

@ppalaga
Copy link
Contributor

ppalaga commented Dec 10, 2024

Thanks for the details @CodedNikls,

Would you please replace the quarkus.cxf.client.myClient.out-interceptors=org.apache.cxf.interceptor.LoggingOutInterceptor line by quarkus.cxf.client.myClient.logging.enabled = true and see whether anything changes?

@CodedNikls
Copy link
Author

Nothing changed about the behavior, but I do not get a log of the outgoing message now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants