Call PHP Web Service With Ajax

This is a discussion on "Call PHP Web Service With Ajax" within the PHP Forum section. This forum, and the thread "Call PHP Web Service With Ajax are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 6th, 2008, 05:05
2mk 2mk is offline
New Member
Join Date: Feb 2008
Location: Yogyakarta
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Call PHP Web Service With Ajax

How to call Web services with Ajax ?
Reply With Quote

  #2 (permalink)  
Old Feb 6th, 2008, 05:43
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to c010depunkk
Re: Call PHP Web Service With Ajax

Check out last month's newsletter for an introduction to AJAX:
http://creativecoding.webforumz.com/...-php-login.php

If you still need more help, try being a bit more specific about what you want to do.....
Reply With Quote
  #3 (permalink)  
Old Feb 8th, 2008, 04:17
2mk 2mk is offline
New Member
Join Date: Feb 2008
Location: Yogyakarta
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Call PHP Web Service With Ajax

Ok. I create web services with PHP and i want to call it using Ajax.
Reply With Quote
  #4 (permalink)  
Old Feb 8th, 2008, 15:42
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: Call PHP Web Service With Ajax

Are you speaking of basic php scripts or web services like they have in ASP.NET?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #5 (permalink)  
Old Feb 9th, 2008, 05:03
2mk 2mk is offline
New Member
Join Date: Feb 2008
Location: Yogyakarta
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Call PHP Web Service With Ajax

Quote:
Originally Posted by alexgeek View Post
Are you speaking of basic php scripts or web services like they have in ASP.NET?
I'm talking about web services that i create using php.

This is my simple web services

PHP: Select all

 <?php 
include('nusoap.php'); 
$server= new soap_server
$server->register('LoginPresenter'); 
 
//Login Presenter 
function LoginPresenter($user_mail$user_password

    if(!
$user_mail or !$user_password
    { 
        return new 
soap_fault
            
'Client'''
            
'Parameter anda tidak lengkap''' 
        
); 
    }else 
    { 
        ........................         
            return 
$user;             
    } 

$server->service($HTTP_RAW_POST_DATA); 
 
exit(); 
?>
I want to POST and GET data from this web services with Ajax.

Someone give me this script, but he using ASP for the web services :
PHP: Select all

 api_xml_http.open"post""soap_processor.asp"false ); 
 
api_xml_http.setRequestHeader"Content-Type""text/xml); 
 
api_xml_http.setRequestHeader"SOAPAction""soapserver/soap:AuthorizationModule#DoLogin" ); 
 
api_xml_http.send"<SOAP:Envelope xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\"><SOAP:Header></SOAP:Header><SOAP:Body><m:DoLogin xmlns:m=\"urn:soapserver/soap:AuthorizationModule\"><UserName>a</UserName><Password>a</Password></m:DoLogi n></SOAP:Body></SOAP:Envelope>" 
 
alertapi_xml_http.responseText ); 
 
... 

Last edited by 2mk; Feb 9th, 2008 at 05:12.
Reply With Quote
  #6 (permalink)  
Old Feb 9th, 2008, 22:02
CloudedVision's Avatar
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 942
Blog Entries: 8
Thanks: 2
Thanked 22 Times in 22 Posts
Send a message via AIM to CloudedVision Send a message via MSN to CloudedVision Send a message via Skype™ to CloudedVision
Re: Call PHP Web Service With Ajax

the reason is that javascript class is included in an external file. You'll have to get the external js file he was using and include it into the file, or rewrite it with another AJAX class. I like Mootools. (I recommend the beta though, the documenting is much better.)
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in IE after asynchronous (AJAX) call pesho318i Web Page Design 3 Mar 21st, 2008 15:17
[SOLVED] preserve the state of checkboxes after an AJAX call pesho318i JavaScript Forum 4 Nov 7th, 2007 16:35
[SOLVED] AJAX call to a servlet pesho318i JavaScript Forum 9 Oct 28th, 2007 12:40
AJAX call function melvinoyh JavaScript Forum 2 May 31st, 2006 01:02


All times are GMT. The time now is 20:41.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43