2
我试图从wsdl
文件中为iOS
生成源代码。我已经偶然发现了几个工具,至此wsclient++
和sudz
c似乎至少可以工作。但我需要使用相同的soap
界面向不同的服务器发送请求,具体取决于iOS
应用的状态。我可以使用sudzc更改服务器网址吗?
在由wsclient
产生我可以设置服务器URL的源代码通过
MyWebService* ws = [MyWebService service];
// // set base url for entire application
[SoapWebService setGlobalBaseUrl: @"http://domain.com"];
NSError* error = nil;
Result* rs = [ws callMethod: p1 param2:p2 error:&error];
这会我让我做这样的事情
if(condition1) [SoapWebService setGlobalBaseUrl: @"http://betaserver.com"];
if(condition2) [SoapWebService setGlobalBaseUrl: @"http://developserver.com"];
if(condition3) [SoapWebService setGlobalBaseUrl: @"http://liveserver.com"];
有没有办法来归档与类似的东西源代码由sudzc
生成?
我想看看你的代码,因为每个generted功能有类似SoapRequest * _request = [SoapRequest创建:_target动作:_action服务:自我的soapAction: @“http://server.com/xyz/GetSecurityToken”postData:_envelope deserializeTo:@“NSString”];这看起来好像我可以设置一个全球服务器网址:/ – user2879242
我为你更新了它。 – iDev