aspose file tools*
The moose likes Web Services and the fly likes HTML calling Java WebService Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "HTML calling Java WebService" Watch "HTML calling Java WebService" New topic
Author

HTML calling Java WebService

Shankar sanjay
Ranch Hand

Joined: Sep 14, 2009
Posts: 117
Hi,

I am using soapclient.js (java script file from http://www.codeproject.com/Articles/12816/JavaScript-SOAP-Client) and my html works IF I DEPLOYED IN SERVER. I mean that I can able to invoke my java web services using deployed html page.

The problem is if I open that HTML file in IE using file System(like go c:\) and call web services(using html button) its not working.

My doubt is the client should be running on any web/app server? anyone has tried like this?


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

When loaded via the file protocol, Ajax cannot be used.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Shankar sanjay
Ranch Hand

Joined: Sep 14, 2009
Posts: 117
hi Thanks for the reply and for me, its new to hear that ajax cannot be used in file protocol system.

after going thru the soapclient.js file understood that based on async Parameter, it decides that whether asynch(ajax) or sync call. If I pass async parameter as false, still I am facing the same problem.
I would like to know is there any sample java script code(not Ajax) which will use invoke web services.

Please help me on this
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Whether it's asynchronous or not, the rule is the same.

Why do you need to use the file protocol? There's not really any valid reason.
Shankar sanjay
Ranch Hand

Joined: Sep 14, 2009
Posts: 117
the reason is my mobile app is pure html pages and wanted to call some web services.
 
Consider Paul's rocket mass heater.
 
subject: HTML calling Java WebService