[SWS-806] @ symbol in the content-id is converted to %40. The receiving web server is not able to handle it Created: 30/Oct/12  Updated: 03/Dec/12  Resolved: 03/Dec/12

Status: Resolved
Project: Spring Web Services
Component/s: XML
Affects Version/s: 1.5.6
Fix Version/s: 2.1.2

Type: Bug Priority: Major
Reporter: Jashandeep Singh Dhillon Assignee: Arjen Poutsma
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 1h 7m
Original Estimate: Not Specified


 Description   

Hi,

Spring ws version :1.5.6
Marshaller: Jaxb2Marshaller

Problem description: I am sending a series of Spring MTOM attachments to a webservice.In the Content-Id inside the "XOP" tag in the request XML there is a special character '@' which is encoded as % + ASCII hexadecimal
The web service provider is not able to handle this.

Please refer the following XML for issue.
<ns10:FingerImpressionImage>

  • <<ns6:BinaryBase64Object>
    <<xop:Include href="cid:be434728-da9e-4b88-858f-065cc11074a0%40niem.gov" xmlns:xop="http://www.w3.org/2004/08/xop/include" />
    </ns6:BinaryBase64Object>

— ------=_Part_4_1104626135.1351225350567
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Id: <[email protected]>

My question is as follows
1. Is this an issue or is that a standard process of encoding the Content-Id
2. Can I stop encoding from happening.
3. How is the Content-Id in Spring generated. How can i stop using Spring from using @niem.gov in the Content-Id.
4. In which jar file is the code for Content-Id.
5. Should this be handled at the service provider or consumer side.
6. How can i get around this problem?



 Comments   
Comment by Arjen Poutsma [ 03/Dec/12 ]

Hi,

Let me try and answer your questions:

1. This is a standard process. Content-IDs are URIs, and therefor need to be encoded.
2. You currently can't. However, if you want to customize the marshalling process, take a look at the Jaxb2AttachmentMarshaller and Jaxb2AttachmentUnmarshaller classes inside org.springframework.oxm.jaxb.Jaxb2Marshaller. Note that these classes are in the Spring Framework, not Spring Web Services.
3. It is generated from the element name space that the attachment is attached to. So in your case, niem.gov is probably the namespace of the XML element of the attachment.
4. Not sure I understand this question. Spring-WS is correct here, and has no problem interacting with other WS implementations doing MTOM. See the mton sample, for instance, which has a JAX-WS client.
5. Like I said in 2, take a look at the Jaxb2Marshaller in SPR, and create a custom subclass.

Generated at Thu Dec 14 06:14:15 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.