Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Web references now works with UT WS
Message
De
22/05/2003 01:46:18
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Web Services
Titre:
Web references now works with UT WS
Divers
Thread ID:
00791463
Message ID:
00791463
Vues:
42
The Web reference of a .NET project now works with the UT WS. I have updated the VB.NET sample in our http://www.levelextreme.com/WebService.asp page. Basically, all is needed, is after the instantiation of the Web Service, is the addition of this line:
Dim loUT As UniversalThread.UniversalThread = New UniversalThread.UniversalThread
loUT.CookieContainer = New System.Net.CookieContainer
By default, the cookie container is off. So, we have to enable it so it can grab any cookie sent to it on the client side.

Here's how it looks:
' This assume the Web reference has been added in the project under this name
Dim loUT As UniversalThread.UniversalThread = New UniversalThread.UniversalThread

Dim llLogged AS Boolean
Dim lcXML As String

' Create the cookie container
loUT.CookieContainer = New System.Net.CookieContainer

' Do the login and just show the status
llLogged = loUT.Login("myusername", "mypassword")
If llLogged Then
   MessageBox.Show("Login successfull!")
   Else
   MessageBox.Show("Login failed!")
End If

' Call a method as an example to retrieve the latest .NET news for the last 15 days
lcXML = loUT.GetNews(DateAdd("d", -15, Date.Today), Date.Today(), 44)

' Just show the XML string that was returned
MessageBox.Show(lcXML)
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Répondre
Fil
Voir

Click here to load this message in the networking platform