473,667 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I can't access some classes, but can access others in the same namespace, why?

Hi,
I have many classes a user may need to call methods on my webservice. Some
classes are "published" and some are not... I mean, when we do a Web
reference from another project, we don't have access to some classes
remotely... Is there something special these classes need so we can use
them remotely?

There's an example at the end of the post

Here, Result is accessible, but ContactData is not... and there are others
that are not accessible that are not IXmlSerializabl e, so it's not problem
(at least, I don't think so)

Anyone have an idea of what it could be? (btw, everything compiles, all
types exist in the same namespace)

And another question... I have exactly the same problem with some enum...
what are the specs about this? is there a link I could find the info?

Thanks

ThunderMusic

here's an example :
// This is the web service itself
[WebService(Name space = "http://myserv.com/S/NS")]
[WebServiceBindi ng(ConformsTo = WsiProfiles.Bas icProfile1_1)]
public class Contacts : System.Web.Serv ices.WebService
{
#region Web Service Methods

[WebMethod(Descr iption = "Create a Contact.")]
public Result Create(RemoteID ID, ProjectID Project, ContactData Contact)
{
return new Result(true, false);
}
}

in another file, I have all this (all in the same namespace, and in the same
file) :
[WebService(Name space = "http://myserv.com/S/NS")]
public class Result
{
private bool m_Success = true;
private bool m_Authenticatio nError = false;
private ErrorCodes m_ErrorCode = ErrorCodes.NoEr ror;
private int m_AffectedRows = 0;

public bool Success { get { return m_Success; } set { m_Success =
value; } }
public bool AuthenticationE rror { get { return m_Authenticatio nError; } set
{ m_Authenticatio nError = value; } }
public ErrorCodes ErrorCode { get { return m_ErrorCode; } set { m_ErrorCode
= value; } }
public int AffectedRows { get { return m_AffectedRows; } set {
m_AffectedRows = value; } }
}

[WebService(Name space = "http://myserv.com/S/NS")]
public class ContactData : IXmlSerializabl e
{
private List<ContactDat aItemm_ContactD ataItems = new
List<ContactDat aItem>();
[XmlIgnore()]
public List<ContactDat aItemContactDat aItems { get { return
m_ContactDataIt ems; } }

#region IXmlSerializabl e Members
[...] // my IXmlSerializabl e implementation
#endregion
}
Feb 21 '07 #1
1 1637
ok, we f ound out for the enum that if they are not used (or used by a class
we can't see), we don't have access to it (the enum)

So now we must know how to make those classes accessible... So, are
Generics supported? if they are not, is there a workaround? Are there any
other consideration to take care?

thanks

ThunderMusic

"ThunderMus ic" <No************ *************@N oSpAm.comwrote in message
news:uj******** ******@TK2MSFTN GP02.phx.gbl...
Hi,
I have many classes a user may need to call methods on my webservice. Some
classes are "published" and some are not... I mean, when we do a Web
reference from another project, we don't have access to some classes
remotely... Is there something special these classes need so we can use
them remotely?

There's an example at the end of the post

Here, Result is accessible, but ContactData is not... and there are
others that are not accessible that are not IXmlSerializabl e, so it's not
problem (at least, I don't think so)

Anyone have an idea of what it could be? (btw, everything compiles, all
types exist in the same namespace)

And another question... I have exactly the same problem with some enum...
what are the specs about this? is there a link I could find the info?

Thanks

ThunderMusic

here's an example :
// This is the web service itself
[WebService(Name space = "http://myserv.com/S/NS")]
[WebServiceBindi ng(ConformsTo = WsiProfiles.Bas icProfile1_1)]
public class Contacts : System.Web.Serv ices.WebService
{
#region Web Service Methods

[WebMethod(Descr iption = "Create a Contact.")]
public Result Create(RemoteID ID, ProjectID Project, ContactData Contact)
{
return new Result(true, false);
}
}

in another file, I have all this (all in the same namespace, and in the
same file) :
[WebService(Name space = "http://myserv.com/S/NS")]
public class Result
{
private bool m_Success = true;
private bool m_Authenticatio nError = false;
private ErrorCodes m_ErrorCode = ErrorCodes.NoEr ror;
private int m_AffectedRows = 0;

public bool Success { get { return m_Success; } set { m_Success =
value; } }
public bool AuthenticationE rror { get { return m_Authenticatio nError; }
set { m_Authenticatio nError = value; } }
public ErrorCodes ErrorCode { get { return m_ErrorCode; } set {
m_ErrorCode = value; } }
public int AffectedRows { get { return m_AffectedRows; } set {
m_AffectedRows = value; } }
}

[WebService(Name space = "http://myserv.com/S/NS")]
public class ContactData : IXmlSerializabl e
{
private List<ContactDat aItemm_ContactD ataItems = new
List<ContactDat aItem>();
[XmlIgnore()]
public List<ContactDat aItemContactDat aItems { get { return
m_ContactDataIt ems; } }

#region IXmlSerializabl e Members
[...] // my IXmlSerializabl e implementation
#endregion
}


Feb 22 '07 #2

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

Similar topics

2
1453
by: Alex Sedow | last post by:
Why C# lookup mechanism can't found indirect base class by name? It is seems very strange: derived class can access to base members, but not class itself. Example: namespace N1 { class B { public static int i;
4
3064
by: Will Pittenger | last post by:
I have a project where the backend is Access. I have learned (slowly) to use OLEDB to access my data. However, to save changes, I need to generate a SQL statement. This seems clunky. I am used to MFC recordsets. The OleDB system will let me add the row to the rowset, but then does nothing with it. I have tried calling BeginEdit/EndEdit, AcceptChanges (from several different classes), System.Data.DataTable.Rows.Add, and...
2
1676
by: tshad | last post by:
I have a DLL in the bin folder of my Web Application. When I try to build it, it says it can't find it. Here is the beginning of my Class: ******************************************************* Imports System Imports System.Data Imports System.Data.SqlClient
2
21865
by: Rich | last post by:
Greetings, I am trying to find a way to use a form of GetObject in VB.Net and have been researching WMI. Apparently, this is a vast subject, but seems to reference a Namespace called Root.CIMV2. Does anyone know how to access this namespace? Thanks, Rich
3
4027
by: _DD | last post by:
I believe Balena's Best Practices book suggests grouping quite a few classes into each namespace. I don't remember a number, but this has me curious about how other programmers handle this. If classes are obviously related, then I use the same namespace. Problem is that this doesn't seem to happen often. I could understand Balena's numbers in the context of a specific library, but in the scope of a large program, many corners are...
0
1377
by: Dr. Peer Griebel | last post by:
I'm currently writing a small toy application to support symbolic algebra. Therefore I implemented some classes Term, Var, Number, Sum, Product, Power. These classes are tightly coupled. So it is not possible to organize them in distinct files. This would result in cyclic imports. To manage the complexity I implemented some sort of aspect oriented programming (perhaps aspect oriented programming is not quite right in this...
9
2159
by: JT | last post by:
Here is the overall structure I will be referring to: End-program ProvideWorkFlow.dll Forms and methods that properly manipulate calls to methods in AccessUtils AccessUtils (a web service) Hide.dll methods and data I want to remain hidden I have a DLL, Hide.dll, that contains methods that I want to handle for
5
2015
by: wpmccormick | last post by:
What is the cleanest way to gain access to object methods and properties across classes and files in the same namespace? Example: A form object frmForm in file frmForm.cs creates obj1 defined in file obj1.cs, which in turn creates obj2 and obj3 defined in obj2.cs and obj3.cs, respectively. What is the canonical way for frmForm to access obj2 and obj3? For obj3 to access frmForm?
1
2853
by: Autostrad | last post by:
Below; I have 2 classes (forms), Namely, "PrintOneEmployee" and "DeleteOne". In class "PrintOneEmployee"; I want to declare a variable with name of "fileName" to contain the name of the file "Main\\_1Main.txt". Later on, when I wanted to access the variable "fileName" in the other class, namely, "DeleteOne". The compiler show an error that the variable is undeclared. What should I do to access the variable "fileName" in the the...
0
8458
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8366
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8790
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8565
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8650
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2779
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1779
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.