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

  • Home
  • SEARCH
  • 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 8185021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:42:10+00:00 2026-06-07T01:42:10+00:00

i have web service in php which contain method (login) that should return false

  • 0

i have web service in php which contain method (login) that should return
false or associated array !

iam trying to use it in c# , but c# keep telling me that i must use object to handle returned data and so i did , but i cant parse anything of data

this is a glimpse of code

        object user;
        user = Chat.login(txtUsername.Text,txtPassword.Text);

        if (user.Equals(false))
        {
            MessageBox.Show("Error !");
        }
        else {
           //i wanna here for example show user['name'] for example
        }

the above code works fine if user entered wrong data , and if it’s in system
it return mixed data (array of user data)
but i can’t use it

  • 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-06-07T01:42:12+00:00Added an answer on June 7, 2026 at 1:42 am

    You should rewrite the webservice so that it returns an object instead of two different types. In JSON it should look like,

    {"status": "SUCCEDED", "result": [1,2,3,4]} // valid login
    {"status": "FAILED"} // valid login
    

    Then you can check if status is "SUCCEDED".

    Another approach is to return an array. On success return associative array. On failure return an empty array. This allows you to check the length of the array to determine the success.

    [1,2,3,4] // valid login
    [] // valid login
    

    The example is in JSON. You can convert it to XML anyway. Most important thing is that you should have got the idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a RESTful PHP web service using Lithium which contains comments, each
I have a php web service that takes the request from android/iphone app and
I have web service in PHP which gets dateTime object (from asp) . I
I have a working PHP web service that returns data (if I input the
at work we have a web-based PHP-application which acts as the single UI that
I have created a web service in which i need to return multiple records
I have a PHP Code, that uses a web service to query some data.
I have a PHP SOAP web service, using CakePHP, which is returning a variable
I have a web service written in PHP to which an iPhone app connects
I have a web service written in PHP to which an iPhone app connects

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.