问题描述
我一直在努力让使用Sudzc的网络服务工作。每当我将我的WSDL转换为obj-c而没有自动引用计数时,它就可以正常工作。问题是,我们现在正在iOS 5中构建所有应用程序,所有代码都使用ARC。 Sudzc现在还允许你创建一个启用了ARC的包,但是当我运行这个代码时它总是返回null。
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 building all our applications in iOS 5 now and all our code uses ARC. Sudzc now also allows you to create a bundle with ARC enabled but when I run this code it always returns null.
我试过调试Sudzc代码它确实收到了正确的从服务返回的xml响应。某处某些东西在翻译中丢失了。我尝试将没有ARC的工作Sudzc代码转换为启用了ARC的代码,但是一旦我修复了所有错误,它就会再次返回null。
I tried debugging the Sudzc code and it does receive a correct xml response back from the service. Somewhere something is lost in translation. I tried converting the working Sudzc code without ARC into code with ARC enabled but as soon as I've fixed all errors it returns null again.
有没有人遇到过这个并知道出了什么问题?可以省去我不必自己调试整个Sudzc代码的时间。
Did anyone encounter this and know what is going wrong? Would save me loads of time not having to debug the whole Sudzc code by myself.
推荐答案
在我的情况下(SUDZC with ARC for IOS),我已经替换了SoapRequest.m文件中的以下代码;
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];
不知何故,各个函数正在搜索名为Body的根元素。检查肥皂信封后,很容易看到根元素的名称是soap:Body。
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".
这篇关于使用iOS 5和ARC的Sudzc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!