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 Java 8 in Action this week in the Java 8 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: 115
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: 60077
    
  65

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: 115
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: 60077
    
  65

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: 115
the reason is my mobile app is pure html pages and wanted to call some web services.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTML calling Java WebService
 
Similar Threads
Disabling Deployed Web Services through Java Code
War File on Web Server Communicating to ear File on Application Server?
ClassNotFoundException: ActionServlet
Web Services returning File help
web service not available