Jump to content

Search the Community

Showing results for tags 'php rest restful api'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I'm connecting up to an API via the following method however it is returning a "unauthorized" response. This is to validate the user credentials and return a response. I am trying to connect to a Way-2 with LDAP although I'm not a C# person. <?php //error_reporting(E_ALL); //ini_set('display_errors', '1'); $service_url = 'http://www.myurl.com/webservices/getuser'; $curl = curl_init($service_url); $curl_post_data = array( "username" => 'mywebservice', // "password" => 'wspass', // "UserProfileID" => 'weiuYhJxmeoQLsKvviPNzr==', "Name" => 'John' ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl); echo "Data: "; $xml = new SimpleXMLElement($curl_response); echo $xml; ?> In essence it should connect up to the webservice with the username and password as specified above, then a POST request is made to the $service_url with the following parameters: Request XML <xml> <UserProfileID>weiuYhJxmeoQLsKvviPNzr==</UserProfileID> <Name>John</Name> </xml> Example of Valid Response XML <xml> <UserProfileID>weiuYhJxmeoQLsKvviPNzr==</UserProfileID> <Name>John</Name> <ProfileImage>http://www.myurl.com/profile_image/dfkjd.png</ProfileImage> </xml> How can I modify my PHP accordingly to connect properly and get this working, and actually responding with the valid XML response for that user? Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.