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