Creating a Web Service out of a VB6 project?

P

pbd22

Hi.

I just got a project that is taking me into previously uncharted
territory.

I have a reasonably large VB6 project and need to "turn it into a web
service".
I know this isn't immediately possible. The two main options seem to
be:

1) convert the code to .NET and then create a web service.

I have heard that moving from VB6 to .NET for any significant project
is a major pain.

2) wrap the project in COM Interop which will act as a middleman
between a .NET project and the original VB6 project.

I am guessing #2 is the path of least resistance? I would really love
it if somebody
here could tell me if a) I am right that number 2 is a better way to
go and b) what is the best
way to go about implementing option 2? Has anybody here used a VB6
project and implemented it as a web service that is callable from
a .NET project?

Please help... new territory for me.

Thanks.
 
B

bruce barker

you have a couple issues to solve.

1) vb6 produces sta com objects which asp.net web services don't support out
of the box. see this article:

http://msdn.microsoft.com/msdnmag/issues/06/10/WickedCode/

2) global memory. vb6 stores global variables (module data) as thread local
storage, so it very difficult to do any cache management. as web services use
mutilple threads.

3) session management. web services are stateless, you may need to
reengineer your app to support this. this will also cause you to write
serialization routines for your objects if you don't already have them.

4) scaling, as your webservice will use sta objects, requests will be queued.

if issue 3 exists for you, I'd reengineer and recode in .net, as it woudl be
faster.

-- bruce (sqlwork.com)
 
J

John Timney \(MVP\)

To add to what Bruce has suggested - web service methods are not the same as
functions in VB6, and you cannot easily transpose a VB6 project to a
solution based on HTTP protocols.

A web service can be a collection of webservice methods, but the more you
call from within each emthod (in effect chaining methods) the more
performance and threading issues you will probably hit.

I would bite the bullet and reengineer your solution if I were you.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
 
P

pbd22

To add to what Bruce has suggested - web service methods are not the same as
functions in VB6, and you cannot easily transpose a VB6 project to a
solution based on HTTP protocols.

A web service can be a collection of webservice methods, but the more you
call from within each emthod (in effect chaining methods) the more
performance and threading issues you will probably hit.

I would bite the bullet and reengineer your solution if I were you.

Regards

John Timney (MVP)http://www.johntimney.comhttp://www.johntimney.com/blog

Thanks guys.
Does anybody know of a good resource for guiding me through moving VB6
to VB.NET or C#?

Thanks again.
 
J

John Timney \(MVP\)

If I were you I would start with the asp.net quickstart tutorials. Learn
about some of the controls, page flow etc. and then decide how that relates
to features and functionality in your current app. I would hazard that when
you mention moving your vb6 app to a web service you may actually mean a web
application.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
 
P

pbd22

Hey John,

Thanks. Actually, I "do" mean a web service and
I am a little more advanced (although, I guess it
doesn't seem it) than needing to see how the basic
ASP.NET controls work.

I am actually an ASP.NET/C# developer that has
been given a VB6 project to turn into a web service.
I am convinced that Interop COM objects wrapped
in a web service is not the way to go, but rather
moving to (in our case) C#.

I guess I am looking for a pre-migration guide of
sorts.

Thanks again.
Peter
 
J

John Timney \(MVP\)

I'm not sure what would help you really other than just getting stuck in
then if your quite an experienced asp.net coder. Do you plan to consume the
COM components you have in the webservice, or just plain vanilla re-write
them. The stateless nature of webservices makes it a tricky choice - of
course you can add state but it impacts performance and using COM causes
threading issues - so rewriting is always the best choice.

I would start looking at each of your functions, and determine how easily it
would be to migrate them to webservice methods - at least by creating method
stubs. You need to work out where your current global properties etc. would
reside, session, cache, app object, db etc. and see if the end product
represents the business logic flow around your exisitng vb6 application The
great thing about webservice methods is they are quite easy to test and of
course any VB6 interface can be fairly relicated with an asp.net webform or
two.

Lots of usefull links on moving from vb to vb.net - but not much on web
enabling a VB6 project
http://search.msdn.microsoft.com/search/Default.aspx?brand=msdn&locale=en-us&query=vb6tovbdotnet.asp

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top