Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System.Data.SqlClient.SqlException: Procedure or function 'wp_session_spLogout' expects parameter

Status
Not open for further replies.

yaknowss

Programmer
Apr 19, 2012
69
US
This web error keeps appearing in our logs:

Code:
Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.

All of it: 
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Procedure or function 'wp_session_spLogout' expects parameter '@SessionKey', which was not supplied.
   at WebAPI.webServiceSession.Logout()
   at WebAPI.Logout(String sSessionKey)
   --- End of inner exception stack trace ---
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at shop.center.org.com.Tessy.Logout(String sSessionKey) in C:\Documents and Settings\matthewc\Desktop\build_shop.9.4\shop.strazcenter.org\Web References\com.Tessy\Reference.cs:line 9197
   at shop.org.TimeOut2.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\matthewc\Desktop\build_shop.9.4\shop.org\TimeOut2.aspx.cs:line 30
   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.timeout2_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\8bd60312\76744bff\App_Web_n2uoxzv4.0.cs:line 0
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Source: System.Web

TargetSite: Boolean HandleError(System.Exception)

Request:
   FilePath: /Timeout2.aspx
   HttpMethod: GET
   IsSecureConnection: True
   Url: [URL unfurl="true"]https://shop.org/Timeout2.aspx[/URL]
   UrlReferrer: [URL unfurl="true"]https://shop.org/Login.aspx?Type=Session_Timeout[/URL]
   UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
   UserHostAddress: 168.213.7.230
   UserHostName: 168.213.7.230

I am trying to include the parameter @sessionkey into my code. Any suggestions.

Here is my Timeout2.aspx.cs code:
Code:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using GenericClasses;
using shop.org.GenericClasses;

namespace shop.org
{
    public partial class TimeOut2 : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Activity a = new Activity();
            
            com.Tessy.Tessitura oAPI;
            
            oAPI = new com.Tessy.Tessitura();
            
            var Key = (new SessionWrapper()).SessionKey;
            
            oAPI.Logout(Key);
            
            oAPI.Dispose();
            Session.Abandon();
            Session.Contents.RemoveAll();
            a.makeSession();
            Response.Redirect("~/Login.aspx?Type=Session_Timeout");
           
        }
    }
}

Here is my stored procedure 'wp_session_spLogout':

Code:
USE [Impresario]
GO
/****** Object:  StoredProcedure [dbo].[wp_session_spLogout]    Script Date: 01/14/2013 12:50:54 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER   PROCEDURE [dbo].[wp_session_spLogout]
	@SessionKey	VARCHAR(64)
AS

update t_web_session_session
set 
	customer_no = null ,
	MOS = null ,
	OriginalMOS = null,
--	bu = null ,			-- commented CWR 11/14/2005
	promotion_code = null ,
	batch_no = null
where sessionKey = @SessionKey

--delete from [dbo].t_web_session_variable
--where sessionkey = @SessionKey

-- this replaces above CWR 9/5/2007 so that organization setting stays.  (This may be a temporary fix only)
delete	[dbo].t_web_session_variable
where	sessionkey = @SessionKey
	and name not in ('Organization Name', 'UID')
 
You have to debug. Apparently, the key ( var Key = (new SessionWrapper()).SessionKey;) is null or and empty string.
 
Thank you. Please bare with me as I am fairly new to debugging. Where should I place the break points?
 
Gotcha. Okay. Question. This is a timeout page that appears once the timer runs out after 15 minutes of inactivity. I'm assuming I'll have to wait the full 15 minutes during my debug session to find the value of Key?
 
is this a 3rd party object you are using?: oAPI = new com.Tessy.Tessitura()

YOu will have to check with them what the error is..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top