Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8281

Issue with attachment Chinese file name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.2.4
    • None
    • None
    • Advanced

    Description

      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.

      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.

      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++; }

      }
      }

      Attachments

        1. attachment-soap.zip
          16 kB
          Rajesh
        2. Capture.PNG
          221 kB
          jagadeesh
        3. Capture.PNG
          221 kB
          jagadeesh
        4. CustomDataHandler.java
          0.4 kB
          Rajesh
        5. Freeman Yue Fang.url
          0.1 kB
          Rajesh
        6. image.png
          38 kB
          Rajesh
        7. invcreatearibaprod-container.zip
          23.44 MB
          jagadeesh
        8. invoice-testing.rar
          18.74 MB
          Rajesh
        9. payloadRequest.txt
          58 kB
          Rajesh
        10. POAttachmentInterceptor.java
          9 kB
          Rajesh
        11. POHeaderInterceptor.java
          7 kB
          Rajesh
        12. POInvokeHandler.java
          5 kB
          Rajesh
        13. POSwAInInterceptor.java
          9 kB
          Rajesh
        14. screenshot-1.png
          217 kB
          Rajesh
        15. SoapRequest
          58 kB
          jagadeesh
        16. SOAPUI_1.PNG
          32 kB
          Rajesh
        17. SOAPUI_1.PNG
          32 kB
          Rajesh
        18. SOAPUI_2.PNG
          42 kB
          Rajesh
        19. SOAPUI_2.PNG
          42 kB
          Rajesh
        20. SOAPUI_3.PNG
          49 kB
          Rajesh
        21. SOAPUI_3.PNG
          49 kB
          Rajesh
        22. SOAPUI_ContentId.PNG
          69 kB
          Rajesh
        23. SOAPUI_ContentId.PNG
          69 kB
          Rajesh
        24. SOAPUI_FileName.PNG
          56 kB
          Rajesh
        25. soapui.png
          180 kB
          Rajesh
        26. soap ui- payload and properties .png
          162 kB
          Rajesh
        27. Test12送货记录.pdf
          3 kB
          jagadeesh
        28. wireshark.png
          49 kB
          Colm O hEigeartaigh
        29. wireshark[1].png
          49 kB
          Rajesh

        Issue Links

          Activity

            People

              Unassigned Unassigned
              RajeshThokala Rajesh
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: