Windows Application + Web Services

S

Sylvie

My Windows Application has two forms, one form contains a grid (lets say
Stock Listing), and the other is a form of one stock, contains some edit
boxes for one stock's fields..

Is it possible to run application remotely and retrieve grid and form data
in some way without accessing directly to database server?

Web Services is being used for this purpose I think,

Which methods must be used for this ?

Thank you
 
M

Mr. Arnold

Sylvie said:
My Windows Application has two forms, one form contains a grid (lets say
Stock Listing), and the other is a form of one stock, contains some edit
boxes for one stock's fields..

Is it possible to run application remotely and retrieve grid and form data
in some way without accessing directly to database server?

Web Services is being used for this purpose I think,

A Web service can be used for this where you access a method or methods on
the Web service to send/receive data with an application, like a Windows
form, Web form, Console, or Windows Service application. Each type of
application would consume the Web service with the Web service doing the
back-end database processing.
 
S

Sylvie

Which way is the best one according to the performance issues ?

To go directly into sql server (accessible server from web, using stored
procedures, etc..)

To use web services (returns datasets for my app, and accepts methods from
my app, insert, update, delete records, etc... )

In summary, May I perform all the things by using web services ?

I ll start a project and once I start, I couldnt turn back :)
 
M

Mr. Arnold

Sylvie said:
Which way is the best one according to the performance issues ?

To go directly into sql server (accessible server from web, using stored
procedures, etc..)

Yes, you can use the Web server and a Web service in that manner. You should
use Stored Procedures not that things are going to be any faster but because
of security concerns with T-SQL injection attacks when using T-SQL in line
code in a program, one that's facing the Internet.

You should also use SOAP Authentication on your Web Service, where as, every
time an Web client application consumes your Web service, the Web client
application must give the Authentication credentials of a user-id and psw
to logon to the Web service and use it. You should be able to use Google to
get an example of how to make a .Net Web service that uses SOAP
Authentication. It's really easy to do this.
To use web services (returns datasets for my app, and accepts methods from
my app, insert, update, delete records, etc... )

Yes, you can pass Command parms, like Add, Update, Delete, give it a
dataset or an object with data and pass it to the C#.cs in its constructor
that the Web Method encompasses, from your Web service client application,
and you can pass back data like a dataset to the Web service client from the
Web service Method and its class with the Return statement. You can do just
about anything with the class, just like you can do it if it was not a class
in a Web Method.
In summary, May I perform all the things by using web services ?

Yes you can do it. But remember this. A Web Service is a XML Web service,
and if passing a dataset, you can serialize the dataset to XML, pass it, and
deserialize XML back to a dataset.
I ll start a project and once I start, I couldnt turn back :)

You should look at the WSDL command using a URL pointing to your Web service
to understand that.
You should look at the WSDL.exe that you use at the .Net Command Prompt to
point to a Web Service URL and it creates the C#.cs for the Web Service so
you can consume the Web service in your Web service client code easily.

I think you first need to build a Web service application to understand what
is happening.

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q301273&ID=KB...

You should be able to find examples on Google on everything that has been
talked about. I had to do it when I recently wrote first Web service
client application to consume a 3rd party Web service, and in return, I had
to write a Web Service application to receive data back from the 3rd party
vendor that the 3rd party vendor had a Web service client application to
consume my Web service application.


If you're not using SSL/HTTPS the you might want to look at SOAP encryption.
and make sure you send back an XML response back to the Web service client
so that the client can check the status. You will have to understand XML and
the use of a Memory Stream with the XML, but again you use Google.

<Statuslist>
<Status>
<Code>OK</Code>
<Message>OK</Message>
</Status>
</Statuslist>

Over the last 3 to 4 weeks, I have learned more about Web services, Web
client, XML, and Memory Streams than I ever wanted to know, believe me.

Use it to write the Statuslist response back to the client, use the
XMLTextWriter using a Memory Stream not a File Stream, which you have to
parse the Memory Stream to return the XML tags and data out Stream tostring
and send the Response back. Look for an exmple on google that using the
MemoryStream.Peek().


http://support.softartisans.com/kbview_675.aspx

It's VB but you can do the same in C# to parse the Response.

http://developer.yahoo.com/dotnet/howto-xml_vb.html

You got any more questions about Web services, then you can post to
MS.Public.dotnet.framework,webservices

Good luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top