cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

CSDK get xml param from remote service

AliBenBelgacem
14-Alexandrite

CSDK get xml param from remote service

Hello,

I implemented a remote service on c sdk. the service have a xml parameter

service(XML param) 

when i run the service from edge, i use twInfoTable_GetString function.:

 

 

 

enum msgCodeEnum implementedService(const char* entityName, const char* serviceName, twInfoTable* params, twInfoTable** content, void* userdata) {
    char* param;
    int res;
    TW_LOG(TW_TRACE, "implementedService- Function called");
    if (!content) {
        TW_LOG(TW_ERROR, "implementedService- NULL params or content pointer");
        return TWX_BAD_REQUEST;
    }

    /* Get properties read into local variables */
    twInfoTable_GetString(params, "param", 0, &param);
.........
...........
}

 

 

 

It worked until I put as parameter a long xml text (5000 characters).

The twInfoTable_GetString  truncate the text and i cannot have the whole parameter.

Do you have any idea how to get the whole param even when t's too long ?

Thank you for your help

ACCEPTED SOLUTION

Accepted Solutions

Hi @AliBenBelgacem ,

 

Looks like this issue is related to https://www.ptc.com/en/support/article/CS365049

Could you please try the following workaround as mentioned in the article resolution?

  1. Within the ThingWorx C-SDK, under src\utrils open the stringUtils.h file
  2. Locate the following line:
    • #define MAX_STR_LEN 65536
  3. Update this line as follows:
    • #define MAX_STR_LEN <Desired Max String Length>
  4. Recompile the C-SDK and retest calls which would have previously hit the MAX_STR_LEN value
Tony

View solution in original post

1 REPLY 1

Hi @AliBenBelgacem ,

 

Looks like this issue is related to https://www.ptc.com/en/support/article/CS365049

Could you please try the following workaround as mentioned in the article resolution?

  1. Within the ThingWorx C-SDK, under src\utrils open the stringUtils.h file
  2. Locate the following line:
    • #define MAX_STR_LEN 65536
  3. Update this line as follows:
    • #define MAX_STR_LEN <Desired Max String Length>
  4. Recompile the C-SDK and retest calls which would have previously hit the MAX_STR_LEN value
Tony
Announcements


Top Tags