N
Nab
I have a web service connected to a sql server 2005 express. The service has
a web method and information is extracted from the database through a stored
procedure that has two parameter:input and output. So for example some one
could supply a stock brokers name and in turn one gets the stock broker's
charging commission. Here's the code for that (connection established through
the gui):
<WebMethod()> _
Public Sub GetFee(ByVal brokerName As String, ByRef brokerFee As Single)
Dim cmd As New SqlCommand("GetDealingFee", sqlConn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@BName", SqlDbType.VarChar, 50)
cmd.Parameters("@BName").Direction = ParameterDirection.Input
cmd.Parameters("@BName").Value = brokerName
cmd.Parameters.Add("@Fee", SqlDbType.Real)
cmd.Parameters("@Fee").Direction = ParameterDirection.Output
If cmd.Connection.State <> ConnectionState.Open Then
cmd.Connection.Open()
End If
cmd.ExecuteNonQuery()
brokerFee = cmd.Parameters("@Fee").Value
cmd.Connection.Close()
When I consume the service by a pocket pc (through activesync) i get a
system.net.webexception erro and this is stack trace:
at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke()
at DeviceApplication_Stockbrokers.localhost.Service.GetFee()
at DeviceApplication_Stockbrokers.Form1.Button1_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at DeviceApplication_Stockbrokers.Form1.Main()
At this stage my knowledge is limited and any help of what's happening and
how to fix this error will be appreciated.
I use win2003 server and Visual Studio 2005 Prof (using VB) and published
the web service to a local IIS.
Thanks.
a web method and information is extracted from the database through a stored
procedure that has two parameter:input and output. So for example some one
could supply a stock brokers name and in turn one gets the stock broker's
charging commission. Here's the code for that (connection established through
the gui):
<WebMethod()> _
Public Sub GetFee(ByVal brokerName As String, ByRef brokerFee As Single)
Dim cmd As New SqlCommand("GetDealingFee", sqlConn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@BName", SqlDbType.VarChar, 50)
cmd.Parameters("@BName").Direction = ParameterDirection.Input
cmd.Parameters("@BName").Value = brokerName
cmd.Parameters.Add("@Fee", SqlDbType.Real)
cmd.Parameters("@Fee").Direction = ParameterDirection.Output
If cmd.Connection.State <> ConnectionState.Open Then
cmd.Connection.Open()
End If
cmd.ExecuteNonQuery()
brokerFee = cmd.Parameters("@Fee").Value
cmd.Connection.Close()
When I consume the service by a pocket pc (through activesync) i get a
system.net.webexception erro and this is stack trace:
at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke()
at DeviceApplication_Stockbrokers.localhost.Service.GetFee()
at DeviceApplication_Stockbrokers.Form1.Button1_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at DeviceApplication_Stockbrokers.Form1.Main()
At this stage my knowledge is limited and any help of what's happening and
how to fix this error will be appreciated.
I use win2003 server and Visual Studio 2005 Prof (using VB) and published
the web service to a local IIS.
Thanks.