PC Review


Reply
Thread Tools Rate Thread

Calling webservice with parameters using ServerXMLHTTP object

 
 
Ramya A
Guest
Posts: n/a
 
      19th Jul 2006
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      19th Jul 2006
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
>
>

 
Reply With Quote
 
Ramya A
Guest
Posts: n/a
 
      20th Jul 2006
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
> >
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
trouble getting ref object parameters while calling COM object with C# rocketfire97@gmail.com Microsoft C# .NET 2 29th Oct 2007 06:21 PM
Calling Async object within a webservice method Paul Hadfield Microsoft Dot NET Framework 0 17th Sep 2007 01:00 PM
Calling Async object within a webservice method Paul Hadfield Microsoft ASP .NET 0 17th Sep 2007 01:00 PM
Problem! webservice.htc calling nonsecure webservice from a secured ssl https webpage batista Microsoft ASP .NET 0 26th Jan 2006 08:13 AM
Calling WebService using ServerXMLHTTP sujata shanbhag via .NET 247 Microsoft C# .NET 1 24th Apr 2004 10:37 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:43 PM.