server GlassFish3 with in NetBeans
What is missing on the following script:
Any help will be appreciated. I kind of stack on this.
<html>
<head>
</head>
<body>
<a onclick="sendSoap()" href="#">testC</a>
<script type="text/javascript" language=javascript>
function sendSoap()
{
var xmlhttp = new XMLHttpRequest();
var url = " var soap = "<?xml version='1.0' encoding='utf-8'?>"+
"<S:Envelope xmlns:S=' "<S:Header/><S:Body><ns2:sayHello xmlns:ns2=' "<arg0>test Hello</arg0></ns2:sayHello></S:Body></S:Envelope>";
//alert(soap);
xmlhttp.open("POST", url, true);
//xmlhttp.setRequestHeader("SOAPAction", " //xmlhttp.setRequestHeader("Content-Type", "text/xml");
xmlhttp.send(soap);
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState == 4)
{
var resultText = xmlhttp.responseText;
alert(resultText);
}
}
}
</script>
</body>
</html>
here is how th SOAP request and response should look like:
SOAP Request
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S=" <S:Header/>
<S:Body>
<ns2:sayHello xmlns:ns2=" <arg0>test Hello</arg0>
</ns2:sayHello>
</S:Body>
</S:Envelope>
SOAP Response
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S=" <S:Body>
<ns2:sayHelloResponse xmlns:ns2=" <return>Hello test Hello!</return>
</ns2:sayHelloResponse>
</S:Body>
</S:Envelope>
What is missing on the following script:
Any help will be appreciated. I kind of stack on this.
<html>
<head>
</head>
<body>
<a onclick="sendSoap()" href="#">testC</a>
<script type="text/javascript" language=javascript>
function sendSoap()
{
var xmlhttp = new XMLHttpRequest();
var url = " var soap = "<?xml version='1.0' encoding='utf-8'?>"+
"<S:Envelope xmlns:S=' "<S:Header/><S:Body><ns2:sayHello xmlns:ns2=' "<arg0>test Hello</arg0></ns2:sayHello></S:Body></S:Envelope>";
//alert(soap);
xmlhttp.open("POST", url, true);
//xmlhttp.setRequestHeader("SOAPAction", " //xmlhttp.setRequestHeader("Content-Type", "text/xml");
xmlhttp.send(soap);
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState == 4)
{
var resultText = xmlhttp.responseText;
alert(resultText);
}
}
}
</script>
</body>
</html>
here is how th SOAP request and response should look like:
SOAP Request
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S=" <S:Header/>
<S:Body>
<ns2:sayHello xmlns:ns2=" <arg0>test Hello</arg0>
</ns2:sayHello>
</S:Body>
</S:Envelope>
SOAP Response
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S=" <S:Body>
<ns2:sayHelloResponse xmlns:ns2=" <return>Hello test Hello!</return>
</ns2:sayHelloResponse>
</S:Body>
</S:Envelope>