Parsing SOAP Response

Discussion in 'iPhone/iPad Programming' started by pdm7883, Sep 30, 2008.

  1. macrumors newbie

    Joined:
    Sep 30, 2008
    #1
    Hi Guys,

    I've written a SOAP client in my app, which is sending a SOAP request to the webservice.

    I'm getting a response from the webservice with the data, which I'm storing in NSDictionary.

    I'm struck here, as I quite don't understand how to parse(decode) the SOAP response message.

    My requirement is, I should store the data which is in the SOAP response in some local variable.

    i,e Just get the "PDM", "UK", "132456" from the below result, instead of the whole "{ DetailsResult etc"

    It's very crucial to me, appreciate any sample code to parse the SOAP response which is stored in NSDictionary.

    Thanks in advance.

    Code:
    -----

    // result - contains the SOAP response message.

    NSDictionary *result = (NSDictionary *)WSMethodInvocationInvoke(soapReq);
    NSLog(@"SOAP Response: %@", result);

    // get HTTP response from SOAP request so we can see response HTTP status code
    CFHTTPMessageRef res = (CFHTTPMessageRef)[result objectForKeyid)kWSHTTPResponseMessage];
    int resStatusCode = CFHTTPMessageGetResponseStatusCode(res);

    Logs: Here i've pasted the response in short, which I need to parse.
    -----
    "/Result" = {
    "DetailsResult" = {
    "diffgr:diffgram" = {
    NewDataSet = {
    Table = {
    NAME = "PDM";
    "COUNTRY" = "UK";
    "USR_EMAIL" = "PDM@gmail.com";
    "ID" = 100;
    "PH" = 132456 ;
    "COMPANY" = "ABC";
    };
    };
    };
     

Share This Page