[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do I access global variables in a webservice application?

Posted on 2004-10-29
2
Medium Priority
?
1,662 Views
Last Modified: 2008-01-09
I've created a webservice application and declared some public enumerations int the global.asax. So far so good.
I created a web application with a web reference to the webservice application.
Here's my problem: How can I use the public enumerations in the webservice in my web application.
If I do a reference like:

Webapplication1.localhost.PublicEnum  

This wont work. The only time it works is when I create a webmethod and use the enum as a parameter like so:

[WebMethod]
public void MyWebmethod (PublicEnum myEnum)
{
}
After the creation of this webmethod the enum PublicEnum is availble in my webapplication by the reference as above.

Does anyone know how I can access the public enum withous using it as a parameter?
0
Comment
Question by:zandur
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Expert Comment

by:EugeneTrukhin
ID: 12444246
You need to understand the nature of web services. You can't reference them and use variables declared in the web service. You should remember that the link between your app and web service is maintained through XML. XML is returned to your app whenever you invoke some method of the web service, otherwise, nothing is returned. Also, don't forget that web services are stateless.

0
 
LVL 28

Accepted Solution

by:
mmarinov earned 375 total points
ID: 12445725
Hi zandur,

the problem you have faced is because the enum is declared in the webservice - which is totaly different namespace from the web applications
you can use enum if you pass it as parameter the web application recognize this type because it is declared in the WSDL but if you don't the type is not passed there and you can not find it

Regards!
B..M
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question