Sudzc with iOS 5 and ARC

后端 未结 4 471
太阳男子
太阳男子 2021-02-02 02:31

I\'ve been trying to get a webservices working using Sudzc. Whenever I convert my WSDL to obj-c without automatic reference counting it works just fine. The problem is, we are b

相关标签:
4条回答
  • 2021-02-02 02:38

    My webService was create in Java with Axis Eclipse.

    FOR ARC I use : "soapenv:Body"

    And in the file SoapObject.m I add

    #import "Soap.h"
    #import "SoapObject.h"
    
    0 讨论(0)
  • 2021-02-02 02:38

    In my case "env:Body" worked. Check your return xml (by printing) and replace appropriately

    0 讨论(0)
  • 2021-02-02 02:45

    In my case it was an .Net web service (WCF) and I had to use s:Body: Found out by printing the CXML document:

    CXMLNode* test = [doc rootElement];
    NSLog(@"%@",test);
    

    Here I got this:

    <CXMLElement 0x68c1a50 [0x68c1b10] s:Envelope <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><**s:Body**><GetUserIDResponse xmlns="http://tempuri.org/"><GetUserIDResult>8</GetUserIDResult></GetUserIDResponse></s:Body></s:Envelope>>
    

    Thanks to previous posts I was able to find it out and posted the complete answer again on my blog: http://www.dailycode.info/Blog/post/2012/08/07/SUDZC-webservices-always-return-0-(WCF-web-service-and-IOS-client).aspx

    0 讨论(0)
  • 2021-02-02 03:02

    In my case (SUDZC with ARC for IOS), I have replaced the folowing code in SoapRequest.m file;

    CXMLNode* element = [[Soap getNode: [doc rootElement] withName:@"Body"] childAtIndex:0];
    

    with

    CXMLNode* element = [[Soap getNode: [doc rootElement] withName:@"soap:Body"] childAtIndex:0];
    

    Somehow the respective function is searching for the root element with name "Body". After inspecting the soap envelope it is easy to see the root element's name is "soap:Body".

    0 讨论(0)
提交回复
热议问题