[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

QRY: Asp listener for Soap and the construct: Application("xInitialized")

(Jonathan)

12/26/2002 3:35:00 AM

microsoft.public.xml.soap,
microsoft.public.xml.soapsdk,
microsoft.public.msdn.soaptoolkit,
microsoft.public.msdn.webservices,
microsoft.public.dotnet.framework.aspnet.webservices

Subject: QRY: Asp listener for Soap and the construct:
Application("xInitialized")


** ASP page options
I have a query over the different versions of the ASP listener page -
the first is a simple "create soap object, make soap call" page that
is illustrated in the help file while the second (auto-generated by
the WSDL wizard) uses a more complex, "if not Initialized DO create
soap object, store soap object, set Initialized =True; make soap call"
approach.

1. The help ASP listener page
WSDLFilePath = Server.MapPath("xmpi.wsdl")
WSMLFilePath = Server.MapPath("xmpi.wsml")
Set SoapServer = Server.CreateObject("MSSOAP.SoapServer30")
SoapServer.Init WSDLFilePath, WSMLFilePath
SoapServer.SoapInvoke Request, Response, ""

2. The wizard ASP listener page
'* A. Initialise SoapServer30 object
If Not Application("xmpiInitialized") Then
WSDLFilePath = Server.MapPath("xmpi.wsdl")
WSMLFilePath = Server.MapPath("xmpi.wsml")
Set SoapServer = Server.CreateObject("MSSOAP.SoapServer30")
SoapServer.Init WSDLFilePath, WSMLFilePath
Set Application("xmpiServer") = SoapServer
Application("xmpiInitialized") = True
End If
'* B. Use SoapServer30 object
Set SoapServer = Application("xmpiServer")
SoapServer.SoapInvoke Request, Response, ""


Q1. What, in practice will be the difference?
Q2. Will there only be a difference if Cookies are used to provide
some sort of "Session" spanning multiple Soap calls?
Q3. I use SoapInvokeEx and create/init my own object. If the lifetime
behaviours of the two approaches does make a difference then I guess
I have to consider which approach to use for my 'live' server object.
Under what conditions will a client making a call find that
'Application("xmpiInitialized")' evaluates to TRUE?

Many thanks.
Jonathan
1 Answer

Roger Wolter[MS]

12/9/2002 7:35:00 PM

0

Parsing the WSDL file in mssoapinit is a fairly expensive operation so
storing the soap server as session data is quite a bit more efficient.

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Jonathan" <jonjo@earthling.net> wrote in message
news:6697c7fd.0212090713.2beed6ae@posting.google.com...
> microsoft.public.xml.soap,
> microsoft.public.xml.soapsdk,
> microsoft.public.msdn.soaptoolkit,
> microsoft.public.msdn.webservices,
> microsoft.public.dotnet.framework.aspnet.webservices
>
> Subject: QRY: Asp listener for Soap and the construct:
> Application("xInitialized")
>
>
> ** ASP page options
> I have a query over the different versions of the ASP listener page -
> the first is a simple "create soap object, make soap call" page that
> is illustrated in the help file while the second (auto-generated by
> the WSDL wizard) uses a more complex, "if not Initialized DO create
> soap object, store soap object, set Initialized =True; make soap call"
> approach.
>
> 1. The help ASP listener page
> WSDLFilePath = Server.MapPath("xmpi.wsdl")
> WSMLFilePath = Server.MapPath("xmpi.wsml")
> Set SoapServer = Server.CreateObject("MSSOAP.SoapServer30")
> SoapServer.Init WSDLFilePath, WSMLFilePath
> SoapServer.SoapInvoke Request, Response, ""
>
> 2. The wizard ASP listener page
> '* A. Initialise SoapServer30 object
> If Not Application("xmpiInitialized") Then
> WSDLFilePath = Server.MapPath("xmpi.wsdl")
> WSMLFilePath = Server.MapPath("xmpi.wsml")
> Set SoapServer = Server.CreateObject("MSSOAP.SoapServer30")
> SoapServer.Init WSDLFilePath, WSMLFilePath
> Set Application("xmpiServer") = SoapServer
> Application("xmpiInitialized") = True
> End If
> '* B. Use SoapServer30 object
> Set SoapServer = Application("xmpiServer")
> SoapServer.SoapInvoke Request, Response, ""
>
>
> Q1. What, in practice will be the difference?
> Q2. Will there only be a difference if Cookies are used to provide
> some sort of "Session" spanning multiple Soap calls?
> Q3. I use SoapInvokeEx and create/init my own object. If the lifetime
> behaviours of the two approaches does make a difference then I guess
> I have to consider which approach to use for my 'live' server object.
> Under what conditions will a client making a call find that
> 'Application("xmpiInitialized")' evaluates to TRUE?
>
> Many thanks.
> Jonathan