私は .Net プログラマーであり、Xcode の初心者です。UITableViewController で iPad 上の WCF サービスからの結果を表示したいと考えています。wsdl2objc を使用して、サービスのスタブを正常に作成しました。作成される SOAP メッセージは次のとおりです。
2012-07-25 14:02:37.169 TestWCF[5280:fb03] OutputHeaders:
{
"Content-Length" = 572;
"Content-Type" = "text/xml; charset=utf-8";
Host = "XXX.XXX.XXX";
SOAPAction = "http://tempuri.org/IDocSync/getAllCategories";
"User-Agent" = wsdl2objc;
}
2012-07-25 14:02:37.172 TestWCF[5280:fb03] OutputBody:
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:iPadDocSyncServiceSvc="http://tempuri.org/" xmlns:ns1="http://tempuri.org/Imports" xmlns:tns1="http://schemas.datacontract.org/2004/07/DocSyncService" xmlns:tns2="http://schemas.microsoft.com/2003/10/Serialization/" xsl:version="1.0">
<soap:Body>
<iPadDocSyncServiceSvc:getAllCategories/>
</soap:Body>
</soap:Envelope>
2012-07-25 14:03:03.119 TestWCF[5280:fb03] ResponseStatus: 200
2012-07-25 14:03:03.120 TestWCF[5280:fb03] ResponseHeaders:
{
"Cache-Control" = private;
"Content-Encoding" = gzip;
"Content-Length" = 421;
"Content-Type" = "text/xml; charset=utf-8";
Date = "Wed, 25 Jul 2012 06:03:02 GMT";
Server = "Microsoft-IIS/7.5";
"Set-Cookie" = "ASP.NET_SessionId=55w4noiub50zqtqclwdx3ral; path=/; HttpOnly";
Vary = "Accept-Encoding";
"X-AspNet-Version" = "4.0.30319";
"X-Powered-By" = "ASP.NET";
}
2012-07-25 14:03:03.121 TestWCF[5280:fb03] ResponseBody:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<getAllCategoriesResponse xmlns="http://tempuri.org/">
<getAllCategoriesResult xmlns:a="http://schemas.datacontract.org/2004/07/DocSyncService" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Category>
<a:categoryId>4</a:categoryId>
<a:categoryName>IT</a:categoryName>
<a:categoryType>0</a:categoryType>
<a:docCount>3</a:docCount>
<a:subCategoryId>0</a:subCategoryId>
</a:Category>
<a:Category>
<a:categoryId>6</a:categoryId>
<a:categoryName>CPG</a:categoryName>
<a:categoryType>0</a:categoryType>
<a:docCount>1</a:docCount>
<a:subCategoryId>0</a:subCategoryId>
</a:Category>
</getAllCategoriesResult>
</getAllCategoriesResponse>
</s:Body>
</s:Envelope>
Appdelegate.m のコードは次のとおりです。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
BasicHttpBinding_IDocSyncBinding *myBinding = [iPadDocSyncServiceSvc BasicHttpBinding_IDocSyncBinding];
myBinding.logXMLInOut = YES;
//iPadDocSyncServiceSvc_getAllCategories *allCate = [[iPadDocSyncServiceSvc_getAllCategories new]autorelease];
iPadDocSyncServiceSvc_getAllCategories *allCate = [[iPadDocSyncServiceSvc_getAllCategories alloc]init];
BasicHttpBinding_IDocSyncBindingResponse *response = [myBinding getAllCategoriesUsingParameters:allCate];
for(id bodyPart in response.bodyParts)
{
//if([bodyPart isKindOfClass:[BasicHttpBinding_IDocSyncBindingResponse class]])
//{
//tns1_ArrayOfCategory *cateClass = (tns1_ArrayOfCategory *) bodyPart;
//[self.tableView reloadData];
//categories = (NSMutableArray *) cateClass;
//tns1_ArrayOfCategory *cateClass = [bodyPart getAllCategoriesResult];
self.categories = (NSMutableArray *) [bodyPart getAllCategoriesResult];
//}
}
return YES;
}
これを実行すると、シミュレーターに何も表示されません...空白の画面が表示されます。私が見逃していることは非常に明白です。どうすれば機能しますか?