dcsimg
Results 1 to 10 of 10
  1. #1

    Thread Starter
    Fanatic Member mateo107's Avatar
    Join Date
    Jan 2005
    Posts
    519

    Simple Web Service vb.net

    I'd like to create a simple web service application (so that I don't have to stand up IIS server) for an internal-only application. The *ONLY* goal for this webservice is to provide a textbox on a webpage (hosted by the service) and anytime someone submits that textbox, the *host* takes that data and copies it into the active application's text entry field.

    So basically... user would open up the URL/FORM (likely the internal DNS/IP of the webservice host).
    The host is just listening for responses now.
    The user types in (or scans in) the data and hits the "send" button.
    On the host PC, there is another application open and it's listening for anytime someone hits "submit".
    It then takes that string and copies and pastes it into the open application (such as notepad, etc.).
    And in theory, the webform would clear/reset after each "submit" button is pressed.

    I think this should be super simple. Can anyone help me with a framework for this? I write in VB.NET and I'd prefer not to write a host and client application and also not sure how to have it automatically paste whenever someone submits the data. The data does *not* need to be stored. If someone loses a scan , they can just scan again.

    (The reason I need this, is that we have some Ancient Windows CE 4.2 devices that can connect to our WiFi, but their barcode/datacapture application is ActiveSync. Ideally, I'd like to turn them into true "mobile" scanners, so we don't have to sync data and we can simply use them as *if* they were attached to the PC like a standard wedge/barcode scanner.

    Thanks!


    -Matthew-

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    99,148

    Re: Simple Web Service vb.net

    Do you actually mean a web server rather than a web service? If you do mean a web service then you need a web server to run it on, so it doesn't get you around using IIS.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member mateo107's Avatar
    Join Date
    Jan 2005
    Posts
    519

    Re: Simple Web Service vb.net

    Quote Originally Posted by jmcilhinney View Post
    Do you actually mean a web server rather than a web service? If you do mean a web service then you need a web server to run it on, so it doesn't get you around using IIS.
    Maybe I used the wrong terminology.

    I guess it doesnít have to be a web server per say. But at least listen on a specific port. I guess thatís why I listed the real world example of what itíll do. So that this awesome group of folks can chime in and let me know what I need for all the moving parts and pieces.


    -Matthew-

  4. #4

    Thread Starter
    Fanatic Member mateo107's Avatar
    Join Date
    Jan 2005
    Posts
    519

    Re: Simple Web Service vb.net

    So, I think in reality I can create a server/client application. I would just like the server application to startup and then run in the "background". Here is the basis that I'm going to use for my server/client application:
    http://vb.net-informations.com/commu...rogramming.htm

    Can someone help me modify the server-side program so that whenever data is received it is pasted into the current window. (i.e., I'm going to be using this like a simple barcode reader, but instead of connected over USB, I'm trying to make this work over IP, from a Symbol Windows CE device).


    -Matthew-

  5. #5
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    99,148

    Re: Simple Web Service vb.net

    Quote Originally Posted by mateo107 View Post
    Can someone help me modify the server-side program so that whenever data is received it is pasted into the current window.
    I'm not really sure what that means, given that you previously said this:
    Quote Originally Posted by mateo107 View Post
    I would just like the server application to startup and then run in the "background".
    Pasting into the current window implies using the Clipboard to get text into whatever application you happen to be currently working in, which doesn't seem like a good idea. If you mean a TextBox or the like in your own app then that's not pasting and it's not in the background. Hence the confusion. Can you provide a clearer explanation?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    Fanatic Member mateo107's Avatar
    Join Date
    Jan 2005
    Posts
    519

    Re: Simple Web Service vb.net

    Here's the story. I have some older 2D barcode scanners, that run Windows CE 4.2, so a VERY limited IE and really no 3rd party or upgrades available.

    It has software already on it that takes the code and plops it into whatever app I have open on the device. What I want to do, is get this data over to a PC running my personal client software. So, my software will be running and up in the field I need it to be in and then I'll "scan" on the WinCE device and get that data to the PC and into the textbox in the foreground.

    So, I thought the easiest way might be to have my scanner use a simple WinCE app, or, use an HTML/ASP.NET/ASPX page with just a textbox and a "send" button.
    The WinCE app, any time someone clicks send, would connect to my app running on my computer (maybe it's always connected) and the app on the computer would do what's mentioned above, receive the barcode and paste it into the current windows' textbox (or for example, if I had notepad open, it would just continually enter the datastring each time I hit submit from the WinCE device.

    So basically, I need to emulate a locally attached USB scanner, but over IP.

    I have a modern app for my iOS device, Barcode to PC that does similar, but as I said, I'm trying to utilize some older scanners that I have already (Symbol MC9060 devices, WinCE 4.2).

    Thanks


    -Matthew-

  7. #7
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    99,148

    Re: Simple Web Service vb.net

    It doesn't sound like you have any need of anything web-based. If the CE device and the PC are on the same network then you should just be able to use TCP/IP. Check out the System.IO.Sockets namespace. You could use a TcpListener on the PC. Normally I'd suggest using a TcpClient but, while that's certainly possible on the PC, I'm not sure whether it's supported by the Compact Framework. If it's not, you should be able to use a Socket object at that end, which would be a bit more fiddly but still easy enough. Your PC app could be a Windows service, a Console application or, if you wanted more visual feedback and possible input, a WinForms app.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  8. #8

    Thread Starter
    Fanatic Member mateo107's Avatar
    Join Date
    Jan 2005
    Posts
    519

    Re: Simple Web Service vb.net

    Quote Originally Posted by jmcilhinney View Post
    It doesn't sound like you have any need of anything web-based. If the CE device and the PC are on the same network then you should just be able to use TCP/IP. Check out the System.IO.Sockets namespace. You could use a TcpListener on the PC. Normally I'd suggest using a TcpClient but, while that's certainly possible on the PC, I'm not sure whether it's supported by the Compact Framework. If it's not, you should be able to use a Socket object at that end, which would be a bit more fiddly but still easy enough. Your PC app could be a Windows service, a Console application or, if you wanted more visual feedback and possible input, a WinForms app.
    Thanks!

    I figured I would start with the code I posted the link to previously...
    http://vb.net-informations.com/commu...rogramming.htm

    What I did need assistance with, though, was on my PC / "Server" side, how would I take the input and get it to copy into the active window?

    Thanks again.

    -Matt


    -Matthew-

  9. #9
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    99,148

    Re: Simple Web Service vb.net

    Quote Originally Posted by mateo107 View Post
    What I did need assistance with, though, was on my PC / "Server" side, how would I take the input and get it to copy into the active window?
    That has nothing to do with the title of the thread.

    You'd basically need to use appropriate API functions to get the handle of the window you wanted to target and then set its text. There's no function that I'm aware of, managed or otherwise, that would automatically paste the Clipboard contents into the active window.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  10. #10
    Fanatic Member
    Join Date
    Dec 2014
    Location
    VB6 dinosaur land
    Posts
    850

    Re: Simple Web Service vb.net

    Maybe not a very elegant solution but since this appears to be just so you can use some old hardware for something, another possibility is your CE scanner can just write out the scans to a file or database on the the network and your PC program can poll that. A long time ago I had CE 4.2 devices on forktrucks that communicated with Oracle to get orders and update status.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width