Ios5 ios如何使用WSDL2ObjC从webservice获取数据
我无法在iPhone中显示数据。请告知 getdata.h getdata.m getview.mIos5 ios如何使用WSDL2ObjC从webservice获取数据,ios5,wsdl,xcode4.5,wsdl2objc,Ios5,Wsdl,Xcode4.5,Wsdl2objc,我无法在iPhone中显示数据。请告知 getdata.h getdata.m getview.m - (IBAction)buttonClick:(id)sender { GetDataFromPhoneSoapBinding *binding = [[GetDataFromPhoneService GetDataFromPhoneSoapBinding] initWithAddress:@"http://..."]; b
- (IBAction)buttonClick:(id)sender {
GetDataFromPhoneSoapBinding *binding = [[GetDataFromPhoneService GetDataFromPhoneSoapBinding] initWithAddress:@"http://..."];
binding.logXMLInOut = YES; // to get logging to the console.
GetDataFromPhoneService_GetPhoneInfo *request = [[GetDataFromPhoneService_GetPhoneInfo alloc] init];
request.phoneNo = @"66875920808"; // insert your phone number here.
GetDataFromPhoneSoapBindingResponse *resp = [binding GetPhoneInfoUsingParameters:request];
for (id mine in resp.bodyParts)
{
if ([mine isKindOfClass:[GetDataFromPhoneService_GetPhoneInfoResponse class]])
{
greeting.text = [mine GetPhoneInfoReturn];
}
}
这是数据
<p372:GetPhoneInfoResponse xmlns:p372="http://Bean.crew.cw.tg">
<GetPhoneInfoReturn>
<zimPersno>40347</zimPersno>
<firstname>WANCHART</firstname>
<lastname>SANGSUK</lastname>
</GetPhoneInfoReturn>
</p372:GetPhoneInfoResponse>
感谢Shivan Raptor,我尝试self.greeting.text=[[My GetPhoneInfoReturn]zimPersno];self.greeting2.text=[[mine GetPhoneInfoReturn]firstname];self.greeting3.text=[[mine GetPhoneInfoReturn]lastname];这是有效的。
- (IBAction)buttonClick:(id)sender {
GetDataFromPhoneSoapBinding *binding = [[GetDataFromPhoneService GetDataFromPhoneSoapBinding] initWithAddress:@"http://..."];
binding.logXMLInOut = YES; // to get logging to the console.
GetDataFromPhoneService_GetPhoneInfo *request = [[GetDataFromPhoneService_GetPhoneInfo alloc] init];
request.phoneNo = @"66875920808"; // insert your phone number here.
GetDataFromPhoneSoapBindingResponse *resp = [binding GetPhoneInfoUsingParameters:request];
for (id mine in resp.bodyParts)
{
if ([mine isKindOfClass:[GetDataFromPhoneService_GetPhoneInfoResponse class]])
{
greeting.text = [mine GetPhoneInfoReturn];
}
}
<p372:GetPhoneInfoResponse xmlns:p372="http://Bean.crew.cw.tg">
<GetPhoneInfoReturn>
<zimPersno>40347</zimPersno>
<firstname>WANCHART</firstname>
<lastname>SANGSUK</lastname>
</GetPhoneInfoReturn>
</p372:GetPhoneInfoResponse>