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.
}
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.
}