Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Asynchronous web service: .NET server, VB 6 client

22 views
Skip to first unread message

Eric Nichols

unread,
Sep 25, 2001, 6:40:41 PM9/25/01
to
Hi all,
I have been tasked to find out how to use SOAP (I'm
using the SOAP toolkit 2.0) to asynchronously consume
a .NET web service from a VB 6 client. I saw a previous
post stating that the SOAP toolkit 2.0 does not support
asynchronous communication directly. However, I'd like
some more advice on how to do it myself. I have seen the
Microsoft article
(http://msdn.microsoft.com/msdnmag/issues/01/02/Webcomp/Web
comp.asp) discussing how to build/consume web services
asynchronously using VB.NET. However, I don't know how to
do it with my VB 6 client.

I've seen other code using HTTP transfer that made use of
the ReadyState property of the XMLHTTP30 object... could I
use this somethow?

Any advice would be greatly appreciated... Has anyone else
done this yet? It would be easy with a .NET client, of
course, but I need to be supporting VB 6 clients for quite
some time to come.

Cheers,
Eric Nichols

___________________________________
Eric Nichols
Software Developer
IntelliChem, Inc.
20310 Empire Avenue, Suite A-102
Bend, Oregon 97701 USA
Phone: (541) 382-7043
Eric.N...@IntelliChem.com (email)
http://www.IntelliChem.com (web)


Finlay Edridge

unread,
Sep 25, 2001, 7:11:12 PM9/25/01
to
If you want to use an "off-the-shelf" asynchronous transport library for
SOAP Toolkit 2, this might be useful: http://www.sqldata.com/transport.htm

Finlay

"Eric Nichols" <eric.n...@intellichem.com> wrote in message
news:103801c14613$1ae20eb0$96e62ecf@tkmsftngxs03...

Eric Nichols

unread,
Sep 26, 2001, 5:54:09 PM9/26/01
to
Thanks for the pointer, but I need to do this all by hand
or using freely available utilities like the SOAP toolkit.

Here's an update on my question: I assume I can do what I
need by constructing the SOAP XML messages myself and
using an XMLHTTP30 object to send and receive the SOAP
messages. In this way I could use the asynchronous
capabilities of the XMLHTTP30 object. Am I correct if I
say that the SoapReader, SoapConnector, and SoapSerializer
do the same thing that an XMLHTTP30 object with a little
bit of XML DOM parsing can do? It seems like if I end up
using low-level SOAP methods, it is not much different
from dealing with the XML myself. Any comments on that?
I'm guessing that the WSDL capabilities of the SOAP
toolkit are the main functionality it provides, and then
the high-level API calls are also convenient as long as
they provide all the needed functionality for a particular
application.

So, if anyone thinks I'm on the wrong track by using
XMLHTTP30 instead of the SOAP toolkit, please let me
know. I'd like to use the SOAP toolkit somehow if I can
use it asynchronously.

Thanks in advance for any advice,
Eric Nichols

>.
>

Eric Nichols

unread,
Sep 26, 2001, 7:42:04 PM9/26/01
to
Hi everyone,
Finlay, thanks for the tip -- it cleared some things up
for me to look at the link you posted.

Maybe this is what I was missing: I think I can make my
own Connector class instead of using the SoapConnector
object.. I will provide the input and output streams and
deal with the HTTP message sending and receiving myself.
But I can still use SoapReader and SoapSerializer to
read/build SOAP messages. Does that sounds like the best
way to go?

Any other advice before I get going in the wrong direction?

Cheers,
Eric Nichols

Finlay Edridge

unread,
Sep 26, 2001, 8:02:58 PM9/26/01
to
If you implement your own SOAP Connector in VB6, I'd be very interested to
see it. Regards, Finlay.

"Eric Nichols" <eric.n...@intellichem.com> wrote in message

news:378c01c146e4$d8e37e40$35ef2ecf@TKMSFTNGXA11...

Roger Wolter

unread,
Sep 27, 2001, 10:58:24 AM9/27/01
to
I'd be interested in understanding what you mean by asynchronous. Do you
mean the client returns right away from a call and then sometime later polls
the server for a response? If so, the can be implemented with two
synchronous calls right? Do you mean one-way messaging where you send a
message and never expect a response?

--
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved


"Eric Nichols" <eric.n...@intellichem.com> wrote in message

news:378c01c146e4$d8e37e40$35ef2ecf@TKMSFTNGXA11...

Eric Nichols

unread,
Sep 27, 2001, 1:12:44 PM9/27/01
to
Yes, I should clarify my intent here. Basically, I want
to return right away when I call the web service; I don't
want to wait around for the response. Then I'd like to be
able to poll the service periodically until I know that
the response is available. Once I determine the response
is there, then I want to read the response.

I think I'd still run into a problem if I did two
synchronous calls to the web service, becuase I don't even
want to wait around for the results from any of those
calls if I'm not guaranteed that a response will be
ready. But I may be wrong.. I'm pretty new to this!

I envision something like the following.. any comments?

Thanks again to everyone for their help sorting this out! -
- Eric

dim Connector as MyHTTPConnector
dim Serializer as SoapSerializer
dim Reader as SoapReader

' Connect to the web service
Set Connector = New MyHTTPSoapConnector
Connector.Property("EndPointURL") = END_POINT_URL
Connector.Connect
'...
Connector.BeginMessage

Set Serializer = New SoapSerializer
Serializer.Init Connector.InputStream
'...
' Construct the SOAP message
' Send the message
Connector.EndMessage

...
' Start a timer, and poll periodically for the response:
' When timer goes off:
If Connector.XMLHTTP30ObjectInstance.ReadyState = 4 Then
' We now have a response, so retrieve the response
Set Reader = New SoapReader
Reader.Load Connector.OutputStream
' Process with the Reader...
'...
End If


Then, in the MyHTTPSoapConnector class, the actual call to
the web service would be something like:

' Note that the third argument of Open lets me specify
' async: True or False
XMLHTTP30Object.Open "POST", strURL, True
'...
XMLHTTP30Object.send docSoapRequest

Roger Wolter

unread,
Sep 27, 2001, 6:59:15 PM9/27/01
to
If you're willing to manage the lifetime of the server object yourself, you
can do that now. Have the first call start the process and return some kind
of identifier to the server process (an index into an array of threadid's or
something like that) When you make your next call you pass in the identifier
and the server either returns some kind of error saying it's not done or
returns the results.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved
"Eric Nichols" <eric.n...@intellichem.com> wrote in message

news:3a3e01c14777$9fb40520$35ef2ecf@TKMSFTNGXA11...

Eric Nichols

unread,
Sep 28, 2001, 12:59:33 PM9/28/01
to
Roger, thanks for the advice. It looks like your method
would work fine to me... however, my team still wants to
try to get at the asynchronous functionality of the
XMLHTTP object... so I'm going to keep trying to get a
custom SoapConnector object written.. if I can't get it
working, though, I think we may indeed use your suggestion.
Alternatively, we may decide to create and send the SOAP
message by hand instead of using the SoapSerializer... but
I'd really like to keep using it. Also, I'm going to try
to use the SoapReader in any case.

Thanks again!

Roger Wolter

unread,
Sep 28, 2001, 1:47:35 PM9/28/01
to
Best of luck. XMLHTTP does its Asynch by spinning up another thread and
waiting for the response on that thread while you main thread continues so
it's easier to deal with because it's really doing synchronous calls on the
wire. I suppose you could do the same thing with Soap Client if you can't
get you connector working.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved
"Eric Nichols" <eric.n...@intellichem.com> wrote in message

news:3e5a01c1483e$f28a80e0$35ef2ecf@TKMSFTNGXA11...

Eric Nichols

unread,
Sep 28, 2001, 5:59:18 PM9/28/01
to
Thanks once again -- I'm going to write a prototype that
spins off another thread right now -- that seems like a
good way to do this, especially since I can then use
SoapClient ad, I assume, not have to use the low-level
SOAP TK API stuff anymore.

I'm also still working on implementing my own
SoapConnector class, but I'm stuck trying to figure out
how to use IStream in VB, and I can't tell why SOAP has
its own IStream that is different from the one in
objidl.idl. I can create a Stream using
CreateStreamOnHGlobal, but calling any of its methods
gives me errors about unsupported methods... I think this
is due to the difference between the real IStream and the
SOAP IStream. Hmmmm. Does anyone know where to find any
more information on IStream and SOAP IStream? I haven't
found what I need in the MSDN docs yet.

Thanks,
Eric

0 new messages