Results 1 to 8 of 8

Thread: JsonToDataType ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Colombia
    Posts
    1,191

    Default JsonToDataType ?

    I need you to help me out of the Swamp:

    I want to catch in an array (tsXmlerror), the error message the sXML string

    Code:
    Struct sXmlerror
       String  timestamp
       String  status
       String  Error
       String  message
       String  path
    End_Struct
    
    
     sXmlerror[] tsXmlerror 
     
    
         Set RequestHeader of hoXML to "Authorization" sToken
       Get UploadJSONString of hoXML shost sCadena to sXML
    
    sXML=
    {
      "timestamp": 1566050355347,
      "status": 401,
      "error": "Unauthorized",
      "message": "Unauthorized",
      "path": "/FacturaAsync"
    }
    
    If (Pos("error",sXML)) Begin
                   // pasar el json a un arreglo
                          Get Create (RefClass(cJsonObject))    to hoJxml
                          Get ParseString of hoJxml sXML        to bOk
                          If (bOk) Get JsonToDataType of hoJxml to tsXmlerror       
                          Send Destroy of hoJxml 
                          Send Info_Box sXML "FALLIDO"
                         Function_Return False
                    
     End
    When loading the structure, I get the error shown below.
    Thanks for your suggestions.

    Edgar
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	error.png 
Views:	17 
Size:	3.0 KB 
ID:	13023  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •