Namespace Problem

M

Mark Thomson

Hi, I've got a problem with my webservice and namespaces. I've have the two
classes below. Both are fine and appear to serialize correctly, but the
problem is when I try to access them from my client, the type is
Webservicenamespace.Venue and Webservicenamespace.Price


[Serializable]
public class Venue
{
public Venue(){
string name = "venue";
int id = 0;
Price[] prices = null;
}

}

[Serializable]
public class Price
{
public Price(){
string day = "monday";
int price = "343";
}

}





[WebMethod]
public Venue getVenue()

{

Venue v = new Venue();

return v;


}



//web service call

public WebServices service;

protected void Page_Load(object sender, EventArgs e)

{

service = new WebService.WebServices(); //define the webservice on the page
load event

service.Credentials = System.Net.CredentialCache.DefaultCredentials; //we
need credentials in order to use the service

}

protected void validateButton_Click(object sender, EventArgs e)

{


Venue v = service.getVenue(); //problem occurs here, since it returns a
type of Webservicenamespace.Venue




// Where Webservicenamepace is the namepace of the Web Service.

}
 
K

Karl Seguin

Why not just use different namespaces and specify a Using
Webservicenamepace; atop your client?

Karl
 

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

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top