Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

How to invoke activx/DLL that can create HTTPS posting wait reply type of applicaitons

I have need to write an applicaitons that will runs on my 2003 NT servers. that will communicate with another external web site.  that accept https posting a commnad string... (following their format), then it will respond a message (in certain format).

The requirement of my program will

1. run continusously in the OS (no users interfaces).
2. it listen to request from a MSMQ, when there is a request.  it will
    a. format the request into a string.
    b. Open the winsocket with given IP address of remote web site,
       (I hope I use the right terms here)
    c. write the request string/message to that port.
   d.  wait for response from remote web site.
       d-1.  if no response within x seconds (time out),  it will drop the
               socket connect. do something else.
       d-2. get response.  drop the socket connection, return the message to
             requestor to MS-message queue.

    repeat step 2.  until a new request read with "stop".  it will then quiet.

This is very similar to 3 tier applications.  I just wondering

1. What tools, or sample code that you knows that support this type of situations?
2. IS vb6 better or vb.net better to use

I also know this type of things can be done in the ASP, but that require users
presence.   My requiredment does not need User presense.

I am looking for your input and advise.  sample code with example will be very helpful.

regards,

mshox1
0
mshox1
Asked:
mshox1
  • 2
  • 2
1 Solution
 
ronkleinCommented:
Hi there,

If I understand you correctly, the terminology is as follows:
1. Windows service, that runs constantly.
2. The service polls the MSMQ for its messages, and transfers (parses) them into an inner format.
3. After a successful parsing, the service invokes a web request (https protocol), using a timeout wrapping.
4. The response from the web request is parsed into an inner format.
5. The parsed result is sent into the MSMQ.

Implementing all these is very easy using the dot net framework. Therefore, vb.net is by far a better implementation.
Some reasons:
1. Writing a system (Windows) service in VB6 is almost impossible. In vb.net you have a very nice project template for such thing.
2. In the dot net framework (version 2.0), you can easily create a class and parse it from / convert it to XML format (or binary format) using the default, out-of-the-box utilities that come with the framework.
3. There are some classes the deal with networking in the dot net frameworks that simplify the whole process of a web request. Furthermore, you can easily implement a timeout using an asynchronous handles so that the executing code uses a non-blocking thread that simply waits for the response from the web server.

In other words, work with dot net, and save a lot of development time...
0
 
mshox1Author Commented:
thank you very much for your advise.

do you know any sample codes of vb.net in the way you just described.  it seems the exact things I need.   In other words, I am looking ways to get me a quick start and shortest learning curve on this.   I used to use another platform for this sort of things,
the way you describe the .net framework 2.0 seems familer or me.  

thanks
0
 
ronkleinCommented:
Hi again,

FOA, thanks for the feedback. I'm glad that my reply was useful.
As requested, here are a few links and ideas to get you started.
* 101 vb.net code examples, including: Windows service, MSMQ, Web requests (or services), multi-threading. It is THE jump-start:
http://msdn.microsoft.com/vbasic/downloads/code/101samples/

* Creating a Windows service is quite simple. The Visual Studio 2005 provides a template for such project. If you want to learn more:
http://www.developerfusion.co.uk/show/3441/2/

* Connecting to MSMQ - Try the follownig:
http://www.w3coder.com/vbnet/intromsmq.aspx

* A Web request is done using the object "HttpWebRequest", found in System.Net. You can find an example in the "101 examples" or here:
http://www.w3coder.com/ws/HttpWebRequest.aspx

Cheers,

Ron
0
 
mshox1Author Commented:
That is excellent.  I will follow up on this.  thank again.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now