Click here to Skip to main content
15,075,597 members

Comments by sairanga (Top 4 by date)

sairanga 11-Sep-12 6:19am View
How to create json web services using java platform?
sairanga 11-Sep-12 1:06am View
Hey this was my code i am getting no response it was showing white screen.......
sairanga 11-Sep-12 1:03am View
//This is my server side code in java web services
public class Demoapp {

//web method getname
public String getname(){
String s="HI this is First";

return s;


//This was my client side code using javascript
var settings = {requestType:"soap1.1",
error:function(XMLHttpRequest, textStatus, errorThrown){
throw XMLHttpRequest.responseText;
var oBuffer = new Array();
settings.requestType = "soap1.1";
settings.methodType = "POST";
settings.contentType = "text/xml";
settings.url = "";
settings.dataType = "text/xml";
settings.nameSpace = "http://Demoweb/";
settings.methodName = "getname";

oBuffer.push('<soap:envelope xmlns:xsi="" xmlns:xsd="" xmlns:soap="">');
oBuffer.push('<getname xmlns="http://Demoweb/">');
settings.requestData = oBuffer.join("");
alert("requestData:" + settings.requestData);
type: settings.methodType,
cache: false,
url: settings.url,
data: settings.requestData,
contentType: settings.contentType,
dataType: settings.dataType,
error: function(status){ alert("An error occurred in processing your request");},
success: function(data, testStatus){
alert('data = ' + data);
beforeSend: function(XMLHttpRequest){
if (settings.requestType == "soap1.1" || settings.requestType== "soap1.2")
XMLHttpRequest.setRequestHeader("SOAPAction",settings.nameSpace + settings.methodName);
XMLHttpRequest.setRequestHeader("Connection", "close"); } });
sairanga 10-Sep-12 14:02pm View
Thank you for reply,
I have already tried these examples.But i didn't get any response from client side even it was not hitting the server. I am using java web services on server side and i am trying to call those methods and url from client side using either java script(or)Jquery.Here the example contains web services.
Is it work for me.I am new to this platform please suggest me how to do this..