Javascript And Webservices

P

PeReGrin

Hello asp World,
Does someone know how to call a webservice in javascript ?
I just want an idea or a big way ...
Thanks for all,
 
L

Laurent Bugnion

Hi,
Hello asp World,
Does someone know how to call a webservice in javascript ?
I just want an idea or a big way ...
Thanks for all,

You use the XmlHttpObject to create HTTP requests to a server, which
answers with a Response. The XmlHttpObject supports either synchronous
and asynchronous calls (with a callback method). This is AJAX.

If additionally the request and the response contain SOAP messages (SOAP
being a XML dialect), then this is a web service client, which can be
used together with a ASP.NET Web method (server).

Here are a few links to get you started:
http://www.oreillynet.com/pub/a/javascript/synd/2002/08/30/mozillasoapapi.html?page=1
http://www.xml.com/pub/a/2005/02/09/xml-http-request.html
http://books.mozdev.org/html/mozilla-chp-12-sect-9.html

These links treat only of Mozilla, but the XmlHttpObject in IE is almost
the same as in Mozilla. Only the way to create the object itself is
different, Google for it, or check MSDN, I lost the link.

HTH,
Laurent
 
B

bruce barker \(sqlwork.com\)

it depends on what you mean by webservice. if you mean a soap request, then
its easy with firefox and safari, as they support making soap calls directly
(have a builtin method). if you are talking IE, you can try the IE soap
behavior.

you can use the xmlhhtprequest object to just send / fetch strings, in which
case its easy.

-- bruce (sqlwork.com)
 
L

Laurent Bugnion

Hi,
it depends on what you mean by webservice. if you mean a soap request, then
its easy with firefox and safari, as they support making soap calls directly
(have a builtin method). if you are talking IE, you can try the IE soap
behavior.

The IE Soap behaviour (webservice.htc IIRC) is badly bugged. It creates
enormous memory leaks. We found this out last year when we were using it
in our web application, and when we contacted Microsoft with a simple
repro to demonstrate the problem, they marked it "unsupported" a few
weeks later. I wouldn't recommend using it.

In the moment, and if you don't want to use the Atlas libraries, you are
pretty much stuck with simple XmlHttp requests, or write your own
JavaScript SOAP library (which I did in about 2 weeks time). It was
hard, but it works well.

Unfortunately, I cannot post that code, as it is property of my firm
(Siemens), but you will have the code if you buy our product ;-)

HTH,
Laurent

you can use the xmlhhtprequest object to just send / fetch strings, in which
case its easy.

Actually you can send/fetch any XML document, which makes it a bit more
flexible.
-- bruce (sqlwork.com)

HTH,
Laurent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top