Nested SOAP parameters

  • How do I make nested SOAP parameters in Cocoa?

    If I want to send a parameter like

    <name>ivan</name>

    I can simply set
    WSMethodInvocationSetParameters(soapCall, (CFDictionaryRef)params, nil);
    where
    params = [NSDictionary dictionaryWithObjectsAndKeys:@"ivan", @"name",
    nil);

    But what if I have a parameter like:

    <person>
        <name>ivan</name>
    </person>

    How do I pass that to WSMethodInvocationSetParameters?

    Ivan
  • I haven't looked at the SOAP stuff in a while, but have you tried
    storing the person
    parameters in a separate dictionary, and then passing that dictionary
    as a parameter?

    personDict = [NSDictionary dictionaryWithObjectsAndKeys:@"ivan",
    @"name", nil];
    params = [NSDictionary dictionaryWithObjectsAndKeys: personDict,
    @"person", nil];

    Conceptually, that will create params with the structure you're
    describing, so that's
    how I'd expect it to work.

    - d

    On Oct 4, 2007, at 5:48 AM, Ivan C Myrvold wrote:

    > How do I make nested SOAP parameters in Cocoa?
    >
    > If I want to send a parameter like
    >
    > <name>ivan</name>
    >
    > I can simply set
    > WSMethodInvocationSetParameters(soapCall, (CFDictionaryRef)params,
    > nil);
    > where
    > params = [NSDictionary dictionaryWithObjectsAndKeys:@"ivan",
    > @"name", nil);
    >
    > But what if I have a parameter like:
    >
    > <person>
    > <name>ivan</name>
    > </person>
    >
    > How do I pass that to WSMethodInvocationSetParameters?
    >
    > Ivan
  • No, that doesn't work. I have thought of that myself and tried it,
    but the resulting SOAP code will be:

              <person xsi:type="SOAP-ENC:Dictionary">

                <name xsi:type="xsd:string">ivan</name>

              </person>

    Den 4. okt. 2007 kl. 18:06 skrev Dave Hersey:

    > I haven't looked at the SOAP stuff in a while, but have you tried
    > storing the person
    > parameters in a separate dictionary, and then passing that
    > dictionary as a parameter?
    >
    > personDict = [NSDictionary dictionaryWithObjectsAndKeys:@"ivan",
    > @"name", nil];
    > params = [NSDictionary dictionaryWithObjectsAndKeys: personDict,
    > @"person", nil];
    >
    > Conceptually, that will create params with the structure you're
    > describing, so that's
    > how I'd expect it to work.
    >
    > - d
    >
    >
    > On Oct 4, 2007, at 5:48 AM, Ivan C Myrvold wrote:
    >
    >> How do I make nested SOAP parameters in Cocoa?
    >>
    >> If I want to send a parameter like
    >>
    >> <name>ivan</name>
    >>
    >> I can simply set
    >> WSMethodInvocationSetParameters(soapCall, (CFDictionaryRef)params,
    >> nil);
    >> where
    >> params = [NSDictionary dictionaryWithObjectsAndKeys:@"ivan",
    >> @"name", nil);
    >>
    >> But what if I have a parameter like:
    >>
    >> <person>
    >> <name>ivan</name>
    >> </person>
    >>
    >> How do I pass that to WSMethodInvocationSetParameters?
    >>
    >> Ivan

    >
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today