Bugün, daha önce yazmış olduğum Web Servisi çağırma işlemini JavaScript ile yapmaya çalıştım. JavaScript ile de çok kolay çağırabildiğimizi söyleyebilirim. Öncelikle HTML sayfası oluşturduktan sonra
etiketleri arasına JavaScript’ imi yazmaya başladım.[javascript]<script type= “text/javascript” language= “javascript” >
var xmlhttp;
function on_click()
{
var xmlToSend = "<?xml version-‘1.0’ encoding=’utf-8’?>
xmlToSend += "<soap:Envelope xmlns:xsi=’<a href="http://www.w3.org/20O1/XMLSchema-instance’">http://www.w3.org/20O1/XMLSchema-instance’</a> ";
xmlToSend += "xmlns:xsd= ‘<a href="http://www">http://www</a>.w3.org/2001/XMLSchema<sup>’</sup> ";
xmlToSend += "xmlns:soap= ‘http://schereas.xmlsoap.org/soap/envelope/’>”;
xmlToSend += <sup>“</sup><soap:Body><GetAllPeople xmlns«’<a href="http://tempuri.org/’">http://tempuri.org/’</a> />
xmlToSend += "</soap:Bodyx/soap: Envelope>";
xmlhttp = new XMLHttpRequest();
xml<a href="http://http.onreadystatechange">http.onreadystatechange</a> = state_Change();
x«lhttp.op€n("POST", "<a href="http://localhost:52501/DbService.svc">http://localhost:52501/DbService.svc</a>", false); xmlhttp.setRequestHeader("SOAPAction", "<a href="http://teapuri.org/I0bService/6etAllPeople">http://teapuri.org/I0bService/6etAllPeople</a>"); xnlhttp.setRequestHeader("Content-Type“, "text/xml"); xmlhttp.send(xmlToSe nd); var objResponse = document.getElementById(”responseDiv"); objResponse.innerText = xml<a href="http://http.responseXML.xml">http.responseXML.xml</a>;
//document.getElementByld(’responseDiv’J.innerHTML = xml<a href="http://http.responseXML.xml">http.responseXML.xml</a>;
var xmlDoc = xml<a href="http://http.responseXML">http.responseXML</a>;
var idlist = xmlDoc.getElementsByTagName("a:id");
var namelist = xmlDoc.getElementsByTagName("a:name");
var surnamelist = xmlDoc.getElementsByTagName("a:surname");
var missionlist = xmlDoc.getElementsByTagName("a:mission");
var telnolist = xmlDoc.getElementsByTagName("a:telno”);
for (i = 0; i <namelist.length ; i++)
{
document.write(”<b>"+(i+l)+". kişinin id’si:</b>") document.write(idlist[i].xml)
document.write(”<br></br>”)
document.write(<sup>,,</sup><b>” + (i + 1) + ”. kişinin adiî</b>") document.write(namelist[i].xml) document.write(”<br></br>”)
document.write(”<b>" + (i + 1) + ". kişinin soyadı:</b>") document.write(surnamelist[i].xml) document. write("<brx/br>")
document.write("<b>" + (i + 1) + ". kişinin görevi:</b>") document.write(missionlist[i].xml) document. write("<brx/br>")
document.write("<b>" + (i + 1) + ". kişinin telefon numarası:</b>") document.write(telnolist[i].xml) document. write("<brx/br>")
>
function state Change()
{
if (xml<a href="http://http.readystate">http.readystate</a> == 4)
{
if (xml<a href="http://http.status">http.status</a> == 200)
{
alertC“İşlem Tamam");
>
else
{
alert(“xml alırken problem var”);
>
>
>
</script>
<input type="button" onclick="on_click();" value="OK"/>
</div>
<div id="responseDiv“>
<p id="printDataNane">
</p>
</div>
[/javascript]Bir önceki sayfadaki ve üstteki komutları yazarak HTML sayfamı tamamladım.

Mantığını öğrenmek adına basit bir HTML sayfası tasarladım. Butona basıldığı zaman diğer sayfadaki sonucu aldım.


Her Tür Bilginin Adresi Her Tür Bilginin Adresi
I will be wanting to figure out the maximum amount regarding the over the internet looking on group once i will. Can certainly any one advise a common sites, myspace addresses, or simply online sites that you just come across clearest? Those which happen to be most desired? Many thanks!.
yes of course