Click here to Skip to main content
11,409,450 members (62,787 online)
Click here to Skip to main content

Calling Web Services From JavaScript - Using SOAP Client

, 12 Feb 2009 CPOL
Rate this:
Please Sign up or sign in to vote.
We can call any web service method using JavaScript soap client


This article will show you how to make a web service call using only HTML markup and JavaScript.


This article is based on JavaScript SOAP Client on

Using the Code

Just copy and and change the scripts and markups. You can see a JavaScript example below.

//Calls Hello World Web Method.
var url = document.location.href.replace("default.htm", "webservicedemo.asmx");
// DEMO 1
function HelloWorld()
	var pl = new SOAPClientParameters();
	SOAPClient.invoke(url, "HelloWorld", pl, true, HelloWorld_callBack);
function HelloWorld_callBack(r)
// End of script.		

That's all guys.

Points of Interest

I already knew how to make a web service call from JavaScript using I could not make these calls on browsers other than Internet Explorer. So I searched and found this method. It is so simple to use. Add soapclient.js to your project and some code like the above. Then call it with something like button, etc.


  • 12th February, 2009: Initial post

I will be waiting for your questions. If you like it, please vote. Smile | :)


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Gökmen BULUT
Web Developer
Turkey Turkey
Borned in İstanbul/TURKEY....
Loves İstanbul...

Comments and Discussions

GeneralGreat Example, works in all browser PinmemberTahir Saleem19-Feb-13 1:33 
GeneralRe: Great Example, works in all browser PinmemberGökmen BULUT23-Feb-13 13:38 
GeneralMy vote of 5 PinmemberTahir Saleem19-Feb-13 1:30 
GeneralMy vote of 4 PinmemberUnareshraju23-Jul-12 0:15 
GeneralMy vote of 5 Pinmembermanoj kumar choubey27-Mar-12 5:11 
GeneralWebService Pinmemberramalingajm25-Apr-11 2:06 
Generalsoapclient.js and firefox 3 and 4 PinmemberMember 23138416-Apr-11 2:32 
Questionnot work in firefox Pinmembernimax3d116-Oct-10 4:16 
QuestionRe: not work in firefox Pinmemberrayrogar30-Oct-12 11:32 
GeneralOK. Pinmemberdilip201018-Aug-10 3:36 
QuestionWeb Service Error : "The underlying connection was closed: The connection was closed unexpectedly." Pinmemberganesh_barhate27-Jul-10 2:36 
GeneralUsing WebService Created in Java Pinmemberrraiyarela3-Jun-10 21:02 
Generalhi Please help me Pinmemberbhaveshcode27-Jul-09 21:17 
GeneralRe: hi Please help me Pinmemberspina20-Aug-09 17:59 
GeneralRe: hi Please help me Pinmemberpietjepietje8-Oct-09 4:12 
GeneralRe: hi Please help me PinmemberKiMO.133721-Aug-11 22:55 
QuestionJaume Pinmemberenric@mcrit.com22-May-09 2:27 
GeneralNot working in Firefox [modified] PinmemberSlingBlade29-Apr-09 19:46 
GeneralRe: Not working in Firefox Pinmemberpackets27-Nov-10 18:44 
GeneralRemote Web Service Pinmembersmoore418-Feb-09 3:01 
GeneralRe: Remote Web Service PinmemberGökmen BULUT6-Mar-09 4:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150414.5 | Last Updated 12 Feb 2009
Article Copyright 2009 by Gökmen BULUT
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid