Click here to Skip to main content
15,887,376 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionDetecting changes on a page Pin
dptalt14-Apr-09 4:44
dptalt14-Apr-09 4:44 
AnswerRe: Detecting changes on a page Pin
binarymax14-Apr-09 5:32
binarymax14-Apr-09 5:32 
GeneralRe: Detecting changes on a page Pin
dptalt14-Apr-09 5:44
dptalt14-Apr-09 5:44 
GeneralRe: Detecting changes on a page Pin
binarymax14-Apr-09 6:07
binarymax14-Apr-09 6:07 
GeneralRe: Detecting changes on a page Pin
dptalt14-Apr-09 6:52
dptalt14-Apr-09 6:52 
GeneralRe: Detecting changes on a page Pin
binarymax14-Apr-09 9:20
binarymax14-Apr-09 9:20 
AnswerRe: Detecting changes on a page Pin
Yusuf14-Apr-09 9:24
Yusuf14-Apr-09 9:24 
QuestionVS2008 SOAP Client - losing Session problem [modified] Pin
Vozzie214-Apr-09 4:44
Vozzie214-Apr-09 4:44 
hy,

i made a Web Service project in visual studio 2008.
then added 2 "Web Service" files to the project.

Service1.asmx

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <system.web.script.services.scriptservice()> _
<system.web.services.webservice(namespace:="http://tempuri.org/")> _
<system.web.services.webservicebinding(conformsto:=WsiProfiles.BasicProfile1_1)> _
<toolboxitem(false)> _
Public Class Service1
    Inherits System.Web.Services.WebService

    <webmethod(true)> _
    Public Function HelloWorld() As String
        Session("foo") = "bar"
        Return "Hello World"
    End Function

End Class



Service2.asmx

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <system.web.script.services.scriptservice()> _
<system.web.services.webservice(namespace:="http://tempuri.org/")> _
<system.web.services.webservicebinding(conformsto:=WsiProfiles.BasicProfile1_1)> _
<toolboxitem(false)> _
Public Class Service2
    Inherits System.Web.Services.WebService

    <webmethod(true)> _
    Public Function HelloWorld() As String
        If Session("foo") <> "bar" Then
            Throw New UnauthorizedAccessException
        End If
        Return "Hello World"
    End Function

End Class




After i made a windows application, where i made a "Service Reference" to both web service classes/files.

The problem is that Service1.asmx doesn't share it's session with Service2.asmx,...
I get the thrown "UnauthorizedAccessException" on calling "Service2.HelloWorld()" because the session is not created in Service2.asmx after calling Service2...

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   Dim bhp As New System.ServiceModel.BasicHttpBinding
        bhp.AllowCookies = True

        Dim x As New ServiceReference1.Service1SoapClient(bhp, New ServiceModel.EndpointAddress("http://localhost/ImsBrowserWebService/Service1.asmx"))
        Dim y As New ServiceReference2.Service2SoapClient(bhp, New ServiceModel.EndpointAddress("http://localhost/ImsBrowserWebService/Service2.asmx"))
        MsgBox(x.HelloWorld)
        MsgBox(y.HelloWorld)

      '  Dim x As New localhost.Service1
      '  MsgBox(x.HelloWorld())

      '  Dim y As New localhost1.Service2
      '  MsgBox(y.HelloWorld())
    End Sub
End Class


How to share the session between those files,... In Visual Studio 2003 it works fine when calling the service from javascript,... Now in visual studio 2008 with the soap client wizards it doesn't...

Any help would be welcome,

...

It feels good to learn and achieve

AnswerRe: VS2008 SOAP Client - losing Session problem Pin
anbam15-Nov-10 22:54
anbam15-Nov-10 22:54 
QuestionScroll bars of TreeView should be invisble when they are disabled by using CSS class Pin
indian14314-Apr-09 3:35
indian14314-Apr-09 3:35 
AnswerRe: Scroll bars of TreeView should be invisble when they are disabled by using CSS class Pin
binarymax14-Apr-09 3:41
binarymax14-Apr-09 3:41 
GeneralRe: Scroll bars of TreeView should be invisble when they are disabled by using CSS class Pin
indian14314-Apr-09 19:45
indian14314-Apr-09 19:45 
QuestionThread locking and ASP.NET [modified] Pin
binarymax14-Apr-09 3:08
binarymax14-Apr-09 3:08 
Questionpotential solutions for recording video from client webcam Pin
hardboy11114-Apr-09 2:49
hardboy11114-Apr-09 2:49 
Questionsql server login problem Pin
nikhil123414-Apr-09 2:32
nikhil123414-Apr-09 2:32 
AnswerRe: sql server login problem Pin
Colin Angus Mackay14-Apr-09 2:59
Colin Angus Mackay14-Apr-09 2:59 
AnswerRe: sql server login problem Pin
Greg Chelstowski14-Apr-09 3:00
Greg Chelstowski14-Apr-09 3:00 
GeneralRe: sql server login problem Pin
Colin Angus Mackay14-Apr-09 3:05
Colin Angus Mackay14-Apr-09 3:05 
GeneralRe: sql server login problem Pin
Greg Chelstowski14-Apr-09 3:10
Greg Chelstowski14-Apr-09 3:10 
QuestionSession Problem Pin
pra.chaudhari14-Apr-09 2:18
pra.chaudhari14-Apr-09 2:18 
AnswerRe: Session Problem Pin
Abhijit Jana14-Apr-09 2:45
professionalAbhijit Jana14-Apr-09 2:45 
GeneralRe: Session Problem Pin
pra.chaudhari14-Apr-09 3:00
pra.chaudhari14-Apr-09 3:00 
GeneralRe: Session Problem Pin
Abhijit Jana14-Apr-09 3:51
professionalAbhijit Jana14-Apr-09 3:51 
GeneralRe: Session Problem Pin
Yusuf14-Apr-09 11:05
Yusuf14-Apr-09 11:05 
GeneralRe: Session Problem Pin
Abhijit Jana14-Apr-09 19:24
professionalAbhijit Jana14-Apr-09 19:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.