ios wsdl2objc response error 500 - ios

i am trying to make a request to a SOAP web service with the code below.
BasicHttpBinding_IGTBEihaleWSBinding *binding = [GTBEIhaleWSSvc BasicHttpBinding_IGTBEihaleWSBinding];
binding.logXMLInOut = YES;
GTBEIhaleWSSvc_IhaleListesiGetir *request = [GTBEIhaleWSSvc_IhaleListesiGetir new];
BasicHttpBinding_IGTBEihaleWSBindingResponse *response = [binding IhaleListesiGetirUsingParameters:request];
NSArray *responseHeaders = response.headers;
NSArray *responseBodyParts = response.bodyParts;
However, i am getting this error.
2014-02-21 11:33:36.348 Mobil Ihale Uygulamasi[22801:70b] ResponseStatus: 500
2014-02-21 11:33:36.349 Mobil Ihale Uygulamasi[22801:70b] ResponseHeaders:
{
Connection = close;
"Content-Length" = 449;
"Content-Type" = "text/xml;charset=UTF-8";
Date = "Fri, 21 Feb 2014 09:33:21 GMT";
Server = "Apache-Coyote/1.1";
}
2014-02-21 11:33:36.350 Mobil Ihale Uygulamasi[22801:70b] ResponseError:
Error Domain=BasicHttpBinding_IGTBEihaleWSBindingResponseHTTP Code=500 "internal server error" UserInfo=0x10923ce40 {NSLocalizedDescription=internal server error}
I don't have a problem with another SOAP service with this approach.

The cause of the problem is about wsdl2objc's parsing. Something is wrong with the generated code. Thus, I found another tool named Easy WSDL. It just worked perfect for me.

Related

QuickBlox v2.6 Facebook login issue

I have one issue facebook signing with quickblox api.
After getting AccessToken by using FBSDK.
[QBRequest logInWithSocialProvider:#"facebook" accessToken:accessToken accessTokenSecret:nil successBlock:^(QBResponse *response, QBUUser *user) {
} errorBlock:^(QBResponse *response) {}
i think facebook returns correct token string.
CAAVS4qDIQb4BAMS7pTl3P1EmtW1ZCOOpbTCQFWrBI8QsA7ufOTYapjF3rEpW1ojZChgOZB7mj6AWDocDSdtxFbksqP3FyZCIou6bUC6ON4ZCRFGPes6TBzufh68A9fBSSz6baTYCZCTIyZAoDhYdBZAvrHF3609cAiEZCesnWrtqYleqPv7YHIadrWf2x1oWItypF3V3pbDgsHd7MSSCcZBvK4yuHGeCUvf7qMPFznuRZCfwNCOcQBDU8ynHnzDPpnnhLEZD
[logInWithSocialProvider: accessToken: ...] function returns following error
[QBResponse], status: 422
2015-12-09 14:27:27.049 NudgeBuddies[2598:124844] [QBCore] Response error: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: client error (422)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x7ffde266ce40> { URL: https://api.quickblox.com/login.json } { status code: 422, headers {
"Access-Control-Allow-Origin" = "*";
"Cache-Control" = "no-cache";
Connection = "keep-alive";
"Content-Length" = 47;
"Content-Type" = "application/json; charset=utf-8";
Date = "Wed, 09 Dec 2015 06:27:26 GMT";
"QB-Token-ExpirationDate" = "2015-12-09 08:27:26 UTC";
"QuickBlox-REST-API-Version" = "0.1.1";
Server = "nginx/1.6.2";
Status = "422 Unprocessable Entity";
"X-Rack-Cache" = "invalidate, pass";
"X-Request-Id" = ab3443c24c0d5ee0a18d796eaf996cb7;
"X-Runtime" = "0.221723";
"X-UA-Compatible" = "IE=Edge,chrome=1";
} }, NSErrorFailingURLKey=https://api.quickblox.com/login.json, com.alamofire.serialization.response.error.data=<7b226572 726f7273 223a7b22 62617365 223a5b22 4c6f6769 6e206f72 20656d61 696c2072 65717569 72656422 5d7d7d>, NSLocalizedDescription=Request failed: client error (422)}
Please Help me.
How can i solve this problem?
Regards.
In QuickBlox SDK 2.6.5 we have improved stability and we have enabled detail logging so you are able to see the reasons why problem happens.
QuickBlox has open source project Q-municate with Facebook login and you can check it by yourself.
Thanks!

iOS App Signup Error

