473,395 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Using a Web Service call within a VB Module

I have a WS called "IWeb", which I define within the page class like
this:

Dim service As IWeb.WebService

I then have a button that calls the web service like this:

Dim header As IWeb.IWebAuthendicationHeader = New
IWeb.IWebAuthendicationHeader()
Dim strName As String = Request.ServerVariables("LOGON_USER")
header.Username = strName
header.Password = "ThisPW"
header.Encrypted = "True"

service = New IWeb.WebService()
service.IWebAuthendicationHeaderValue = header

Dim result As String = String.Empty

result = service.IsUserHere(My.Settings.WS_Role_Admins)

lblWSResult.Text = result

This works (with the code within the page-behind section), but I
really need this code to reside within a VB code MODULE. However, as
soon as I try to do this, I start getting errors. If I even add the
"Dim service As IWeb.WebService" definition, it gives me this error:
"Type 'IWeb.WebService' is not defined."

I have tried moving this definition to different areas within the
module's class, but I can't seem to get past this error. I think this
is one of those things where you can't call certain procedures outside
of a page's code-behind file (?). I have also experimented with
adding an Imports statement at the start of my module's class, with
similar errors.

I would greatly appreciate any suggestions & again, sorry for posting
a non-AJAX question.

Thank you!

Aug 24 '07 #1
1 1850
"Kirk" <lo****@hotmail.comwrote in message
news:11*********************@q5g2000prf.googlegrou ps.com...
>I have a WS called "IWeb", which I define within the page class like
this:

Dim service As IWeb.WebService

I then have a button that calls the web service like this:

Dim header As IWeb.IWebAuthendicationHeader = New
IWeb.IWebAuthendicationHeader()
Dim strName As String = Request.ServerVariables("LOGON_USER")
header.Username = strName
header.Password = "ThisPW"
header.Encrypted = "True"

service = New IWeb.WebService()
service.IWebAuthendicationHeaderValue = header

Dim result As String = String.Empty

result = service.IsUserHere(My.Settings.WS_Role_Admins)

lblWSResult.Text = result

This works (with the code within the page-behind section), but I
really need this code to reside within a VB code MODULE. However, as
soon as I try to do this, I start getting errors. If I even add the
"Dim service As IWeb.WebService" definition, it gives me this error:
"Type 'IWeb.WebService' is not defined."

I have tried moving this definition to different areas within the
module's class, but I can't seem to get past this error. I think this
is one of those things where you can't call certain procedures outside
of a page's code-behind file (?). I have also experimented with
adding an Imports statement at the start of my module's class, with
similar errors.

I would greatly appreciate any suggestions & again, sorry for posting
a non-AJAX question.
In general, you should avoid VB modules. They are not object-oriented, and
are effectively Shared classes without inheritance.

In this case, the question is, "why _isn't_ 'IWeb.WebService' defined? Did
you Import the namespace it is a part of?
--
John Saunders [MVP]

Aug 24 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: none | last post by:
Hi. I'm implementing a web deployment using 9i. I have a table for STOCK, which has one or more PURCHASES, which have one or more PURCHASE_ITEMS. When a purchase item is INSERTED, I'd like the...
2
by: Lord Brett Sinclair | last post by:
Hello everybody I created a windows services with an msi file. I have another small vb.net exe that I would like to install when I install the windows service. I tried to create a merge module...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
1
by: JD | last post by:
We have two web service machines. Call one WS1 and the other WS2. They are seperated by a firewall. WS1 handles web service calls and also calls web services provided by WS2. Both machines do not...
3
by: Michael Hoehne | last post by:
Hi, I'm currently facing a problem with a mixed environment using .NET 1.1 and ..NET 2.0 web services. We have a client application (the "client", system 1) running on .NET 2.0/WinXP, calling...
2
by: Trevor | last post by:
Argh! This problem is driving me nuts! Can you help? In November of 2003, I installed a web service on Windows Server 2003 built in VB.NET for v1.1.4322 of the framework. It contains a timer...
2
by: Maria.Reinhammar | last post by:
I have an app using active_directory.py and the std module asyncore in a Windows Service. Works perfectly! That is, until I try to use py2exe to create a standalone (need to avoid installing the...
4
by: Regnab | last post by:
I've got a form - "frmLookup" (with a subform) that works very happily on its own. The form has a list box, which when updated requeries the subform to display the appropriate results. The...
0
by: Griff | last post by:
Overview When the first call to our Web Service causes an exception, the Web Service caches that user's credentials for its life time. Details We have a Web Service which uses Windows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.