- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将一个简单的对象(具有两个字符串属性的自定义类)从 iOS 应用程序存储在 Cloudant 数据库中。到目前为止,我正在尝试应用 IBM Bluemix 文档中的 objective c 编程语言示例。它不起作用,以防我在不同的操作中拆分 cloudant 任务。
存储对象的代码来自教程并已被重用。( https://www.ng.bluemix.net/docs/services/data/index.html )
对于身份验证,我使用了 bluemix 上的 Facebook 服务,这很有效。
cloudant 中的数据库由该代码成功自动创建:“autmobiledb”和“_users”,并且数据记录的创建也有效。
但是当我在不同的操作中拆分云计算任务时,它不起作用并且我得到了一些 nil 对象。
也许是这样,因为我是objective c的新手。
模型类(要保存的数据)
CalcData、Automobile、Person、PersonSerializer
b) Controller 类(处理请求)
汽车 Controller
c) View (在 iOS 设备上显示)
View Controller
//创建到远程数据库的连接并存储示例数据 -> WORKS
- (void) setupIMFDatabase:(NSString *) dbname
{
// Get reference to data manager
IMFDataManager *manager = [IMFDataManager sharedInstance];
NSString *name = @"automobiledb"; //dbname;
// Information
NSLog(@"************** Inside Class 'setupIMFDatabase' ***************");
if( manager != nil )
{
NSLog(@"IMFDataManager is not NIL OK %@", manager.description);
if (self.datastore != nil)
{
NSLog(@"ERROR: self.datastore ");
}
// Create remote store
[manager remoteStore:name completionHandler:^(CDTStore *createdStore, NSError *error)
{
if(error){
// Handle error
NSLog(@"ERROR Time(%@): The REMOTE STORE can NOT be created because: %@", error.description);
}else{
CDTStore *store = createdStore;
NSLog(@"CDTStore created successfully: %@", store.name);
self.datastore = store;
NSLog(@"The self.datastore.name is %@ : ", self.datastore.name);
// Set permissions for current user on a store
// DB_ACCESS_GROUP_MEMBERS, DB_ACCESS_GROUP_ADMINS
[manager setCurrentUserPermissions: DB_ACCESS_GROUP_MEMBERS forStoreName: name completionHander:^(BOOL success, NSError *error) {
if(error){
// Handle error
NSLog(@"Cloudant User Permission ERROR: %@", error.description);
}else{
// setting permissions was successful
NSLog(@"No ERROR Description available - Cloudant User Permission OK");
}
if (success) {
// Handle error
NSLog(@"BOOLEAN CHECK: 'success == true' Cloudant User Permission");
} else {
// setting permissions was successful
NSLog(@"BOOLEAN CHECK: 'success == false' Cloudant User Permission");
}
}];
NSLog(@"INSIDE (Create remote store) the self.datastore is not NIL: %@", self.datastore.name);
CDTDataObjectMapper *mapper = (CDTDataObjectMapper*) self.datastore.mapper;
if (mapper != nil)
{
[mapper setDataType:@"CalcData" forClassName:@"CalcData" ];
NSLog(@"CDTDataObjectMapper is not NIL The description is: (%@)", mapper.description);
} else {
NSLog(@"ERROR: CDTDataObjectMapper IS NIL");
}
// Check the creation inside the setup if the database
CalcData* myCalcData = [[CalcData alloc] initWithValue:@"1+2=3" theID: @"12345"];
[self.datastore save:myCalcData completionHandler:^(id savedObject, NSError *error) {
NSLog(@"CHECK SAVE during the setup CALC DATA -- START ---");
if (error) {
// save was not successful, handler received an error
NSLog(@"The ERROR description is: (' %@ ')", error.description);
} else {
// use the result
CalcData *savedCalc = savedObject;
NSLog(@"The saved revision: %@", savedCalc);
NSLog(@"Data Saved: Value: %@ ID: %@", savedCalc.theCalcValue, savedCalc.theID);
}
NSLog(@"CHECK SAVE during the setup CALC DATA -- END ---");
}];
}
}];
} else {
NSLog(@"ERROR: IMFDataManager is NIL");
}
// Initialize the Mapper
if (self.datastore != nil)
{
NSLog(@"OUTSIDE self.datastore is not NIL: %@", self.datastore.name);
CDTDataObjectMapper *mapper = (CDTDataObjectMapper*) self.datastore.mapper;
if (mapper != nil)
{
NSLog(@"CDTDataObjectMapper is not NIL OK %@", mapper.description);
[mapper setDataType:@"CalcData" forClassName:@"CalcData" ];
} else {
NSLog(@"ERROR: CDTDataObjectMapper IS NIL");
}
} else {
NSLog(@"ERROR: self.datastore is NIL");
}
}
//将项目保存到 coudant -> 不起作用
- (void) createItem: (Automobile*) itemToStore
{
// Use an existing store
CDTStore *store = self.datastore;
if(store == nil)
{
NSLog(@"ERROR: The CDTStore inside 'createItem' is NIL");
return;
}
// The ObjectMapper must be a DataObjectMapper instance or a subclass
CDTDataObjectMapper *mapper = (CDTDataObjectMapper*) store.mapper;
if(mapper == nil)
{
NSLog(@"ERROR: The CDTDataObjectMapper nside 'createItem' is NIL");
return;
}
NSLog(@"TRY TO SAVE ITEM");
CalcData* myCalcData = [[CalcData alloc] initWithValue:@"1+2=3" theID: @"12345"];
NSLog(@"TRY TO SAVE ITEM: SetDataType");
[mapper setDataType:@"CalcData" forClassName:@"CalcData" ];
[store save:myCalcData completionHandler:^(id savedObject, NSError *error) {
NSLog(@"TRY TO CHECK SAVE RESULT CALC-- START ---");
// save was not successful, handler received an error
if (error) {
// save was not successful, handler received an error
NSLog(@"ERROR CAN NOT STORE DATA: %@", error.description);
} else {
// use the result
CalcData *savedCalc = savedObject;
NSLog(@"saved revision: %@", savedCalc);
NSLog(@"Data Saved: Value: %@ ID: %@", savedCalc.theCalcValue, savedCalc.theID);
}
NSLog(@"TRY TO CHECK SAVE RESULT CALC DATA -- END ---");
}];
}
//在 View 中使用 Controller
- (IBAction)saveToBlueMixClick:(id)sender {
NSLog(@"********************************* INIT CONTROLLER **************");
AutomobileController* myAutoController = [[AutomobileController alloc]init];
NSLog(@"********************************* INIT DATABASE **************");
NSString *name = @"automobiledb"; //dbname;
[myAutoController setupIMFDatabase:name];
NSLog(@"********************************* SAVE ITEM **************");
[myAutoController createItem:myAutomobile];
}
@end
2015-06-02 16:35:46.868 StoreInBlueMix[5618:2136563] ********************************* INIT CONTROLLER **************
2015-06-02 16:35:46.869 StoreInBlueMix[5618:2136563] ************************ INIT: AutomobileController DATABASE ***********************
2015-06-02 16:35:46.869 StoreInBlueMix[5618:2136563] ********************************* INIT DATABASE **************
2015-06-02 16:35:46.880 StoreInBlueMix[5618:2136597] [INFO] [IMFData] IMFDataAuthorizationManager initialized with scope (null)
2015-06-02 16:35:46.888 StoreInBlueMix[5618:2136597] [INFO] [IMFData] IMFDataAuthorizationManager registered as an NSURLProtocol
2015-06-02 16:35:46.896 StoreInBlueMix[5618:2136597] [INFO] [IMFData] IMFDataAuthorizationManager registering protected resource URL https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455
2015-06-02 16:35:46.932 StoreInBlueMix[5618:2136597] [INFO] [IMFData]
IMFDataManager initialized successfully:
CloudantToolkit Version: 1.0.0
CloudantToolkit Build Date: 20150309_1800
IMFData-Bluemix Version: 1.0.0
IMFData-Bluemix Build Date: 20150309_1800
Target URL: https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455
2015-06-02 16:35:46.939 StoreInBlueMix[5618:2136563]
IMFDataManager initialized successfully:
CloudantToolkit Version: 1.0.0
CloudantToolkit Build Date: 20150309_1800
IMFData-Bluemix Version: 1.0.0
IMFData-Bluemix Build Date: 20150309_1800
Target URL: https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455
2015-06-02 16:35:46.941 StoreInBlueMix[5618:2136563] ************** Inside Class 'setupIMFDatabase' ***************
2015-06-02 16:35:46.942 StoreInBlueMix[5618:2136563] IMFDataManager is not NIL OK <IMFDataManager: 0x14d8b980>
2015-06-02 16:35:46.943 StoreInBlueMix[5618:2136597] [INFO] [IMFData] remoteStore URL: https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/automobiledb
2015-06-02 16:35:46.952 StoreInBlueMix[5618:2136597] [INFO] [IMFData] CDTHttpHelper.sendHttpRequest:method:headers:payload:completionHandler: making HTTP request. Details:
URL: https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/automobiledb
Method: PUT
Headers:
2015-06-02 16:35:46.959 StoreInBlueMix[5618:2136563] ERROR: self.datastore is NIL
2015-06-02 16:35:46.961 StoreInBlueMix[5618:2136563] ********************************* SAVE ITEM **************
2015-06-02 16:35:46.962 StoreInBlueMix[5618:2136563] ERROR: The CDTStore inside 'createItem' is NIL
2015-06-02 16:35:46.969 StoreInBlueMix[5618:2136599] [INFO] [IMFData] IMFDataProtocol.sendRequestToProtectedResource: making HTTP request. Details:
URL: https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/automobiledb
Method: PUT
Headers:
Authorization : Bearer eyJh **** BIN DATA **** mSGGLrG4_yIBKA
2015-06-02 16:35:47.288 StoreInBlueMix[5618:2136599] [INFO] [IMFData] Authorization failure. Http status 401 received on request to https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/automobiledb
2015-06-02 16:35:47.298 StoreInBlueMix[5618:2136599] [INFO] [IMFData] Authorization token invalid. Requesting new token.
2015-06-02 16:35:47.308 StoreInBlueMix[5618:2136599] [INFO] [IMFData] Authorization failure. Http status 401 received on request to https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/automobiledb
2015-06-02 16:35:47.733 StoreInBlueMix[5618:2136620] [DEBUG] [IMF] -[WLAFHTTPClientWrapper requestRedirected:response:] in WLAFHTTPClientWrapper.m:235 :: Request Redirected to URL : http://localhost?code=FWO7lxoRjc20cmIG2J1F4xWHu6ErL85RP1maAgNXAC00N5Ao10nxEFXdNkhsDvrdRQFBeF3x-H6xXFaD4jiunp7SUoedMvjfh8fNcfMbYYTnoCCGhf-4bJ4-m9PLOkieu_a3QrEZew02ybFblXP23wJccHLIqWUMtlwGWkwLu-tWrsIsIKIq6dXeFoJfxltc&wl_result=%7B%22WL-Authentication-Success%22:%7B%22wl_facebookRealm%22:%7B%22userId%22:%22707109936101050%22,%22attributes%22:%7B%7D,%22isUserAuthenticated%22:1,%22displayName%22:%22Thomas+Nikolaus+Michael+S%22,%22deviceId%22:%22707109936101050%22%7D%7D%7D
2015-06-02 16:35:47.746 StoreInBlueMix[5618:2136620] [DEBUG] [IMF_OAUTH] -[IMFAuthorizationManager handleGrantCode:] in IMFAuthorizationManager.m:320 :: Grant code received successfully
2015-06-02 16:35:47.754 StoreInBlueMix[5618:2136620] [DEBUG] [IMF_OAUTH] -[IMFAuthorizationManager invokeTokenRequest] in IMFAuthorizationManager.m:326 :: Call token endpoint in order to obtain authorization token
2015-06-02 16:35:48.191 StoreInBlueMix[5618:2136620] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager generateKeyPair:withPublicKeyLabel:withKeySize:] in WLCertManager.m:216 :: generateKeyPair generating keypair --> Success
2015-06-02 16:35:48.265 StoreInBlueMix[5618:2136620] [DEBUG] [IMF] -[IMFAuthorizationRequest makeRequestWithPath:options:] in IMFAuthorizationRequest.m:70 :: Building the request URL with path: authorization/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/token
2015-06-02 16:35:48.271 StoreInBlueMix[5618:2136620] [DEBUG] [IMF] +[WLAFHTTPClientWrapper requestWithURL:] in WLAFHTTPClientWrapper.m:44 :: Request url is https://storeinbluemix.eu-gb.mybluemix.net/imf-authserver/authorization/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/token
2015-06-02 16:35:48.280 StoreInBlueMix[5618:2136620] [DEBUG] [IMF_REQUEST] -[IMFAuthorizationRequest sendRequestToPath:path:withOptions:] in IMFAuthorizationRequest.m:115 :: Request timeout is 60.000000
2015-06-02 16:35:48.292 StoreInBlueMix[5618:2136620] [DEBUG] [IMF_REQUEST] -[IMFAuthorizationRequest sendRequestToPath:path:withOptions:] in IMFAuthorizationRequest.m:171 :: Sending request (https://storeinbluemix.eu-gb.mybluemix.net/imf-authserver/authorization/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/token) with headers:
{
"Accept-Language" = de;
"User-Agent" = "/StoreInBlueMix/1 (iPad; iOS 8.1.2; Scale/1.00)/IMFAPI";
"X-REWRITE-DOMAIN" = "eu-gb.bluemix.net";
"X-WL-Auth" = 1;
"X-WL-Authenticate" = "eyJhbGci *** BIN DATA +++7mmJZKt5xu-HnO72i-BGYpA==";
"X-WL-Session" = "0152FE04-CEC6-4F65-9148-B94F892A6CE8";
}
Post Data: code=FWO7lxoRjc20cmIG2J1F4xWHu6ErL85RP1maAgNXAC00N5Ao10nxEFXdNkhsDvrdRQFBeF3x-H6xXFaD4jiunp7SUoedMvjfh8fNcfMbYYTnoCCGhf-4bJ4-m9PLOkieu_a3QrEZew02ybFblXP23wJccHLIqWUMtlwGWkwLu-tWrsIsIKIq6dXeFoJfxltc&redirect_uri=http://localhost&grant_type=authorization_code&client_id=1e4bea3c407e37e13e517ff74031217fd8196d08
2015-06-02 16:35:48.306 StoreInBlueMix[5618:2136620] [DEBUG] [IMF] -[WLAFHTTPClientWrapper start] in WLAFHTTPClientWrapper.m:194 :: Starting the request with URL https://storeinbluemix.eu-gb.mybluemix.net/imf-authserver/authorization/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/token
2015-06-02 16:35:48.315 StoreInBlueMix[5618:2136620] [DEBUG] [IMF_REQUEST] -[IMFAuthorizationRequest sendRequestToPath:path:withOptions:] in IMFAuthorizationRequest.m:174 :: waiting for response... (Thread=<NSThread: 0x14e56c20>{number = 3, name = AFNetworking})
2015-06-02 16:35:48.335 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:215 :: Request Failed
2015-06-02 16:35:48.343 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:216 :: Response Status Code : 0
2015-06-02 16:35:48.351 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:217 :: Response Error : wl-oauth-prevent-redirect
2015-06-02 16:35:48.467 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:199 :: Request Success
2015-06-02 16:35:48.477 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:200 :: Response Status Code : 200
2015-06-02 16:35:48.485 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:201 :: Response Content : {"token_type":"bearer","expires_in":3600,"id_token":"eyJhbGciOiJSUzI1NiIsImpwayI6eyJhb * BIN DATA * hmh10l6PcoUVnr6njYk99pj8g0JQjIIONtaXj5e6zc1-0jcue0n-2f8DrryXvTYcKrKxOAScc890uGQo5UBqneMjhn01DmWsyIZ561lj8uvXlg4SAj3XdoWW5CNx8fcH1DnrfiNVDAhJg","access_token":"e ** BIN DATA ** X9Ck91whdZyatn40t8ZTb7O3K31BA"}
2015-06-02 16:35:48.505 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[IMFAuthorizationRequest requestFinished:] in IMFAuthorizationRequest.m:341 :: Response Header: {
Connection = "Keep-Alive";
"Content-Type" = "application/json;charset=UTF-8";
Date = "Tue, 02 Jun 2015 14:35:42 GMT";
"Transfer-Encoding" = Identity;
"X-Backside-Transport" = "OK OK";
"X-Cf-Requestid" = "5007bbfb-e8f8-436c-6b26-dd9a99308ac0";
"X-Client-IP" = "79.254.2.52";
"X-Global-Transaction-ID" = 1597951457;
"X-Powered-By" = "Servlet/3.0";
}
Response Data: {"token_type":"bearer","expires_in":3600,"id_token":"eyJ *** BIN DATA **** BA"}
Status code=200
2015-06-02 16:35:48.601 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper start] in WLAFHTTPClientWrapper.m:194 :: Starting the request with URL https://storeinbluemix.eu-gb.mybluemix.net/imfmobileanalytics/v1/receiver/apps/902f719f-f8a7-449f-ad4b-d50d48e68455
2015-06-02 16:35:48.611 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper start] in WLAFHTTPClientWrapper.m:194 :: Starting the request with URL https://storeinbluemix.eu-gb.mybluemix.net/imfmobileanalytics/v1/receiver/apps/902f719f-f8a7-449f-ad4b-d50d48e68455
2015-06-02 16:35:48.620 StoreInBlueMix[5618:2136601] [INFO] [IMFData] Obtained authorization header. Re-issueing request to https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/automobiledb:
2015-06-02 16:35:48.629 StoreInBlueMix[5618:2136597] [INFO] [IMFData] IMFDataProtocol.sendRequestToProtectedResource: making HTTP request. Details:
URL: https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/automobiledb
Method: PUT
Headers:
Authorization : Bearer eyJhbGci * BIN DATA * vTYcKrKxOAScc890uGQo5UBqneMjhn01DmWsyIZ561lj8uvXlg4SAj3XdoWW5CNx8fcH1DnrfiNVDAhJg
2015-06-02 16:35:48.642 StoreInBlueMix[5618:2136563] [DEBUG] [IMF_OAUTH] -[IMFAuthorizationManager releaseCompletionHandlerQueue:error:] in IMFAuthorizationManager.m:428 :: Completion handlers queue released.
2015-06-02 16:35:48.649 StoreInBlueMix[5618:2136563] [DEBUG] [IMF_OAUTH] -[IMFAuthorizationManager clearCompletionHandlerQueue] in IMFAuthorizationManager.m:437 :: Completion handler queue cleared
2015-06-02 16:35:48.798 StoreInBlueMix[5618:2136600] [INFO] [IMFData] Response from server at https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/automobiledb
Http Status: 412
Response Body:
{
error = "file_exists";
reason = "The database could not be created, the file already exists.";
}
2015-06-02 16:35:48.807 StoreInBlueMix[5618:2136600] [INFO] [IMFData] Cloudant create remote database response: Remote DB URL: https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/automobiledb
HTTP_Status: 412
JSON Body: {
error = "file_exists";
reason = "The database could not be created, the file already exists.";
}
2015-06-02 16:35:48.816 StoreInBlueMix[5618:2136632] CDTStore created successfully: automobiledb
2015-06-02 16:35:48.817 StoreInBlueMix[5618:2136632] The self.datastore.name is automobiledb :
2015-06-02 16:35:48.821 StoreInBlueMix[5618:2136600] [INFO] [IMFData] CDTHttpHelper.sendHttpRequest:method:headers:payload:completionHandler: making HTTP request. Details:
URL: https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/_set_permissions
Method: POST
Headers:
Content-Type : application/json
Accept : application/json
Body:
{
access = members;
database = automobiledb;
identity = 707109936101050;
}
2015-06-02 16:35:48.828 StoreInBlueMix[5618:2136632] INSIDE (Create remote store) the self.datastore is not NIL: automobiledb
2015-06-02 16:35:48.830 StoreInBlueMix[5618:2136632] CDTDataObjectMapper is not NIL The description is: (<CDTDataObjectMapper: 0x14d81940>)
2015-06-02 16:35:48.834 StoreInBlueMix[5618:2136601] [INFO] [IMFData] CDTHttpHelper.sendHttpRequest:method:headers:payload:completionHandler: making HTTP request. Details:
URL: https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/automobiledb
Method: POST
Headers:
Content-Type : application/json
Accept : application/json
Body:
{
"@datatype" = CalcData;
theCalcValue = "1+2=3";
theID = 12345;
}
2015-06-02 16:35:48.846 StoreInBlueMix[5618:2136601] [INFO] [IMFData] IMFDataProtocol.sendRequestToProtectedResource: making HTTP request. Details:
URL: https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/_set_permissions
Method: POST
Headers:
Authorization : Bearer eyJh ** BIN DATA ** fuvXlg4SAj3XdoWW5CNx8fcH1DnrfiNVDAhJg
Content-Type : application/json
Accept : application/json
Body:
{
access = members;
database = automobiledb;
identity = 707109936101050;
}
2015-06-02 16:35:48.858 StoreInBlueMix[5618:2136601] [INFO] [IMFData] IMFDataProtocol.sendRequestToProtectedResource: making HTTP request. Details:
URL: https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/automobiledb
Method: POST
Headers:
Authorization : Bearer eyJhbGciOi ** BIN DATA ** iNVDAhJg
Content-Type : application/json
Accept : application/json
Body:
{
"@datatype" = CalcData;
theCalcValue = "1+2=3";
theID = 12345;
}
2015-06-02 16:35:48.987 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:199 :: Request Success
2015-06-02 16:35:48.994 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:200 :: Response Status Code : 201
2015-06-02 16:35:48.999 StoreInBlueMix[5618:2136632] [INFO] [IMFData] Response from server at https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/_set_permissions
Http Status: 200
Response Body:
{
message = "IMFCP022I: F\U00fcr den Benutzer 707109936101050 gibt es bereits die Berechtigung f\U00fcr die Datenbank automobiledb.";
status = OK;
}
2015-06-02 16:35:49.006 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper requestFinished:] in WLAFHTTPClientWrapper.m:201 :: Response Content : {}
2015-06-02 16:35:49.014 StoreInBlueMix[5618:2136632] [INFO] [IMFData] Set permissions response: Remote Index URL: https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/_set_permissions
HTTP_Status: 200
JSON Body: {
message = "IMFCP022I: F\U00fcr den Benutzer 707109936101050 gibt es bereits die Berechtigung f\U00fcr die Datenbank automobiledb.";
status = OK;
}
2015-06-02 16:35:49.024 StoreInBlueMix[5618:2136600] No ERROR Description available - Cloudant User Permission OK
2015-06-02 16:35:49.025 StoreInBlueMix[5618:2136600] BOOLEAN CHECK: 'success == true' Cloudant User Permission
2015-06-02 16:35:49.040 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:215 :: Request Failed
2015-06-02 16:35:49.050 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:216 :: Response Status Code : 500
2015-06-02 16:35:49.059 StoreInBlueMix[5618:2136563] [DEBUG] [IMF] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:217 :: Response Error : Expected status code in (200-299), got 500
2015-06-02 16:35:49.081 StoreInBlueMix[5618:2136563] [OCLogger] Request to send analytics data has failed.
2015-06-02 16:35:49.240 StoreInBlueMix[5618:2136632] [INFO] [IMFData] Response from server at https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/automobiledb
Http Status: 201
Response Body:
{
id = 32d92f7601ef00e7a95df62a4c2983c0;
ok = 1;
rev = "1-dcf9fa05185806284b4d73996540e7b2";
}
2015-06-02 16:35:49.251 StoreInBlueMix[5618:2136632] [INFO] [IMFData] Cloudant create document response. Remote URL: https://mobile.eu-gb.bluemix.net/imfdata/api/v1/apps/902f719f-f8a7-449f-ad4b-d50d48e68455/automobiledb
HTTP_Status: 201
JSON Body: {
id = 32d92f7601ef00e7a95df62a4c2983c0;
ok = 1;
rev = "1-dcf9fa05185806284b4d73996540e7b2";
}
2015-06-02 16:35:49.261 StoreInBlueMix[5618:2136601] CHECK SAVE during the setup CALC DATA -- START ---
2015-06-02 16:35:49.262 StoreInBlueMix[5618:2136601] The saved revision: <CalcData: 0x14e92a60>
2015-06-02 16:35:49.263 StoreInBlueMix[5618:2136601] Data Saved: Value: 1+2=3 ID: 12345
2015-06-02 16:35:49.263 StoreInBlueMix[5618:2136601] CHECK SAVE during the setup CALC DATA -- END ---
最佳答案
根据日志,它看起来有效。根据您的日志语句,我看到以下内容:
Print "ERROR: OK Cloudant User Permission", if error is nil.
Print "SUCCESS: Error Cloudant User Permission", if success is YES/TRUE.
日志语句仅显示create
db 和设置permissions
片段,在提供日志之前我无法评论save Object
.
关于ios - 当我将数据库任务拆分为不同的操作时,我无法使用 Objective c 和 Bluemix 将数据保存在 Cloudant 中,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30411542/
我遵循了一本名为“Sitepoint Full Stack Javascript with MEAN”的书中的教程,我刚刚完成了第 6 章,应该已经创建了一个带有“数据库”的“服务器”。数据库只不过是
在 Jquery 中,我创建两个数组,一个嵌入另一个数组,就像这样...... arrayOne = [{name:'a',value:1}, {name:'b',value:2}] var arra
这个问题在这里已经有了答案: What is the explanation for these bizarre JavaScript behaviours mentioned in the 'Wa
我被放在别人的代码上,有一个类用作其他组件的基础。当我尝试 ng serve --aot(或 build --prod)时,我得到以下信息。 @Component({ ...,
我正在测试一些代码,并使用数据创建了一个 json 文件。 问题是我在警报中收到“[object Object],[object Object]”。没有数据。 我做错了什么? 这是代码:
我想打印 [object Object],[object Object] 以明智地 "[[{ 'x': '1', 'y': '0' }, { 'x': '2', 'y': '1' }]]"; 在 ja
我有一个功能 View ,我正在尝试以特殊格式的方式输出。但我无法让列表功能正常工作。 我得到的唯一返回是[object Object][object Object] [object Object]
在使用优秀的 Sim.js 和 Three.js 库处理 WebGL 项目时,我偶然发现了下一个问题: 一路走来,它使用了 THREE.Ray 的下一个构造函数: var ray = new THRE
我正在使用 Material UI 进行多重选择。这是我的代码。 {listStates.map(col => (
我的代码使用ajax: $("#keyword").keyup(function() { var keyword = $("#keyword").val(); if (keyword.
我遇到了下一个错误,无法理解如何解决它。 Can't resolve all parameters for AuthenticationService: ([object Object], ?, [o
我正在尝试创建一个显示动态复选框的表单,至少应选中其中一个才能继续。我还需要获取一组选中的复选框。 这是组件的代码: import { Component, OnInit } from '@angul
我正在开发 NodeJs 应用程序,它是博客应用程序。我使用了快速验证器,我尝试在 UI 端使用快速闪存消息将帖子保存在数据库中之前使用闪存消息验证数据,我成功地将数据保存在数据库中,但在提交表单后消
我知道有些人问了同样的问题并得到了解答。我已经查看了所有这些,但仍然无法解决我的问题。我有一个 jquery snipet,它将值发送到处理程序,处理程序处理来自 JS 的值并将数据作为 JSON 数
我继承了一个非常草率的项目,我的任务是解释为什么它不好。我注意到他们在整个代码中都进行了这样的比较 (IQueryable).FirstOrDefault(x => x.Facility == fac
我只是在删除数组中的对象时偶然发现了这一点。 代码如下: friends = []; friends.push( { a: 'Nexus', b: 'Muffi
这两个代码片段有什么区别: object = nil; [object release] 对比 [object release]; object = nil; 哪个是最佳实践? 最佳答案 object
我应该为其他人将从中继承的第一个父对象传递哪个参数,哪个参数更有效 Object.create(Object.prototype) Object.create(Object) Object.creat
我在不同的对象上安排不同的选择器 [self performSelector:@selector(doSmth) withObject:objectA afterDelay:1]; [self per
NSLog(@"%p", &object); 和 NSLog(@"%p", object); 有什么区别? 两者似乎都打印出一个内存地址,但我不确定哪个是对象的实际内存地址。 最佳答案 这就是我喜欢的
我是一名优秀的程序员,十分优秀!