User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 402,468 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,943 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 987 | Replies: 6
Reply
Join Date: Oct 2007
Posts: 22
Reputation: dave_nithis is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dave_nithis dave_nithis is offline Offline
Newbie Poster

Help in AJAX!!!!!!!!!!

  #1  
Jun 13th, 2008
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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2006
Posts: 13
Reputation: drago865 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
drago865 drago865 is offline Offline
Newbie Poster

Re: Help in AJAX!!!!!!!!!!

  #2  
Jun 13th, 2008
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:

  1. <form>
  2. <input type="text" id="x" />
  3. <input type="text" id="y" />
  4. <input type="button" onclick="getSum(x.value,y.value)" />
  5. <div id="result"></div>
  6. </form>

  1. function getSum(x, y)
  2. {
  3. var sum = x + y;
  4. document.getElementById("result").innerHTML = sum;
  5. }

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

I hope that helps!
Reply With Quote  
Join Date: Sep 2005
Posts: 674
Reputation: digital-ether has a spectacular aura about digital-ether has a spectacular aura about 
Rep Power: 5
Solved Threads: 39
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Practically a Master Poster

Re: Help in AJAX!!!!!!!!!!

  #3  
Jun 17th, 2008
Originally Posted by dave_nithis View Post
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?
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote  
Join Date: Oct 2007
Posts: 22
Reputation: dave_nithis is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dave_nithis dave_nithis is offline Offline
Newbie Poster

Re: Help in AJAX!!!!!!!!!!

  #4  
Jun 18th, 2008
Originally Posted by digital-ether View Post
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.
Last edited by dave_nithis : Jun 18th, 2008 at 1:19 am.
Reply With Quote  
Join Date: Aug 2006
Location: Noida, India
Posts: 157
Reputation: Luckychap is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 16
Luckychap's Avatar
Luckychap Luckychap is offline Offline
Junior Poster

Re: Help in AJAX!!!!!!!!!!

  #5  
Jun 18th, 2008
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 you think you have done a lot, then be ready for YOUR downfall.
Reply With Quote  
Join Date: Oct 2007
Posts: 22
Reputation: dave_nithis is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dave_nithis dave_nithis is offline Offline
Newbie Poster

Re: Help in AJAX!!!!!!!!!!

  #6  
Jun 19th, 2008
Originally Posted by Luckychap View Post
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.
Last edited by peter_budo : Jun 20th, 2008 at 8:16 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Join Date: Sep 2005
Posts: 674
Reputation: digital-ether has a spectacular aura about digital-ether has a spectacular aura about 
Rep Power: 5
Solved Threads: 39
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Practically a Master Poster

Re: Help in AJAX!!!!!!!!!!

  #7  
Jun 21st, 2008
Originally Posted by dave_nithis View Post
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.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 4:04 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC