Service Virtualization

 View Only
Expand all | Collapse all

Special Characters not read in REST based JSON response in 10.4

  • 1.  Special Characters not read in REST based JSON response in 10.4

    Posted Jul 22, 2019 06:32 AM
    I am using DevTest 10.4
    Creating a virtual service with JSON R & R pair. However, DevTest is not reading the special characters.

    Note - UTF-8 charset is added the response. 

    Expected response:

    {
    "key": "Näringsgrenen okänd",
    }

    Received response:
    "key": "N�ringsgrenen ok�nd" 
    OR ( Using SOAP UI or POSTMAN)
    "key": "N\ufffdringsgrenen ok\ufffdnd"

    Please suggest how to fix this.


  • 2.  RE: Special Characters not read in REST based JSON response in 10.4

    Posted Jul 22, 2019 03:10 PM
    Hello Raghu,

    I tried to reproduce this behavior with 10.4 Workstation and Portal but was not able to reproduce it.
    I get the expected response.

    Did you create the service image using Workstation or Portal?
    Could you provide a copy of your request and response pairs? 

    If cannot share your RR pair here, please feel free to open a support ticket for this behavior you are facing.

    Thank you,
    Heloisa


  • 3.  RE: Special Characters not read in REST based JSON response in 10.4

    Posted Jul 23, 2019 12:38 AM
    Hello Heloisa,

    I have tried to create using both, Portal & Workstation. Unfortunately both returned same result
    Sample R & R below.

    Request:
    GET /a/b/c/d

    Response:
    HTTP/1.1 200
    Content-type: application/json; charset=UTF-8

    {
    "version": 0,
    "number": "00",
    "Name": "Raghu Krishna",
    "Industry": "Private",
    "Name2": "Henkilöllisyystieto Näringsgrenen okänd",
    "Level": "2,00"
    }


  • 4.  RE: Special Characters not read in REST based JSON response in 10.4

    Posted Jul 23, 2019 11:21 AM
    Raghu,

    Thanks for providing a copy of the request and response.
    I was able to reproduce the issue.

    Could you open a support ticket and mention the ticket DE404079.

    I believe we have a patch that will help you with this VS.

    Thank you,
    Heloisa


  • 5.  RE: Special Characters not read in REST based JSON response in 10.4

    Posted Jul 23, 2019 11:49 AM
    Thank you Heloisa,

    Request you to guide me on how to raise a support ticket, please share link if any.

    Thanks & Regards, Raghu!!


  • 6.  RE: Special Characters not read in REST based JSON response in 10.4

    Posted Jul 23, 2019 12:04 PM
    I have tried to open a support ticket, but it says that I am not authorized to access the page
    Attached is the print screen for your reference.



  • 7.  RE: Special Characters not read in REST based JSON response in 10.4

    Posted Jul 23, 2019 12:15 PM
    Raghu,

    Try to call to +1-800-225-5224, or use the link below if you calling from outside North America:
    https://www.ca.com/us/services-support/ca-support/contact-support.html?intcmp=footernav#numbers

    They should be able to help you with the unauthorized access to open a support ticket.

    Thank you,
    Heloisa


  • 8.  RE: Special Characters not read in REST based JSON response in 10.4

    Posted Jul 23, 2019 01:10 PM
    Can you share the basics of what the patch entails in case we run into this issue with the extended character set used by some European countries?


  • 9.  RE: Special Characters not read in REST based JSON response in 10.4

    Posted Jul 23, 2019 06:06 AM
    I dont think this is the issue. 
    I have created virtual service using 10.2 version and it was reading the file. Whereas when I try to create using 10.4, it is not able to read.

    I have attached R & R for reference, please help and try to replicate.

    we have done the devtest upgrade recently to 10.4. Could this issue be related to the latest version?


  • 10.  RE: Special Characters not read in REST based JSON response in 10.4

    Posted Jul 23, 2019 12:54 AM
    Edited by Keith Jones Jul 23, 2019 12:55 AM
    To write scripts that administer Portal for ArcGIS, you need to choose a scripting language that allows you to construct URLs, make HTTP requests, and parse telldunkin


  • 11.  RE: Special Characters not read in REST based JSON response in 10.4

    Posted Jul 23, 2019 01:00 AM
    May I request you to explain in detail please? I have been creating virtual services with these kind of response and special characters and never faced such issue.


  • 12.  RE: Special Characters not read in REST based JSON response in 10.4

    Posted Jul 23, 2019 02:47 AM
    Try using other encodings like windows-1250. It works for special chars.

    Thanks.



  • 13.  RE: Special Characters not read in REST based JSON response in 10.4

    Posted Jul 23, 2019 06:07 AM
    I dont think this is the issue. 
    I have created virtual service using 10.2 version and it was reading the file. Whereas when I try to create using 10.4, it is not able to read.

    I have attached R & R for reference, please help and try to replicate.

    we have done the devtest upgrade recently to 10.4. Could this issue be related to the latest version?


  • 14.  RE: Special Characters not read in REST based JSON response in 10.4
    Best Answer

    Posted Jul 23, 2019 09:06 AM
    I had a similar issue recently with Danish characters in an R/R pair. We tried using CP1252 as an encoding during recording, but that failed as well.

    The issue was that SoapUI (which was the client) did not have its encoding set to UTF-8. When the request was sent to the service, SoapUI replaced the characters with special characters similar to your earlier screenshot. The result was that the request never matched in the VSI because the incoming request did not contain actual Danish characters.

    The service worked correctly on my US-based machine from both SoapUI and Postman, but not on the customer's machine. 

    When the customer changed the SoapUI encoding to UTF-8, the issue went away.
    SoapUI Encoding