I receive this error when I tried to signup an account with the app im building. May I know what does this error means? Thank you!
BaseNetworkManager.m:164 Error Domain=AFNetworkingErrorDomain Code=-1011
"Expected status code in (200-299), got 500" UserInfo=0x16d30560
{NSLocalizedRecoverySuggestion=meta http-equiv="refresh" content="0;
url =websitelink.error.html"
AFNetworkingOperationFailingURLRequestErrorKey=NSMutableURLRequest: 0x16670d80> { URL: mywebsite/users.json }, NSErrorFailingURLKey=h mywebsite.com/users.json, NSLocalizedDescription=Expected status code in (200-299), got 500, AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x1669fe20> { URL: mywebsite.com/users.json } { status code: 500, headers {
Connection = "keep-alive";
"Content-Length" = 690;
"Content-Type" = "text/html; charset=utf-8";
Date = "Fri, 01 May 2015 12:37:44 GMT";
Server = Cowboy;
Status = "500 Internal Server Error";
Via = "1.1 vegur";
"X-Rack-Cache" = "invalidate, pass";
"X-Request-Id" = "tyud";
"X-Runtime" = "5.087065"; } }}
2015-05-01 20:37:45.002 appname[1677:60b] <BaseNetworkManager.m:165> (null)
The server is telling you
500 Internal Server Error
this means that the server has a problem that is not your fault. (unless you are the one who is responsible for the server.)
HTTP 200..299 means "ok"
HTTP 300..399 means "look somewhere else"
HTTP 400..499 means "there is a problem with your request." for example 404=file not found, 403=forbidden, etc.
HTTP 500..599 means "the server has a problem / is misconfigured"
see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more info.

Getting Request failed: unacceptable (406) when posting parameters

