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

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

Post by ThunderMus » Fri, 23 Feb 2007 04:47:09


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://www.yqcomputer.com/ ")]
[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://www.yqcomputer.com/ ")]
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://www.yqcomputer.com/ ")]
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
}
 
 
 

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

Post by ThunderMus » Fri, 23 Feb 2007 22:55:30

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