473,548 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling webservice with parameters using ServerXMLHTTP object

Hi All:

I have a .NET webservice accepting an XML request document as a
parameter
How do I call this webservice with ServerXMLHTTP object from my VB6.0
client?

I have enabled the HttpPost and HttpGet protocols in the web.config
file.

This is the calling part:

Set xmlHTTPRequest = New MSXML2.ServerXM LHTTP40
xmlHTTPRequest. open "POST",
"http://localhost/WebService2/QueueList.asmx/QueueList", True
sParam = "strXMLRequest: =" & xmlDom.xml
xmlHTTPRequest. send (sParam)
It keeps throwing the error "Request format is invalid: ."

Please Help!

Thanks,
Ramya Ashok

Jul 19 '06 #1
2 10685
Ramya, this is a c# newsgroup you are posting to. I understand your
Webservice is .NET, but you're asking for classic VB help.

1) you could get the SOAP Toolkit which provides classic VB Support.

2) take a look at this sample code from an ASP page:

<%@ Page aspcompat=true Debug="true"%>
<%
Dim objXMLHTTP, xml, flightnumber, url
' Create an Server xmlhttp object:
xml = Server.CreateOb ject("MSXML2.Se rverXMLHTTP")
url = cstr("http://www.imdb.com/Find")
xml.Open ("POST", url , False)
xml.Send ("select=All&fo r=My Big Fat Greek Wedding")
Response.Write ("<h1>This generated results from IMDB using ServerXMLHTTP
</h1>")
Response.Write (xml.responseTe xt)
xml = Nothing
%>

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ramya A" wrote:
Hi All:

I have a .NET webservice accepting an XML request document as a
parameter
How do I call this webservice with ServerXMLHTTP object from my VB6.0
client?

I have enabled the HttpPost and HttpGet protocols in the web.config
file.

This is the calling part:

Set xmlHTTPRequest = New MSXML2.ServerXM LHTTP40
xmlHTTPRequest. open "POST",
"http://localhost/WebService2/QueueList.asmx/QueueList", True
sParam = "strXMLRequest: =" & xmlDom.xml
xmlHTTPRequest. send (sParam)
It keeps throwing the error "Request format is invalid: ."

Please Help!

Thanks,
Ramya Ashok

Jul 19 '06 #2
Hi Peter,

Thanks for your reply. The following code worked from the client.
Set xmlHTTPRequest = New MSXML2.XMLHTTP4 0
With xmlHTTPRequest
.open "GET",
"http://localhost/WebService2/QueueList.asmx/QueueList?strXM LRequest="
& xmlDom.xml, False
.setRequestHead er "Content-type", "text/xml"
.setRequestHead er "HTTPGET", "HTTP://localhost/QueueList/QueueList"
.send
End With
If xmlHTTPRequest. readyState = 4 Then
Text1.Text = xmlHTTPRequest. responseText & vbCrLf
End If
While writing web services, since it makes no difference whether you do
it in C# or VB.NET, I posted this in C# discussion group.

Ramya
Peter wrote:
Ramya, this is a c# newsgroup you are posting to. I understand your
Webservice is .NET, but you're asking for classic VB help.

1) you could get the SOAP Toolkit which provides classic VB Support.

2) take a look at this sample code from an ASP page:

<%@ Page aspcompat=true Debug="true"%>
<%
Dim objXMLHTTP, xml, flightnumber, url
' Create an Server xmlhttp object:
xml = Server.CreateOb ject("MSXML2.Se rverXMLHTTP")
url = cstr("http://www.imdb.com/Find")
xml.Open ("POST", url , False)
xml.Send ("select=All&fo r=My Big Fat Greek Wedding")
Response.Write ("<h1>This generated results from IMDB using ServerXMLHTTP
</h1>")
Response.Write (xml.responseTe xt)
xml = Nothing
%>

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ramya A" wrote:
Hi All:

I have a .NET webservice accepting an XML request document as a
parameter
How do I call this webservice with ServerXMLHTTP object from my VB6.0
client?

I have enabled the HttpPost and HttpGet protocols in the web.config
file.

This is the calling part:

Set xmlHTTPRequest = New MSXML2.ServerXM LHTTP40
xmlHTTPRequest. open "POST",
"http://localhost/WebService2/QueueList.asmx/QueueList", True
sParam = "strXMLRequest: =" & xmlDom.xml
xmlHTTPRequest. send (sParam)
It keeps throwing the error "Request format is invalid: ."

Please Help!

Thanks,
Ramya Ashok
Jul 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
14766
by: Patrick | last post by:
I am almost certain that I could use HTTP Post/Get to submit XML Web Service call (over SSL as well, if using Version 3 of MSXML2) from an ASP Application? However, would I only be able to call web-service in a an asynchronous mode (with a callback function)? If so, how?
19
9296
by: Adam Short | last post by:
I am trying to write a routine that will connect a .NET server with a classic ASP server. I know the following code doesn't work! The data is being returned as a dataset, however ASP does not recognise datasets and requires a recordset. Can the datatypes be converted? At the Classic ASP end or .NET end? Can SOAP toolkit provide the...
1
3520
by: sujata shanbhag via .NET 247 | last post by:
Hi, I am using MSXML4.0 to call .NET Webservice from VB client. MyWebservice returs XML string. But if I use ResponseBody to readthe response sent by WebService, the '>' is converted to "&gt;"and '<' is converted to "&lt;". Is there a way to get the XMLdata as it is using responseBody, without getting it converted? Thanks in advance. Regards,...
3
5246
by: ryan.mclean | last post by:
Hi everyone! I'm hoping that someone can help me out. I have a webservice written in vb.net. This service uses the SoapHeader to secure the webservice to users that give a username and password. I am trying to call this webservice via classic asp. This works as long as the service is not authenticated. Here is the asp code: ...
7
3075
by: Jorgen Haukland, Norway | last post by:
Hi, I have created a Java webservice which runs in IBM WebSphere appserver. I take the WSDL-file and create a VS.NET WinForm application and calls the service running on my PC and everything works fine. So I deploy the webservice on a remote machine (Linux box) and I get an error when calling the service. BUT: I can retrieve the WSDL and...
2
2741
by: yqlu | last post by:
I hava developed a client in C# that is connected to a 3-party XML Web Services developed in Java based on the AXIS 1.1. Most methods call are successful except for one method named "findObjects" and return a complex type "FieldSearchResult". The error message as following : "Cannot assign object of type System.String to an object of type...
1
2227
by: batista | last post by:
Hi, I'm using webservice.htc to call a non-secure(without https) webservice method from a webpage. Now, if the webpage is not under https then everything works fine. But, when enable ssl in that page the webservice method does'nt work. So how shud i solve this.
0
1104
by: dev | last post by:
I have a website that dynamically instantiates an instance of a class using Reflection from another Assembly. Within that class there is a method that calls a webservice. The webservice is a standard MS Proxy class that inherits from SoapHttpClientProtocol. Currently the DLL that is loaded via webapp resides in the BIN directory of the...
0
7438
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7951
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7466
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6036
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5082
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
751
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.