Help with objectiveC and soap using WSCore

  • Hi,
    again I could really use the list's help Im working on a client
    written in cocoa and struggle with making valid soap calls using WSCore:

    Ill try to make myself more clear
    > I got this output to be made (simplified here)
    > <order>
    > <orderposition>blabla</orderposition>
    > <orderposition>blabla</orderposition>
    > <orderposition>blabla</orderposition>
    > <orderposition>blabla</orderposition>
    > <name>lala<name>
    > </order>

    Now, WSMakeStubs takes a CFTypeRef (so a void*) as Order so I could
    pass a custom object but I pass a dictionary with the params because
    that'll get serialized all by itself. The Problem is I cannot add
    serveral "orderposition" objects in a dictionary. I tried to add an
    NSArray to the Dictionary but that'll not produce the output above but:
    > <order>
    > <array length="4">
    > <0>
    > <orderposition>blabla</orderposition>
    > </0>
    > <1>
    > <orderposition>blabla</orderposition>
    > </1>
    > <2>
    > <orderposition>blabla</orderposition>
    > </2>
    > <3>
    > <orderposition>blabla</orderposition>
    > </3>
    > </array>
    > <name>lala<name>
    > </order>

    The result of soapCalls made via WSInvocation are all NSDictionaries
    with handle multiple elements in the first form just fine - giving me
    back an NSArray (which led me to believe I should fill the Parameters
    dictionary with one too!)

    Im not yet sure I did it right and therefore if it is a bug. Im quite
    the NOOB when it comes to WSCore and hope it is my fault - then its
    easier to remedy  :) BUT if it is a bug I'd be happy to report it. :)

    I also read the docs and know I can add a Callback for my objects...
    but then I'd have to serialize all values in the custom
    orderPositions (which would be an array) myself, no? So ... i;d have
    to serialize every orderPosition and it's values (which could again
    be ComplexTypes)
    ==> I'd end up having to do almost all serializing myself then!?

    Regards,
    Dom
  • It's not exactly clear what you are trying to achieve here. Based on the
    output you want to send it looks like plain XML and not a soap message. Also
    WSMakeStubs should be pointed to a WSDL URL to generate classes that you can
    use to send and receive SOAP messages.

    Additionally, WSCore de-serializes all complex types as NSDictionaries so it
    is up to you to decode these into your own model objects. WSCore also
    expects NSDictionaries with the 2 keys that identify the class and namespace
    (off the top of my head) so it is up to you to encode your model objects
    into NSDictionaries.

    If you only have a few web services methods you need to implement then this
    isn't too bad but if this is a big project I'd suggest looking for an
    alternative web services framework. Take a look at gSOAP
    http://www.cs.fsu.edu/~engelen/soap.html

    -----Original Message-----
    From: cocoa-dev-bounces+byron=<bluebearstudio.com...>
    [mailto:cocoa-dev-bounces+byron=<bluebearstudio.com...>] On
    Behalf Of Dominik Pich
    Sent: Thursday, October 26, 2006 7:00 AM
    To: <cocoa-dev...>
    Subject: Help with objectiveC and soap using WSCore

    Hi,
    again I could really use the list's help Im working on a client
    written in cocoa and struggle with making valid soap calls using WSCore:

    Ill try to make myself more clear
    > I got this output to be made (simplified here)
    > <order>
    > <orderposition>blabla</orderposition>
    > <orderposition>blabla</orderposition>
    > <orderposition>blabla</orderposition>
    > <orderposition>blabla</orderposition>
    > <name>lala<name>
    > </order>

    Now, WSMakeStubs takes a CFTypeRef (so a void*) as Order so I could
    pass a custom object but I pass a dictionary with the params because
    that'll get serialized all by itself. The Problem is I cannot add
    serveral "orderposition" objects in a dictionary. I tried to add an
    NSArray to the Dictionary but that'll not produce the output above but:
    > <order>
    > <array length="4">
    > <0>
    > <orderposition>blabla</orderposition>
    > </0>
    > <1>
    > <orderposition>blabla</orderposition>
    > </1>
    > <2>
    > <orderposition>blabla</orderposition>
    > </2>
    > <3>
    > <orderposition>blabla</orderposition>
    > </3>
    > </array>
    > <name>lala<name>
    > </order>

    The result of soapCalls made via WSInvocation are all NSDictionaries
    with handle multiple elements in the first form just fine - giving me
    back an NSArray (which led me to believe I should fill the Parameters
    dictionary with one too!)

    Im not yet sure I did it right and therefore if it is a bug. Im quite
    the NOOB when it comes to WSCore and hope it is my fault - then its
    easier to remedy  :) BUT if it is a bug I'd be happy to report it. :)

    I also read the docs and know I can add a Callback for my objects...
    but then I'd have to serialize all values in the custom
    orderPositions (which would be an array) myself, no? So ... i;d have
    to serialize every orderPosition and it's values (which could again
    be ComplexTypes)
    ==> I'd end up having to do almost all serializing myself then!?

    Regards,
    Dom

    _______________________________________________
    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list      (<Cocoa-dev...>)
    Help/Unsubscribe/Update your Subscription:
    http://lists.apple.com/mailman/options/cocoa-dev/<byron...>

    This email sent to <byron...>

    --
    No virus found in this incoming message.
    Checked by AVG Free Edition.
    Version: 7.1.408 / Virus Database: 268.13.13/500 - Release Date: 10/26/2006


    --
    No virus found in this outgoing message.
    Checked by AVG Free Edition.
    Version: 7.1.408 / Virus Database: 268.13.13/500 - Release Date: 10/26/2006
previous month october 2006 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