sending message
hi,
i want to create device application,that client(device) send a data(msg) to the server and invoke the webservice.The server get the data via clientwebservice.Any sample code related to this send me
hi,
i want to create device application,that client(device) send a data(msg) to the server and invoke the webservice.The server get the data via clientwebservice.Any sample code related to this send me
for me and the rest to understand, you wish to invoke a webservice method from client - is this correct?
If so, just add a web reference to the webservice in your project, then simply create an instance of it and invoke the methods you like, once invoked, the webservice will then take care of the processing for you, just as if you were writing and executing a normal C# class file.
is this what you are after? if not - can you explain a bit more in depth?
Why can't you implement/run the webservice from the Client?
If you have a Server/client application, simply send a message via the network stream to your connected server, a simple string for example to tell the server that it should invoke a webservice, then return the value back to the client.
You have to implement your own methods of ways of recieving/understanding data.
here is a VERY SIMPLE and basic example.
//client code this.theNetworkStream.Send(System.Text.Encoding.ASCII.GetBytes("InvokeWebService"); |
this pretty much sends out that string to the server, which the server will listen to on the listening port for incoming data communication
It then will have to get the string from the bytes (System.Text.Encoding.ASCII.GetString(bytesRecieved, 0, theLengthOfData)) and analyze/understand the message and act accordingly.
The same thing happens with the client.
There maybe another way I'm sure. However it would be easier to invoke the webservice from the client (PPC) in your project
Thread moved to .NET Compact Framework subforum