Quote:
Originally Posted by alexgeek
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>" )
alert( api_xml_http.responseText );
...