/    Sign up×
Community /Pin to ProfileBookmark

Using webservice.htc: getting "Service unavailable"

Hi people,

I am trying to invoke a webservice from javascript.

When I work locally (running Apache Tomcat on my PC) the webservice is successfully working. However, when I ftp the page on my website (with an ISP) I am getting “Service unavailable” error.

Do you have any idea?

Thanks a lot

The following is the code I am using:

<HTML>
<HEAD>
<SCRIPT language=”JavaScript”>
function init()
{
service.onServiceAvailable = alertReady;
service.useService(“http://webservices.codingtheweb.com/bin/qotd.wsdl”,”quote“);
}

function alertReady() {
alert(“Ready”);
}

function getQuote() {
service.quote.callService(onmyresult,”getQuote”);
}

function onmyresult(result)
{
if (!result.error) {
service.innerHTML = result.value;
}else{
service.innerHTML = “Error: ” + result.errorDetail.code + ” ” + result.errorDetail.string + ” ” + result.errorDetail.raw;
}
}
</SCRIPT>
</HEAD>
<BODY onload=”init()”>
<button onclick=”getQuote()”>Get Quote of the Day</button>
<div id=”service” style=”behavior:url(htc/webservice.htc)”></div>
</BODY>

</HTML>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliApr 03.2005 — sounds like out of domain access problem.
×

Success!

Help @geazzo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...