我使用從我的iPhone項目sudzc生成的acr代碼。我已經導入了缺少的h文件,修復了body標籤,並且一切正常......對於任何函數的第一次調用。 我調用的函數在幾個位置在我的代碼就像在viewDidLoad中:IOS sudzc弧空第二個響應,第一個沒問題的工作
TestWsdlService_ManagerService* service = [TestWsdlService_ManagerService service];
[service getAttended:self action:@selector(getEventsHandler:) email: @"[email protected]" password: @"testpass"];
第一次調用效果很好。日誌啓用,所以我看到正確的職位和正確的迴應。 當我再次調用相同的功能,我只看到了正確的職位,但它給了我這個錯誤的空響應(沒有XML,沒什麼):
2012-08-14 10:26:55.574 Test[1768:11603] nserror Error Domain=CXMLErrorDomain Code=1
"Unknown error" UserInfo=0x6e5fea0 {NSLocalizedDescription=Unknown error}
2012-08-14 10:26:55.580 Test[1768:11603] Error: Unknown error
我也有這樣的一個單試了一下:
static TestSoapSingleton *sharedInstance = nil;
+ (TestSoapSingleton *)sharedInstance {
if (sharedInstance == nil) {
sharedInstance = [[super allocWithZone:NULL] init];
}
return sharedInstance;
}
- (id)init
{
self = [super init];
if (self) {
self.manager = [TestWsdlApi_ManagerService service];
self.manager.logging = YES;
self.username [email protected]"[email protected]";
self.password = @"test pass";
}
但最後我得到了同樣的錯誤。 錯誤在initWithData函數的CXMLDocument.m中拋出,因爲inData是空的(size = 0)。 也在connectionDidFinishLoading函數中的SoapRequest.m中,receivedData爲空。
我試圖調試SoapRequest.m並檢測到didReceiveResponse在函數的第一次和第二次調用中被調用,但didReceiveData僅在第一次調用。
,如果我做了兩方法調用權在彼此的後面是這樣的:
TestWsdlService_ManagerService* service = [TestWsdlService_ManagerService service];
[service getAttended:self action:@selector(getEventsHandler:) email: @"[email protected]" password: @"testpass"];
TestWsdlService_ManagerService* service2 = [TestWsdlService_ManagerService service];
[service2 getAttended:self action:@selector(getEventsHandler:) email: @"[email protected]" password: @"testpass"];
它也可以沒有任何問題。
希望任何人有一個解決方案,謝謝