i am posting the parameter in the web-service. using the below code. and i am getting the "Request failed: unacceptable (406) Error .I am not sure is im posting it right .
I tried posting the data using their key and value pair using POSTMAN chrome app . and it is working fine there.Not here pls suggest .i am using Afnetworking for the first time
[params setValue:self.txtUserName forKey:#"name"];
[params setValue:self.txtEmail forKey:#"mail"];
[params setValue:self.txtPass forKey:#"conf_mail"];
[params setValue:self.txtPass2 forKey:#"pass"];
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
[manager POST:#"http://charlie.indivar.info/ministore/store-commerce/user/register"
parameters:params
success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(#"JSON: %#", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(#"Error: %#", error);
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:#"Error Retrieving Data"
message:[error localizedDescription]
delegate:nil
cancelButtonTitle:#"Ok"
otherButtonTitles:nil];
[alertView show];
}];
Below is the console log
Error: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: unacceptable (406)" UserInfo=0x8deb400 {com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x8ddddf0> { URL: http://website.com/ministore/store-commerce/user/register } { status code: 406, headers {
"Cache-Control" = "no-cache, must-revalidate, post-check=0, pre-check=0";
Connection = "Keep-Alive";
"Content-Length" = 396;
"Content-Type" = "application/json";
Date = "Fri, 10 Oct 2014 07:06:40 GMT";
Etag = "\"1412924800\"";
Expires = "Sun, 19 Nov 1978 05:00:00 GMT";
"Keep-Alive" = "timeout=5, max=100";
"Last-Modified" = "Fri, 10 Oct 2014 07:06:40 +0000";
Server = Apache;
"Set-Cookie" = "SESSd5cd87b70f9ea9019d306d6f4e440b74=5lpY8-PvQYRM5IBWiGk33EeXsucAJCBZQSce7vRBhEY; expires=Sun, 02-Nov-2014 10:40:01 GMT; path=/; domain=website.com; HttpOnly";
Vary = Accept;
"X-Drupal-Cache" = MISS;
"X-Powered-By" = "PHP/5.3.10-1ubuntu3.14";
} }, NSErrorFailingURLKey=http://website.com/ministore/store-commerce/user/register, NSLocalizedDescription=Request failed: unacceptable (406), com.alamofire.serialization.response.error.data=
0a7b2273 74617475 73223a22 30222c22 64617461 223a7b22 6e616d65 223a2255 7365726e 616d6520 63616e6e
6f742062 65206c6f 6e676572 20746861 6e203630 20636861 72616374
65727320 62757420 69732063 75727265 6e746c79 20323031 20636861
72616374 65727320 6c6f6e67 2e222c22 6d61696c 223a2254 68652065
2d6d6169 6c206164 64726573 7320266c 743b5549 54657874 4669656c
643a2030 78386462 63306230 3b206672 616d6520 3d202835 37203135
343b2031 35332033 30293b20 74657874 203d2026 23303339 3b646565
70616b73 6f6f6440 64656570 616b2e63 6f6d2623 3033393b 3b20636c
69707354 6f426f75 6e647320 3d205945 533b206f 70617175 65203d20
4e4f3b20 6175746f 72657369 7a65203d 20524d2b 424d3b20 67657374
75726552 65636f67 6e697a65 7273203d 20266c74 3b4e5341 72726179
3a203078 38663665 38613026 67743b3b 206c6179 6572203d 20266c74
3b43414c 61796572 3a203078 38646165 65653026 67743b26 67743b20
6973206e 6f742076 616c6964 2e227d7d>}
If the Web server detects that the data it wants to return is not
acceptable to the client, it returns a header containing the 406 error
code. This error occurs very infrequently in Web browsers, because most browsers will accept any data returned from the Web server.
Looks like the server is not recognized that you are mobile etc...
http://www.checkupdown.com/status/E406.html
This is a very old question, BUT:
You need to read the response data send by the server, the "0a7b2273..." part.
There, if you do:
NSString *responseString = [[NSString alloc] initWithData:thatData encoding:NSUTF8StringEncoding];
You'll see that the value is (it's JSON, I just linted it):
{
"status": "0",
"data": {
"name": "Username cannot be longer than 60 characters but is currently 201 characters long.",
"mail": "The e-mail address <UITextField: 0x8dbc0b0; frame = (57 154; 153 30); text = 'deepaksood#deepak.com'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x8f6e8a0>; layer = <CALayer: 0x8daeee0>> is not valid."
}
}
Your error was that in:
[params setValue:self.txtUserName forKey:#"name"];
self.txtEmail is a UITextField, not the textField.text. So, it was either self.txtEmail.text, or at some point, you wrote self.txtEmail = textField instead of self.txtEmail = textField.text. I guess this was also the case for the userName.
• So, after so much time, what's the thing that can still be applied nowadays:
Read the returned value! If might contain useful information on why it failed. When debugging, grab as much info as possible: HTTP Code, values send/read/received, etc.

Quickblox: an issue in deleting content item (picture file / blob)

I am having a weird issue when I try to delete a content item (picture blob item for the user), stored as PNG picture file in the back-end database.
The delete proceeds without errors, but gives "422 Unprocessable Entity". What does this mean? The status of the content item seems to be OK and ready when checked in Quickblox admin panel.
I have uploaded the content with following API call:
[QBContent TUploadFile:imageData fileName:#"profile.png" contentType:#"image/png" isPublic:YES delegate:self];
I am trying to delete the object with following API call:
[QBContent deleteBlobWithID:blobID delegate:self];
QB logs:
Performing async request:
DELETE http://api.quickblox.com/blobs/91049.xml
headers:{
"QB-SDK" = "iOS 1.8";
"Qb-Token" = b9e3d1cc708c8444070544df8c642ad194509e67;
"QuickBlox-REST-API-Version" = "0.1.1";
}
parameters:
2013-12-12 14:33:52.328 QBTestApp[21095:6b73] Request finished, response:
headers:{
"Access-Control-Allow-Origin" = "*";
"Cache-Control" = "no-cache";
Connection = "keep-alive";
"Content-Length" = 49;
"Content-Type" = "application/xml; charset=utf-8";
Date = "Thu, 12 Dec 2013 13:33:58 GMT";
"QB-Token-ExpirationDate" = "2013-12-12 15:32:22 UTC";
"QuickBlox-REST-API-Version" = "0.1.1";
Server = "nginx/1.0.15";
Status = "422 Unprocessable Entity";
"X-Rack-Cache" = "invalidate, pass";
"X-Request-Id" = 3f235134e5aa0bd012ef78e54cddc164;
"X-Runtime" = "0.039680";
"X-UA-Compatible" = "IE=Edge,chrome=1";
}
body:
error:
<?xml version="1.0" encoding="UTF-8"?>
<errors/>
Any ideas what I might be doing wrong here? Thanks (again) in advance! :-)
The feeling that you are trying to delete a blob file that does not exisе. Please make sure that you are trying to delete a blob file after the upload and the creation process is completed(calling completedWithResult: with successful result).
If I could see the order of method calls TUploadFile: and deleteBlobWithID: in the code, I could help you more quickly.

iOS, RESTKit and oAuth - simple sample not working

I am writing a simple application on iOS and I am trying to consume a RESTFull webservice
To have some tips and get some knowledge I first start with twitter without using ios integrated libs, but I always get stocked on Auth.
Any working sample or link will be appreciated, as reminder twitter is not my final goal
For instance this is one of my code, based on RestKit and AFOAuth1Client :
NSURL *url = [NSURL URLWithString:#"https://api.twitter.com"];
AFOAuth1Client * twitterClient = [[AFOAuth1Client alloc] initWithBaseURL:url key:kCLIENTID secret:kCLIENTSECRET];
[twitterClient authorizeUsingOAuthWithRequestTokenPath:#"oauth/request_token"
userAuthorizationPath:#"oauth/authorize"
callbackURL:[NSURL URLWithString:#"af-twitter://success"]
accessTokenPath:#"oauth/access_token"
accessMethod:#"POST"
scope:#""
success:^(AFOAuth1Token *token, id responseObject) {
}
failure:^(NSError *error) {
}];
as you can see it does not work :
2013-06-17 16:59:01.389 restKitTest[14490:c07] I restkit:RKLog.m:34 RestKit logging initialized...
2013-06-17 16:59:02.653 restKitTest[14490:c07] I restkit.network:RKObjectRequestOperation.m:174 POST 'http://api.twitter.com/oauth/request_token'
2013-06-17 16:59:03.051 restKitTest[14490:c07] E restkit.network:RKObjectRequestOperation.m:203 POST 'http://api.twitter.com/oauth/request_token' (401 Unauthorized) [0.3980 s]: Error Domain=AFNetworkingErrorDomain Code=-1011 "Expected status code in (200-299), got 401" UserInfo=0x9c96640 {NSLocalizedRecoverySuggestion=Failed to validate oauth signature and token, AFNetworkingOperationFailingURLRequestErrorKey=<NSMutableURLRequest: 0x9877e20> { URL: http://api.twitter.com/oauth/request_token }, NSErrorFailingURLKey=http://api.twitter.com/oauth/request_token, NSLocalizedDescription=Expected status code in (200-299), got 401, AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x9aac910> { URL: http://api.twitter.com/oauth/request_token } { status code: 401, headers {
"Cache-Control" = "no-cache, no-store, must-revalidate, pre-check=0, post-check=0";
"Content-Encoding" = gzip;
"Content-Length" = 62;
"Content-Type" = "text/html; charset=utf-8";
Date = "Mon, 17 Jun 2013 14:59:03 GMT";
Expires = "Tue, 31 Mar 1981 05:00:00 GMT";
"Last-Modified" = "Mon, 17 Jun 2013 14:59:03 GMT";
Pragma = "no-cache";
Server = tfe;
"Set-Cookie" = "_twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCOJ3pVI%252FAToHaWQiJTIyYzUxN2UwNmUwYTI4%250AYzU1NmU0OTYxZDA5MDcwMmI3IgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--3291687666d367b6ccddc74513532bf56ea144d9; domain=.twitter.com; path=/; HttpOnly, guest_id=v1%3A137148114312677519; Domain=.twitter.com; Path=/; Expires=Wed, 17-Jun-2015 14:59:03 UTC";
Status = "401 Unauthorized";
Vary = "Accept-Encoding";
"x-frame-options" = SAMEORIGIN;
"x-mid" = af106773611449e1226d5dd5d531b64d91e4f3f8;
"x-runtime" = "0.01153";
"x-transaction" = 24e58d8eb3b7cdb5;
"x-ua-compatible" = "IE=10,chrome=1";
"x-xss-protection" = "1; mode=block";
} }}
"401 Unauthorized" indicates that your credentials are incorrect. So check your API keys.
try this:
[twitterClient authorizeUsingOAuthWithRequestTokenPath:#"/oauth/request_token"
userAuthorizationPath:#"/oauth/authorize"
callbackURL:[NSURL URLWithString:#"instantshare-twitter://success"]
accessTokenPath:#"/oauth/access_token"
accessMethod:#"POST"
scope:nil
success:^(AFOAuth1Token *accessToken, id responseObject) {
[twitterClient registerHTTPOperationClass:[AFJSONRequestOperation class]];
} failure:^(NSError *error) {
NSLog(#"Error: %#", error);
}];
Note the line scope:nil, for some reason it doesn't work with empty string.
Among other things, check your application settings in twitter. I'm not sure if this is the case, but I enabled Allow this application to be used to Sign in with Twitter and set Callback URL to some random valid url

Resources