Web Services and SQL Server

  • Thread starter Thread starter crose01
  • Start date Start date
C

crose01

I've written a very basic web service that is used by my PocketPC to add two
numbers together.
It works fine. So next I'm writing a WebService which accesses my SQL Server
and returns
rows appertaining to a specific OrderId.

I have written a stored procedure called spGetConfirmedOrder to which I pass
the OrderId and it
works okay until I need to reference it in my code then it doesn't recognise
it. Is there something
that I'm missing out here do I need to get involde with SOAP and WDSL files?

Regards

Chris
 
Hi Crose

A webservice works as a service

So in with your program you do something as roughly typed
\\\
dim ws as new myserver.myservice
dim Result = ws.AddInwebservice(1, 2)
///
And in your webservice is a function
\\\
<WebMethod()>
Public Function AddInwebservice(byval a as integer, byval b as integer) as
integer
'get information a from database
'get information b from database
return a+b
End Function
///
And of course set a reference to that WebReference using the solution
explorer

That is basicly all

I hope this helps?

Cor
 
Cor

Thanks for your reply that's basically what I did with great success in my
first web service. My problem lies with writing a service that drags data
from a SQL Server and calling a stored procedure to get the data. On the Web
examples are in short supply and any query usually brings up lots of
references to XML and SOAP which I'm hoping I'm not going to have to dig
into.



Regards



Chris
 
Hi Crose,

I am curious, why do you want that, what benefit do you expect (beside that
I do not know how) to let your SQL Server function as a webservice server?
(That is what I think you want to do).

For me the stored procedure is basicly nothing more than a method to let the
Server acts quicker.
I do as well not know this, however I think that letting the SQL server act
direct on the Internet will not have benefits for the security.

Cor
 
Cor

In a multi tiered application the use of web services is a very secure m
ethod of
transmitting data. My user application runs on a PocketPC2003 and will need
to access sales data via the web maybe even via GPRS (so I need to keep the
overhead low). I could write the code that the stored procedure uses into
the web service but that would be compiled every time it is called or run
which is a server overhead. So the best way is to call a stored procedure in
SQL Server which has the benefits that I can use the SQL Server Security as
well.

Regards

Chris
 
Hi Crose,

Are you not talking about just calling a SQL server over the TCP Internet,
for that I would ask it in the adonet group, probably Bill (William B. Ryan)
knows how to handle this because he does this kind of solutions.?

microsoft.public.dotnet.language

I put his name here above because he is here also active

Cor
 
Back
Top