Using WSDL file for calling php webservice via jquery ajax

Javascript coding ..

Moderators: macek, egami, gesf

ramkumarlaks
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Nov 18, 2013 3:37 am

Using WSDL file for calling php webservice via jquery ajax

Postby ramkumarlaks » Mon Nov 18, 2013 8:50 pm

Hi,
I'm developing mobile website in jquery mobile.Its containing only html files.But the actual data for processing is coming from server.Using PHP for contacting sever and providing datas to the mobile application.So i'm using PHP native soap services for this.Most of them suggested the coding in ajax part,

$(document).ready(function() {
$("#submit").click(function(){

var formData = $("#callAjaxForm").serialize();

$.ajax({
type: "POST",
url: "http://localhost/jeemasmsmobile13112013/test_server.php",
cache: false,
data: formData,
success: onSuccess,
error: onError
});
return false;
});
});

and the test sever would be

<?php
if(!extension_loaded("soap")){
dl("php_soap.dll");
}

ini_set("soap.wsdl_cache_enabled","0");
$server = new SoapServer("test.wsdl");

function doHello($user,$pass){

$user = $_POST['name'];
$pass = $_POST['password'];
if($user == 'admin' && $pass == '1'){
return 'success';
}else{
return 'failed';
}
}

$server->AddFunction("doHello");
$server->handle();
?>

I already have a jquery form for the fields username,and password and having the WSDL file called test.wsdl for webservice.Is this the about method correct ??can't i use

$.ajax({
type: "POST",
url: "http://localhost/jeemasmsmobile13112013/test.wsdl",
cache: false,
data: formData,
success: onSuccess,
error: onError
});

Mentioned as test.wsdl directly.If not why the web service need for this.Kindly help me for going forward in the correct way.

Return to “JavaScript”

Who is online

Users browsing this forum: No registered users and 0 guests

cron