[ 
https://issues.apache.org/jira/browse/CXF-8281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17159734#comment-17159734
 ] 

Rajesh commented on CXF-8281:
-----------------------------

Hi Colm O hEigeartaigh, 

 
 
Please find the above  sample project and follow below steps to test the 
application .
1. check out the code and import to eclipse as maven project 
2. build the application : maven -> install
3. run mail class file ( InvoiceApplication -> Environment variable 
(CISCO_LC=DEV) 
4. Once application started successfully it will expose as this URL 
(http://localhost:8080/ariba/services/invoice)
5. Test application from SOAP UI by pointing about URL with attached SOAP 
Request .
 steps to test in soap ui.
 5.1. Place provided request in soap request
 5.2. Go to attachments ->  add attachment file which we provided .
 
 
Debug File Name at POSwAInInterceptor:72 - name :Test12'°U.pdf

Let us know if you need any further details to test the application

> Issue with  attachment Chinese file name
> ----------------------------------------
>
>                 Key: CXF-8281
>                 URL: https://issues.apache.org/jira/browse/CXF-8281
>             Project: CXF
>          Issue Type: Bug
>          Components: Bus, JAX-WS Runtime, WS-* Components
>    Affects Versions: 3.2.4
>            Reporter: Rajesh
>            Priority: Major
>         Attachments: Capture.PNG, Capture.PNG, CustomDataHandler.java, 
> Freeman Yue Fang.url, POAttachmentInterceptor.java, POHeaderInterceptor.java, 
> POInvokeHandler.java, POSwAInInterceptor.java, SoapRequest, Test12送货记录.pdf, 
> attachment-soap.zip, invcreatearibaprod-container.zip, invoice-testing.rar, 
> payloadRequest.txt, screenshot-1.png, soap ui- payload and properties .png, 
> soapui.png
>
>
> 0
> I'm using apache CXF for exposing the webservice. While reading chinese file 
> name from upstream (SOAP UI in local), unable to read exact chinese 
> characters. It's giving file name as '°U'°U123.pdf . I have tried with all 
> encodings but no luck. For other English name attachments no issues, able to 
> read properly.
> {quote}From soap ui i'm sending UTF-8 encoding , while reading in java I have 
> used same.
>  byte[] b = attachmentName.getBytes(StandardCharsets.UTF_8); 
> String attachName = new String(b, StandardCharsets.UTF_8.name());
> `Below is my interceptor code.
> {quote}
> public void handleMessage(SoapMessage message) throws Fault {
>             logger.info("Handle Message for attachments ");
>             BindingOperationInfo bop = 
> message.getExchange().getBindingOperationInfo();   
>             if (bop == null) {
>                 return;
>             }
>             logger.info("binding info "+bop.getBinding());
>             if (bop.isUnwrapped()) {
>                 bop = bop.getWrappedOperation();
>             }
>             if (null == message.getAttachments() || 
> message.getAttachments().isEmpty() ){
>                 return;
>             }
>             Iterator<Attachment> iter = message.getAttachments().iterator();
>             Collection<Attachment> attchments = message.getAttachments();
>             logger.info("message get attachments size   : 
> "+attchments.size());
>              int attachmentCount=0;
>              Map<String, DataHandler> attachmentMap=   
> AttachmentUtil.getDHMap(attchments);
>              logger.info("Map<String, DataHandler> "+attachmentMap.size());
>             try{
>                 while (iter.hasNext()){
>                     Attachment attachment = iter.next();
>                     attachmentCount++;
>                     }
>                     }
>                     }



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to