Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Creating a Web Service out of a VB6 project?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pbd22 - 10 Dec 2007 19:29 GMT
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.
bruce barker - 10 Dec 2007 21:40 GMT
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)

> Hi.
>
[quoted text clipped - 25 lines]
>
> Thanks.
John Timney (MVP) - 10 Dec 2007 22:34 GMT
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

> you have a couple issues to solve.
>
[quoted text clipped - 52 lines]
>>
>> Thanks.
pbd22 - 12 Dec 2007 14:59 GMT
On Dec 10, 5:34 pm, "John Timney \(MVP\)"
<xyz_j...@timney.eclipse.co.uk> wrote:
> 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
[quoted text clipped - 66 lines]
>
> >> Thanks.

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

Thanks again.
John Timney (MVP) - 12 Dec 2007 15:16 GMT
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

> On Dec 10, 5:34 pm, "John Timney \(MVP\)"
> <xyz_j...@timney.eclipse.co.uk> wrote:
[quoted text clipped - 78 lines]
>
> Thanks again.
pbd22 - 12 Dec 2007 16:01 GMT
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
John Timney (MVP) - 12 Dec 2007 16:26 GMT
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&que
ry=vb6tovbdotnet.asp


Regards

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

> Hey John,
>
[quoted text clipped - 14 lines]
> Thanks again.
> Peter

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.