Call ASMX Web Service using JQuery in SharePoint

There was query raised in TechNet forums regarding loading the Web Service content in Web part.
I posted below answer for that

Add a Content Editor Web Part and add the below snippet in the source editor.
You have to work on the processResult function for desired presentation of the fetched stock information.
<script type="text/javascript" src=""></script>
<script type="text/javascript">
$(document).ready(function() {
var soapEnv =
"<soapenv:Envelope xmlns:soapenv=''> \
<soapenv:Body> \
<GetQuote xmlns='http://www.webserviceX.NET/'> \
<symbol>MSFT</symbol> \
</GetQuote> \
</soapenv:Body> \

url: "",
type: "POST",
dataType: "xml",
data: soapEnv,
complete: processResult,
contentType: "text/xml; charset=\"utf-8\"

function processResult(xData, status) {
var liHtml =$(xData.responseXML.text);
<ul id="stockUL"/>


  1. Its really useful. thanks
    but how to format Stock Qoutes..


Post a Comment