-
Dec 9th, 2017, 11:33 PM
#1
Thread Starter
Fanatic Member
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!
-
Dec 10th, 2017, 12:09 AM
#2
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.
-
Dec 10th, 2017, 08:24 AM
#3
Thread Starter
Fanatic Member
Re: Simple Web Service vb.net
Originally Posted by jmcilhinney
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.
-
Dec 12th, 2017, 06:31 PM
#4
Thread Starter
Fanatic Member
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).
-
Dec 12th, 2017, 06:40 PM
#5
Re: Simple Web Service vb.net
Originally Posted by mateo107
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:
Originally Posted by mateo107
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?
-
Dec 13th, 2017, 09:08 PM
#6
Thread Starter
Fanatic Member
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
-
Dec 13th, 2017, 09:48 PM
#7
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.
-
Dec 13th, 2017, 09:52 PM
#8
Thread Starter
Fanatic Member
Re: Simple Web Service vb.net
Originally Posted by jmcilhinney
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
-
Dec 13th, 2017, 10:12 PM
#9
Re: Simple Web Service vb.net
Originally Posted by mateo107
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.
-
Dec 14th, 2017, 08:33 AM
#10
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|