Visual Basic - Services

Discussion in 'OT Technology' started by Firehawk, Jan 22, 2010.

  1. Firehawk

    Firehawk OT Supporter

    Joined:
    Jul 26, 2005
    Messages:
    1,983
    Likes Received:
    0
    Location:
    Kansas City, MO
    At work, I've been working on a VB application for a tablet PC that utilizes the Camera to take a photo and upload it to our applications server using FTP. It also adds a record to the MySQL database regarding the photo (what it's of, when it was taken, etc.)

    We have a few problems we'd like to solve.

    1) The FTP resource we are using requires a license for secure FTP -- We're worried that a unsecured FTP connection will leave our FTP login creditentials open for any packet sniffers.

    2) Our MySQL database is locked down to a specific IP range. The range the tablet pc will be utilizing is not in the MySQL range and the only way to fix this would be to give the tablet a static IP, something we'd like to avoid.

    Can we create a VB service to pass our image and MySQL statements over to our applications server? The MySQL database is not on the applications server, but the applications server is on the same subnet as the db server.

    Thanks. :bowdown:

    Feel free to give me any tips, I haven't worked with VB services yet.
     
  2. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    I don't understand how your MySQL DB is 'locked down' to a certain IP range. Can you explain?

    Ah, I see - you mean security.

    The answer is yes - you can create a simple RESTful web server to handle authentication and transmit data to/from MySQL. If its simple - PHP makes this very, very easy.

    You could do this in VB, but I don't know why you would? :) Use JSON for a transport format, and getter done.
     
  3. Firehawk

    Firehawk OT Supporter

    Joined:
    Jul 26, 2005
    Messages:
    1,983
    Likes Received:
    0
    Location:
    Kansas City, MO
    We have a applications server which uses PHP/SQL for a web interface for the application. Allows users to change stuff in the DB as well as view images uploaded from the tablet pc, etc. Since the applications server is in the IP range of the DB it can access the MySQL db.

    Since the tablet PC is not, we want to use a VB service to pass that information to the applications server then have the applications server run the SQL statement from the VB service.

    I know php pretty well, but this is a VB desktop application for the tablet PC. We already have PHP upload script on the web interface for people to upload images manually.
     
  4. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    Great - then just have the VB App on the tablet PC transmit JSON to the PHP Web app. Take your actions in the DB, return results in JSON back to the VB App.

    Make sense? Web apps are great at this - for machine interfaces, as well as human interfaces. I've built entire casino systems as web apps. Web services da bomb. Why not? ;)

    Does this make sense? Need more detail?
     
  5. Firehawk

    Firehawk OT Supporter

    Joined:
    Jul 26, 2005
    Messages:
    1,983
    Likes Received:
    0
    Location:
    Kansas City, MO
    So I finally got time to work on this...

    I'm passing some information (variables, sql statments) to the service as a string and then I'm passing back a dataset with information to fill combo boxes.

    One thing I'm having trouble figuring out though --

    I'm passing a image to the web service (byte array) and I need to save it to the C:\Inetpub\www\ of that server. The way I was doing it on the VB App was setting a picture box = to that byte array then doing PictureBox.Save(C:\directory\file.jpg) but I can't do that in a web service. I've tried a few different routes but haven't had any luck.
     
  6. Firehawk

    Firehawk OT Supporter

    Joined:
    Jul 26, 2005
    Messages:
    1,983
    Likes Received:
    0
    Location:
    Kansas City, MO
    bump :/
     

Share This Page