N
Nab
Using a Windows client to consume a web service throws this error:
System.Web.Services.Protocols.SoapException: Server was unable to process
request. ---> System.NullReferenceException.....etc
I'm using Visual Studio 2008 and my VB code for the WS (which is connected
to a SQL Server 2005 Express) is:
<WebMethod()> _
Public Sub GetFee(ByVal brokerName As String, ByRef brokerFee As Single)
Dim strSQL As String
strSQL = "SELECT @Fee = dbnlineBrokers.TransactionFee FROM
dbnlineBrokers WHERE dbnlineBrokers.Name = @BName"
Dim cmd As New SqlCommand(strSQL, sqlConn)
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()
Any hint as to how to resolve this issue? Is this a permission issue? If so,
how can I resolve it? Thanks for any suggestions.
System.Web.Services.Protocols.SoapException: Server was unable to process
request. ---> System.NullReferenceException.....etc
I'm using Visual Studio 2008 and my VB code for the WS (which is connected
to a SQL Server 2005 Express) is:
<WebMethod()> _
Public Sub GetFee(ByVal brokerName As String, ByRef brokerFee As Single)
Dim strSQL As String
strSQL = "SELECT @Fee = dbnlineBrokers.TransactionFee FROM
dbnlineBrokers WHERE dbnlineBrokers.Name = @BName"
Dim cmd As New SqlCommand(strSQL, sqlConn)
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()
Any hint as to how to resolve this issue? Is this a permission issue? If so,
how can I resolve it? Thanks for any suggestions.