You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "Shenavai, Manuel" <ma...@sap.com.INVALID> on 2022/05/02 10:11:55 UTC
Header En/Decoding in SOAP requests with attachments
Hi everyone,
we are using camel CXF and we found that for an outgoing request, the Content-ID header of attachments is URL-decoded. We can also see that the Content-ID of incoming requests is also URL-decoded. I would expect that for outgoing requests, the Content-ID would get URL-encoded. Any thoughts on this?
Thanks in advance &
Best regards,
Manuel
Code:
https://github.com/apache/cxf/blob/master/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java#L218
Stacktrace:
"main@1" prio=5 tid=0x1 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at org.apache.cxf.attachment.AttachmentSerializer.writeHeaders(AttachmentSerializer.java:218)
at org.apache.cxf.attachment.AttachmentSerializer.writeProlog(AttachmentSerializer.java:182)
at org.apache.cxf.interceptor.AttachmentOutInterceptor.handleMessage(AttachmentOutInterceptor.java:77)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
- locked <0x1538> (a org.apache.cxf.phase.PhaseInterceptorChain)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:441)
at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:170)
at org.apache.camel.impl.SynchronousDelegateProducer.process(SynchronousDelegateProducer.java:62)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:138)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:76)
at org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:186)
at org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:86)
at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:541)
at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:506)
at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:369)
at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:506)
at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:229)
at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:144)
at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:161)
at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:370)
at soap12.Client.sendMessage(Client.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
RE: Header En/Decoding in SOAP requests with attachments
Posted by "Shenavai, Manuel" <ma...@sap.com.INVALID>.
Thanks for the suggestion to create a bug report, Andriy. I created the following bug report:
https://issues.apache.org/jira/browse/CXF-8698
Best regards,
Manuel
-----Original Message-----
From: Shenavai, Manuel <ma...@sap.com.INVALID>
Sent: Montag, 2. Mai 2022 12:12
To: dev@cxf.apache.org
Subject: Header En/Decoding in SOAP requests with attachments
Hi everyone,
we are using camel CXF and we found that for an outgoing request, the Content-ID header of attachments is URL-decoded. We can also see that the Content-ID of incoming requests is also URL-decoded. I would expect that for outgoing requests, the Content-ID would get URL-encoded. Any thoughts on this?
Thanks in advance &
Best regards,
Manuel
Code:
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fcxf%2Fblob%2Fmaster%2Fcore%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fcxf%2Fattachment%2FAttachmentSerializer.java%23L218&data=05%7C01%7Cmanuel.shenavai%40sap.com%7C0a75dbdbc9934ac4998e08da2c243737%7C42f7676cf455423c82f6dc2d99791af7%7C0%7C0%7C637870831296878280%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EpKj%2FXJrhsg%2BeDiVpEGZYAl7ZYA0pmlvP6%2Fvzs6N6Uc%3D&reserved=0
Stacktrace:
"main@1" prio=5 tid=0x1 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at org.apache.cxf.attachment.AttachmentSerializer.writeHeaders(AttachmentSerializer.java:218)
at org.apache.cxf.attachment.AttachmentSerializer.writeProlog(AttachmentSerializer.java:182)
at org.apache.cxf.interceptor.AttachmentOutInterceptor.handleMessage(AttachmentOutInterceptor.java:77)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
- locked <0x1538> (a org.apache.cxf.phase.PhaseInterceptorChain)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:441)
at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:170)
at org.apache.camel.impl.SynchronousDelegateProducer.process(SynchronousDelegateProducer.java:62)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:138)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:76)
at org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:186)
at org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:86)
at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:541)
at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:506)
at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:369)
at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:506)
at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:229)
at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:144)
at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:161)
at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:370)
at soap12.Client.sendMessage(Client.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
Re: Header En/Decoding in SOAP requests with attachments
Posted by Andriy Redko <dr...@gmail.com>.
Hi Manuel,
Interesting, looking into RFC-2392, which says:
content-id = url-addr-spec
url-addr-spec = addr-spec ; URL encoding of RFC 822 addr-spec
Which basically confirms your observations, looks like a bug to me. Could you please
open an issue here [2]? Thank you.
[1] https://datatracker.ietf.org/doc/html/rfc2392
[2] https://issues.apache.org/jira/projects/CXF/issues/
Best Regards,
Andriy Redko
SM> Hi everyone,
SM> we are using camel CXF and we found that for an outgoing request, the Content-ID header of attachments is URL-decoded. We can also see that the Content-ID of incoming requests is also URL-decoded. I would expect that for outgoing requests, the Content-ID would get URL-encoded. Any thoughts on this?
SM> Thanks in advance &
SM> Best regards,
SM> Manuel
SM> Code:
SM> https://github.com/apache/cxf/blob/master/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java#L218
SM> Stacktrace:
SM> "main@1" prio=5 tid=0x1 nid=NA runnable
SM> java.lang.Thread.State: RUNNABLE
SM> at org.apache.cxf.attachment.AttachmentSerializer.writeHeaders(AttachmentSerializer.java:218)
SM> at org.apache.cxf.attachment.AttachmentSerializer.writeProlog(AttachmentSerializer.java:182)
SM> at org.apache.cxf.interceptor.AttachmentOutInterceptor.handleMessage(AttachmentOutInterceptor.java:77)
SM> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
SM> - locked <0x1538> (a org.apache.cxf.phase.PhaseInterceptorChain)
SM> at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532)
SM> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:441)
SM> at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:170)
SM> at org.apache.camel.impl.SynchronousDelegateProducer.process(SynchronousDelegateProducer.java:62)
SM> at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
SM> at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148)
SM> at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
SM> at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
SM> at org.apache.camel.processor.Pipeline.process(Pipeline.java:138)
SM> at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
SM> at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
SM> at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:76)
SM> at org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:186)
SM> at org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:86)
SM> at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:541)
SM> at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:506)
SM> at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:369)
SM> at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:506)
SM> at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:229)
SM> at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:144)
SM> at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:161)
SM> at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:370)
SM> at soap12.Client.sendMessage(Client.java:24)
SM> at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
SM> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
SM> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
SM> at java.lang.reflect.Method.invoke(Method.java:498)
SM> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
SM> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
SM> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
SM> at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
SM> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
SM> at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
SM> at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
SM> at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
SM> at org.junit.rules.RunRules.evaluate(RunRules.java:20)
SM> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
SM> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
SM> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
SM> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
SM> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
SM> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
SM> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
SM> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
SM> at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
SM> at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
SM> at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
SM> at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
SM> at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
SM> at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)