#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2008
    Posts
    41
    Rep Power
    7

    Convert gsoap PHP program to C


    I am attempting to convert a PHP, which incorporates/includes gsoap, to C.
    I am having a issue with understanding the following:-
    Code:
    struct ns1__ArrayOfString
    {
    /// Size of array of char** is 0..unbounded
       $int                                  __sizestring                   0;
    /// Array char** of length 0..unbounded
        char**                               string                         0;    ///< Nillable pointer.
    };
     
    struct _ns1__GetMediaListResponse
    {
    /// Element GetMediaListResult of type "http://tempuri.org/":ArrayOfString.
        struct ns1__ArrayOfString*           GetMediaListResult             0;    ///< Optional element.
    };
    In my program I have defined
    Code:
    struct  _ns1__GetMediaListResponse* GetMediaListResponse;
    and I want to access the contents of the variable string

    I have tried various combinations of & * -> and . but not one works for me.

    In PHP this is achieved with
    Code:
    $result2 = $client->GetMediaList($params);
        $d = count($result2->GetMediaListResult->string);
        $MediaOne = $result2->GetMediaListResult->string[$d];
    Please tell me how I should write the following
    Code:
    n=sizeof(GetMediaListResponse.GetMediaListResult)/sizeof(GetMediaListResponse->GetMediaListResult[0].string);
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,413
    Rep Power
    1871
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2008
    Posts
    41
    Rep Power
    7

    Reply


    [QUOTE=salem]Another day, another cross-poster[/QUOTE

    Very helpful and intelligent, thank you.

IMN logo majestic logo threadwatch logo seochat tools logo