Hi all,

I am in the process of creating a web page.The page consists of a form where it will ask the users to give the input values(all values in integers).Those values should be passed and the values should be calculated.

I have the wsdl file from the client.I need to invoke the wsdl file using java script.Once it is invoked,calculation will be done and the results will be sent back.Our job is to capture those results from the clients and display it in the same web page.

I am planning it to do this using AJAX..But I dont how and where to start..Can anyone give the way how to do this requirement?

Regards
dave.

Hi, Dave.

To make calculations and display the results in the same page without reloading you don't need to use AJAX. It's really unnecessary for what the job requires. I'm assuming you have all the values stored in variables from your wsdl file.

First make a division in your HTML called "result" or something like that. Then make a button with an onclick event executing your Javascript function. Let's say you need to calculate the sum of two variables. Here's how you could do it:

<form>
     <input type="text" id="x" />
     <input type="text" id="y" />
     <input type="button" onclick="getSum(x.value,y.value)" />
     <div id="result"></div>
</form>
function getSum(x, y)
{
     var sum = x + y;
     document.getElementById("result").innerHTML = sum;
}

The sum will be sent to the "result" division.

I hope that helps! :)

Hi all,

I am in the process of creating a web page.The page consists of a form where it will ask the users to give the input values(all values in integers).Those values should be passed and the values should be calculated.

I have the wsdl file from the client.I need to invoke the wsdl file using java script.Once it is invoked,calculation will be done and the results will be sent back.Our job is to capture those results from the clients and display it in the same web page.

I am planning it to do this using AJAX..But I dont how and where to start..Can anyone give the way how to do this requirement?

Regards
dave.

Are you trying to figure out how to use the WSDL file to discover an exposed service and make use of it?
Or is the the actual performing of the AJAX requests what you want to figure out?

Are you trying to figure out how to use the WSDL file to discover an exposed service and make use of it?
Or is the the actual performing of the AJAX requests what you want to figure out?

Am trying to use the wsdl file and make us of the web service...I can use any technology..no compulsion to use ajax...But the invocation of the wsdl should be simple using java script or plain html...I can't go for jsp,servlets.Thats why i chose ajax.

When u donot need to go the server, then there is no concept of Ajax here. Ajax is used to send request to the server and get response back to the client.

When u donot need to go the server, then there is no concept of Ajax here. Ajax is used to send request to the server and get response back to the client.

yeah...That I know..My question is can we do the request using the wsdl file alone without contacting the server?

I tried with ajax and it is working..but i have given the path like this:

req.open('GET','http://trial.serviceobjects.com/fw/FastWeather.asmx/GetFiveDayForecastByZip?Zip=33909&LicenseKey=WS14-APN1-TIH4',true);

Note:The service is a free service that I got from internet.

Here I have not used the wsdl file.But I am given with only the wsdl file.My client have not given the whole url...So am messed up here..

Regards
Dave.

yeah...That I know..My question is can we do the request using the wsdl file alone without contacting the server?

I tried with ajax and it is working..but i have given the path like this:

req.open('GET','http://trial.serviceobjects.com/fw/FastWeather.asmx/GetFiveDayForecastByZip?Zip=33909&LicenseKey=WS14-APN1-TIH4',true);

Note:The service is a free service that I got from internet.

Here I have not used the wsdl file.But I am given with only the wsdl file.My client have not given the whole url...So am messed up here..

Regards
Dave.

Normally XMLHttpRequest (XHR) can only be made to the same host.

Cross domain is only possible if the web service (remote host) implements it. Either using a workaround such as cookies, url fragments, google gears etc. or the standard way http://www.w3.org/TR/access-control/ - which is not supported by majority of browsers however.

The easiest way to do cross-domain XHR is to proxy the remote domain through your server serving the HTML. You can also proxy the XML file to another remote domain, and have the remote domain return it to your document as JavaScript, since you can include JS from a remote domain without any problems.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.