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