Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7578315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:24:10+00:00 2026-05-30T17:24:10+00:00

everyone! My english is poor and sorry fot that. I want implement a function

  • 0

everyone! My english is poor and sorry fot that.

I want implement a function in my test iOS application.

There is a .NET Webservice API just like

“https://xxx.xxx.xx.xxx/FMS/Pages/Service/FMService.svc/Login”

I want to connect the API with two parameters:user and pass

using the GET method,and the url will be like:

“https://xxx.xxx.xx.xxx/FMS/Pages/Service/FMService.svc/Login?user=xxx&pass=xxx”

if login, the Webservice will return a JSON value just like {“d”:”success”}

if not, it will also return a JSON value like {“d”:”failure”}

I am using the ASIHTTPRequest framework and JSON framework

I dont know how to implement the function. So please help me, thanks a lot.

Best wishes!

NSURL *url = [NSURL URLWithString:@"https://192.168.1.245/FMS/Pages/Service/FMService.svc/Login?user=jiangxd&pass=123456"];

ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];

[request addRequestHeader:@"Accept" value:@"application/json"];

[request addRequestHeader:@"Content-Type" value:@"application/json"];

[request setRequestMethod:@"GET"];

[request setDelegate:self];

[request startAsynchronous];

NSString *responseString = [request responseString];

NSDictionary *responseDict = [responseString JSONValue];

NSString *unlockCode = [responseDict objectForKey:@"d"];

NSLog(@"%@",unlockCode);

The unlockCode is always null… and I dont understand why!

NSURL *url = [NSURL URLWithString:@"https://192.168.1.245/FMS/Pages/Service/FMService.svc/Login?user=jiangxd&pass=123456"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request startSynchronous];
NSError *error = [request error];
if (!error) 
{
    NSString *responseString = [request responseString];
    NSDictionary *responseDict = [responseString JSONValue];
    NSString *unlockCode = [responseDict objectForKey:@"d"];
    NSLog(@"%@",unlockCode);
}
else
{
    NSLog(@"%@",[error description]);
}

And now I change startAsynchronous to startSynchronous but there is also an error:

Error Domain=ASIHTTPRequestErrorDomain Code=1 “A connection failure occurred: SSL problem (Possible causes may include a bad/expired/self-signed certificate, clock set to wrong date)” UserInfo=0x6b81640 {NSUnderlyingError=0x6b811b0 “The operation couldn’t be completed. (OSStatus error -9807.)”, NSLocalizedDescription=A connection failure occurred: SSL problem (Possible causes may include a bad/expired/self-signed certificate, clock set to wrong date)}

NOTICE:The url is https, not http!(Is this the reason that I get an error?)

But if I access the url directly with browser, the Webservice will return the right value…

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:24:12+00:00Added an answer on May 30, 2026 at 5:24 pm

    You should probably try it, and then post your code. You’re asking someone to write this entire function for you, and I don’t think that that is the purpose of this site.

    Secondly, the developer behind the ASIHTTPRequest is no longer supporting it. Unless the community picks up, you might want to just learn how to do NSURLConnections from scratch.

    Edit: There we go. So, you’re doing this asynchronosly which means that when you start it, you’re not immediately going to have the response. Have you setup your callbacks to process the response?

    - (void)requestFinished:(ASIHTTPRequest *)request
    {
       // Use when fetching text data
       NSString *responseString = [request responseString];
    
       // Use when fetching binary data
       NSData *responseData = [request responseData];
    }
    
    - (void)requestFailed:(ASIHTTPRequest *)request
    {
       NSError *error = [request error];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

everyone. Firstly, forgive my poor English #_# I use ubuntu 11.10 now. And I
everyone I got a question , I want to implement a UI , Like
Hi everyone I'm french so scuse me for my english. My problem is that
Hi everyone I'm french so scuse me for my english.So I want to make
Hey everyone, a new guy here in C#.Net. I'm trying to make an application
Everyone managing open-source-software runs into the problem, that with the time the process of
Asking a simple question, just want everyone have fun to solve it. I got
Everyone, I am a newbie to android development. Now I have a question that
everyone The problem is if there exists two exported components which have the same
everyone! I want to know what this line does: sqlplus -s /nolog <<EOF Any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.