How to retrieve JSON object from xml text?

Home Forums Convertigo developers Forums as moved to Stack Overflow. How to retrieve JSON object from xml text?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #243750


    I define an http connector which represents an url that allows me to get an access token, When I execute this transaction, I get the xml described below.

    What is the good way to retrieve the JSON object from that XML by using a convertigo object?

    I am trying to do that by using transaction and sequence, but without success.

    Any ideas please?

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <document connector=”HTTP_connector_get_access_token” context=”studio_Maprospection:C:HTTP_connector_get_access_token” contextId=”studio_Maprospection:C:HTTP_connector_get_access_token” fromStub=”false” fromcache=”false” generated=”Tue Sep 11 15:43:34 CEST 2018″ project=”Maprospection” sequence=”” signature=”1536673414027″ transaction=”Default_transaction” version=”7.5.1 (build 44623)”>{“access_token”:”ZDI0MWRjYWI0ZjAxYjU3ZTVjY2UwNTE2YmYyODRkYWJlZmNlZTk0YmZiMWMzNjcwYTRiNWM0N2EyMTk3MDcxYQ”,”expires_in”:3600,”token_type”:”bearer”,”scope”:”read”}</document>
    Generated by Convertigo Enterprise Mobility Server
    Requester: InternalRequester



    My question here is about how to call sequence result by using convertigo objects?

    The resulting object is the above xml text. I want to retrieve the JSON text from it {“access_token”:”ZDI0MWRjYWI0ZjAxYjU3ZTVjY2UwNTE2YmYyODRkYWJlZmNlZTk0YmZiMWMzNjcwYTRiNWM0N2EyMTk3MDcxYQ”,”expires_in”:3600,”token_type”:”bearer”,”scope”:”read”}.

    I am trying to define an xml element by defining its source picker like that: //document/transaction/document//object/access_token/text() but the result is empty value after executing the corresponding sequence.

    WHat can I do please to get the correct value from JSON located in xml text?




    Nicolas Albert

    Sorry not answering before.
    Can you try to call your JSON service using a JSON Transaction instead of a standard HTTP Transaction ?



    THank you for your quick reply.

    Good luck.


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.