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

T

ThunderMusic

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<ContactDataItem> m_ContactDataItems = new
List<ContactDataItem>();
[XmlIgnore()]
public List<ContactDataItem> ContactDataItems { get { return
m_ContactDataItems; } }

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

ThunderMusic

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top