Why when calling webreference in windows mobile like: localhost.service1 , some functions don’t show like: servicereference.service1client , any help would be highly appreciated
Regard’s
Why when calling webreference in windows mobile like: localhost.service1 , some functions don’t show like: servicereference.service1client , any help would be highly appreciated
Regard’s
You shouldnt use localhost as that would be the mobile. Try to use server or IP address as you reference.
localhost is just a name for the web reference, which is added as IP address already.
The question is, I want servicereference1.service1client to appear in windows mobile to take an object from it, why it doesn’t appear? while it appear when adding web service in windows application as servicereferecne1.service1client … I appreciate your help…
thanks in advance
Regard’s
Windows mobile will be using the WSDL style web reference, and not WCF service reference.
If you created the namespace of serviceReference1 for the Web reference you imported, find an object which probably ends with Service.
Even better, right click the Web reference in Visual studio, and choose browse in Object explorer to see the objects available. That might be a clue
Hi;
there is an object which called service1 see the code:-
using SmartDeviceProject2.WebReference; //or webreferecne could be renamed servicereference but nothing changes (it has service1 object also)
private void Form1_Load(object sender, EventAgrs e)
{
Service1 client = new Service1(); //there is no Service1Client
client. //there is no client.open
}
I want to call the service typically as windows application do, but I cant:
windows application code snippet:-
using WindowsFormApplication1.ServiceReference1;
private void FrmAllItems_Load(object sender, EventAgrs e)
{
try
{
service1client client = new service1client();
client.open();
DataSet ds = client.GetAllItems();
Datatable myDataTable = ds.Table[0];
dataGridView1.DataSource = myDataTable;
client.Close();
}
catch(Exception ex)
{
MessageBox.Show(ex.Massage);
}
this code getAllItems in the service and put it in the dataset then into a datatable then show it in a grid.
I Have never had to use the Open method from the Web service reference.
Its just the method exposed in the webservice is what needs to be called.
Enclose the creation of the client / proxy in a using statement, and that should handle closing / disposing of the object when completed.