View Single Post
  #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