473,385 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.ServerXMLHTTP40
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 10669
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.CreateObject("MSXML2.ServerXMLHTTP")
url = cstr("http://www.imdb.com/Find")
xml.Open ("POST", url , False)
xml.Send ("select=All&for=My Big Fat Greek Wedding")
Response.Write ("<h1>This generated results from IMDB using ServerXMLHTTP
</h1>")
Response.Write (xml.responseText)
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.ServerXMLHTTP40
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.XMLHTTP40
With xmlHTTPRequest
.open "GET",
"http://localhost/WebService2/QueueList.asmx/QueueList?strXMLRequest="
& xmlDom.xml, False
.setRequestHeader "Content-type", "text/xml"
.setRequestHeader "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.CreateObject("MSXML2.ServerXMLHTTP")
url = cstr("http://www.imdb.com/Find")
xml.Open ("POST", url , False)
xml.Send ("select=All&for=My Big Fat Greek Wedding")
Response.Write ("<h1>This generated results from IMDB using ServerXMLHTTP
</h1>")
Response.Write (xml.responseText)
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.ServerXMLHTTP40
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
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...
19
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...
1
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 '<'...
3
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....
7
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...
2
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"...
1
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...

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.