TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
gzathegeeniahz
NA
6
0
Web services with javascript using .net
Dec 21 2005 7:45 AM
Hi.
I have an active web services called test.
So I have this piece of code in HTML writen in Javascript:
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
var url="http://localhost/test/Service1.asmx/Hello";
xmlhttp.open("GET", url, false);
var returnValue=xmlhttp.responseText;
document.Form1.t.value=returnValue;
And i have an HTML control with a name 't' where I preview the result.
This code works cause the method Hello which I'm invoking is without parameters.
But if I invoke one other mathod called 'Hi' which has one paremeter,like this:
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
var url="
http://localhost/test/Service1.asmx/Hi?a=3
";
xmlhttp.open("GET", url, false);
var returnValue=xmlhttp.responseText;
document.Form1.t.value=returnValue;
I get this response:"Request format is invalid": Any ideas?Anyone?
P.S:I am using visual studio.net,and i am inserting the next code in web.config file:
<
webServices
>
<
protocols
>
<
add
name
="HttpGet"/>
<
add
name
="HttpPost"/>
</
protocols
>
</
webServices
>
It wont work without it.
Reply
Answers (
1
)
Standalone web service
Standalone Webservice Namespace