Viral Gohel created CXF-7317:
--------------------------------

             Summary: Non-URL encoded Content-Id href does not seem be 
serilaized by CXF's AttachmentSerializer
                 Key: CXF-7317
                 URL: https://issues.apache.org/jira/browse/CXF-7317
             Project: CXF
          Issue Type: Bug
          Components: Core
    Affects Versions: 3.1.10
            Reporter: Viral Gohel


CXF-6484 states that, 

>> URL-encoded content ID for MTOM attachments causes problems with web service 
>> clients.  This is effectively a regression on:
  https://issues.apache.org/jira/browse/CXF-2669

For example, If the namespace is "https://cxf.apache.org/"; for the service 
endpoint, then the content id is now:
 5726d366-df25-4945-9f3b-3003a2ae8a70-3@http%3A%2F%2Fcxf.apache.org%2F

It was previously:
 [email protected]

Hence, 

Actual results:
Content Id contains the full namespace (as URL) which is URL encoded: 
5726d366-df25-4945-9f3b-3003a2ae8a70-3@http%3A%2F%2Fcxf.apache.org%2F

Expected results:
Content id does not require encoding and only contains hostname:  
[email protected]

With the attached reproducer, here's what the results looks like, 

Actual Result - 
href="cid:0842d204-23ec-4b6f-955b-0e38a4c2f35a-1@urn%3Awsc.td.com%2Fcis%2F2010%2F01%2F19

Expected Result -
href="cid:0842d204-23ec-4b6f-955b-0e38a4c2f35a-1@urn:Awsc.td.com/cis/2010/01/19

The difference here compared to the fix for CXF-6484, is that a non-url encoded 
href using namespace with 'urn:' for the attachments is used. 

For example, like the below in the @WebService class, 
@WebService(targetNamespace = "urn:wsc.td.com/cis/2010/01/19")
To me, it seems that the fix for CXF-6484 does not work for non-url encoded 
href. 

I.e After the fix of CXF-6484, 

Actual Result - 
href="cid:0842d204-23ec-4b6f-955b-0e38a4c2f35a-1@urn%3Awsc.td.com%2Fcis%2F2010%2F01%2F19

Expected Result -
href="cid:0842d204-23ec-4b6f-955b-0e38a4c2f35a-1@urn:Awsc.td.com/cis/2010/01/19

It looks like CXF's AttachmentSerializer is not able to serialize the forward 
slashes(/) or the AttachmentUtil needs to be changed. 
I am not sure if the proper urn: namespaces should be of format, i.e 
urn:com.namespace.someResource or it can be also like, 
urn:com/namespace/someResource.  

Can we make CXF to interpret and display the href in the Content-Id with 
non-url namespace as 
cid:0842d204-23ec-4b6f-955b-0e38a4c2f35a-1@urn:Awsc.td.com/cis/2010/01/19 ?

instead of 

href="cid:0842d204-23ec-4b6f-955b-0e38a4c2f35a-1@urn%3Awsc.td.com%2Fcis%2F2010%2F01%2F19






--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to