473,385 Members | 1,693 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,385 software developers and data experts.

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 IXmlSerializable, 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(Namespace = "http://myserv.com/S/NS")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Contacts : System.Web.Services.WebService
{
#region Web Service Methods

[WebMethod(Description = "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(Namespace = "http://myserv.com/S/NS")]
public class Result
{
private bool m_Success = true;
private bool m_AuthenticationError = false;
private ErrorCodes m_ErrorCode = ErrorCodes.NoError;
private int m_AffectedRows = 0;

public bool Success { get { return m_Success; } set { m_Success =
value; } }
public bool AuthenticationError { get { return m_AuthenticationError; } set
{ m_AuthenticationError = value; } }
public ErrorCodes ErrorCode { get { return m_ErrorCode; } set { m_ErrorCode
= value; } }
public int AffectedRows { get { return m_AffectedRows; } set {
m_AffectedRows = value; } }
}

[WebService(Namespace = "http://myserv.com/S/NS")]
public class ContactData : IXmlSerializable
{
private List<ContactDataItemm_ContactDataItems = new
List<ContactDataItem>();
[XmlIgnore()]
public List<ContactDataItemContactDataItems { get { return
m_ContactDataItems; } }

#region IXmlSerializable Members
[...] // my IXmlSerializable implementation
#endregion
}
Feb 21 '07 #1
1 1617
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

"ThunderMusic" <No*************************@NoSpAm.comwrote in message
news:uj**************@TK2MSFTNGP02.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 IXmlSerializable, 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(Namespace = "http://myserv.com/S/NS")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Contacts : System.Web.Services.WebService
{
#region Web Service Methods

[WebMethod(Description = "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(Namespace = "http://myserv.com/S/NS")]
public class Result
{
private bool m_Success = true;
private bool m_AuthenticationError = false;
private ErrorCodes m_ErrorCode = ErrorCodes.NoError;
private int m_AffectedRows = 0;

public bool Success { get { return m_Success; } set { m_Success =
value; } }
public bool AuthenticationError { get { return m_AuthenticationError; }
set { m_AuthenticationError = value; } }
public ErrorCodes ErrorCode { get { return m_ErrorCode; } set {
m_ErrorCode = value; } }
public int AffectedRows { get { return m_AffectedRows; } set {
m_AffectedRows = value; } }
}

[WebService(Namespace = "http://myserv.com/S/NS")]
public class ContactData : IXmlSerializable
{
private List<ContactDataItemm_ContactDataItems = new
List<ContactDataItem>();
[XmlIgnore()]
public List<ContactDataItemContactDataItems { get { return
m_ContactDataItems; } }

#region IXmlSerializable Members
[...] // my IXmlSerializable implementation
#endregion
}


Feb 22 '07 #2

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

Similar topics

2
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 {...
4
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...
2
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: ...
2
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...
3
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...
0
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...
9
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)...
5
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.