Could not establish connection to network for web service?

D

Don Miller

Greetings,

Just started with the CF during beta 2 of VS2005 and had no trouble adding a
web reference to a CF Pocket PC 2003 SE project and consuming it.

Then comes the RTM/Release version and poof! when I try on any machine (I've
tried about 5 of 'em) I get a break in Reference.cs that says "Could not
establish connection to network". I'm uising a simple hello world as a
service running on my localhost. I can connect and use the service just fine
in windows and web apps, but not in the CF. My code is simple:
private void button1_Click(object sender, EventArgs e)

{

localhost.Service svc = new DeviceApplication1.localhost.Service();

label1.Text = svc.HelloWorld();

}



The code breaks in Reference.cs at the object[] results line.

/// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/HelloWorld",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

public string HelloWorld() {

object[] results = this.Invoke("HelloWorld", new object[0]);

return ((string)(results[0]));

}



Any help?



Thanks!

don
 
S

Simon Hart

What is the "Web Reference" property set to for the Web Service? by default
adding a local web reference to your CF project will set this IP address to
localhost. So when you run this code on your device it won't be looking on
your machine, rather the PPC. Ensure you set the Url property of the Web
Service proxy object to the IP address of your machine.

Cheers
Simon.
 
D

Don Miller

I'm using the emulator, so localhost should be just fine. However I did try
what you suggested and got the same results (unfortunately).

Thanks!
Don

Simon Hart said:
What is the "Web Reference" property set to for the Web Service? by
default adding a local web reference to your CF project will set this IP
address to localhost. So when you run this code on your device it won't be
looking on your machine, rather the PPC. Ensure you set the Url property
of the Web Service proxy object to the IP address of your machine.

Cheers
Simon.

Don Miller said:
Greetings,

Just started with the CF during beta 2 of VS2005 and had no trouble
adding a web reference to a CF Pocket PC 2003 SE project and consuming
it.

Then comes the RTM/Release version and poof! when I try on any machine
(I've tried about 5 of 'em) I get a break in Reference.cs that says
"Could not establish connection to network". I'm uising a simple hello
world as a service running on my localhost. I can connect and use the
service just fine in windows and web apps, but not in the CF. My code is
simple:
private void button1_Click(object sender, EventArgs e)

{

localhost.Service svc = new DeviceApplication1.localhost.Service();

label1.Text = svc.HelloWorld();

}



The code breaks in Reference.cs at the object[] results line.

/// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/HelloWorld",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

public string HelloWorld() {

object[] results = this.Invoke("HelloWorld", new object[0]);

return ((string)(results[0]));

}



Any help?



Thanks!

don
 
S

Simon Hart

This will be the same on an emulator as the device. Localhost on the
emulator will still be looking on itsself for the web service.
What operating system are you using, if XP and onwards, ensure you have
opened port 80 (or whatever port your web server is using) is not being
blocked by your firewall.

Cheers
Simon.

Don Miller said:
I'm using the emulator, so localhost should be just fine. However I did
try what you suggested and got the same results (unfortunately).

Thanks!
Don

Simon Hart said:
What is the "Web Reference" property set to for the Web Service? by
default adding a local web reference to your CF project will set this IP
address to localhost. So when you run this code on your device it won't
be looking on your machine, rather the PPC. Ensure you set the Url
property of the Web Service proxy object to the IP address of your
machine.

Cheers
Simon.

Don Miller said:
Greetings,

Just started with the CF during beta 2 of VS2005 and had no trouble
adding a web reference to a CF Pocket PC 2003 SE project and consuming
it.

Then comes the RTM/Release version and poof! when I try on any machine
(I've tried about 5 of 'em) I get a break in Reference.cs that says
"Could not establish connection to network". I'm uising a simple hello
world as a service running on my localhost. I can connect and use the
service just fine in windows and web apps, but not in the CF. My code is
simple:
private void button1_Click(object sender, EventArgs e)

{

localhost.Service svc = new DeviceApplication1.localhost.Service();

label1.Text = svc.HelloWorld();

}



The code breaks in Reference.cs at the object[] results line.

/// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/HelloWorld",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

public string HelloWorld() {

object[] results = this.Invoke("HelloWorld", new object[0]);

return ((string)(results[0]));

}



Any help?



Thanks!

don
 
M

msnews.microsoft.com

Right--didn't think of that (emulator). However even after entering the IP
address the problem still exists. Plus I can access the same service just
fine via web/windows app.

What further confounds is that prior to the RTM/Release version of vs2005
this was not an issue--everything worked fine as coded. Only when I upgraded
my machines did this start happening.

thanks!
don

Simon Hart said:
This will be the same on an emulator as the device. Localhost on the
emulator will still be looking on itsself for the web service.
What operating system are you using, if XP and onwards, ensure you have
opened port 80 (or whatever port your web server is using) is not being
blocked by your firewall.

Cheers
Simon.

Don Miller said:
I'm using the emulator, so localhost should be just fine. However I did
try what you suggested and got the same results (unfortunately).

Thanks!
Don

Simon Hart said:
What is the "Web Reference" property set to for the Web Service? by
default adding a local web reference to your CF project will set this IP
address to localhost. So when you run this code on your device it won't
be looking on your machine, rather the PPC. Ensure you set the Url
property of the Web Service proxy object to the IP address of your
machine.

Cheers
Simon.

Greetings,

Just started with the CF during beta 2 of VS2005 and had no trouble
adding a web reference to a CF Pocket PC 2003 SE project and consuming
it.

Then comes the RTM/Release version and poof! when I try on any machine
(I've tried about 5 of 'em) I get a break in Reference.cs that says
"Could not establish connection to network". I'm uising a simple hello
world as a service running on my localhost. I can connect and use the
service just fine in windows and web apps, but not in the CF. My code
is simple:
private void button1_Click(object sender, EventArgs e)

{

localhost.Service svc = new DeviceApplication1.localhost.Service();

label1.Text = svc.HelloWorld();

}



The code breaks in Reference.cs at the object[] results line.

/// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/HelloWorld",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

public string HelloWorld() {

object[] results = this.Invoke("HelloWorld", new object[0]);

return ((string)(results[0]));

}



Any help?



Thanks!

don
 
M

msnews.microsoft.com

Called Microsoft on this one -- turns out that the default configuration of
the emulator is different than in previous versions. You have to actually
setup networking and be able to establish a connection (I thought there was
some "F.M." that just handled all that in the background for you--gettin'
too used to Microsoft doing everything for me I guess...). Then, as stated
by Simon in this post, you can't use localhost 'cause the emulator doesn't
know what that is. <excuse> I've never had to setup anything on the emulator
before going to release 2005</excuse>
 
P

Paul G. Tobey [eMVP]

The emulator *does* know what localhost is, but localhost is *not* the
outside, desktop OS that is running the emulator. It is the emulator
itself...

Paul T.

msnews.microsoft.com said:
Called Microsoft on this one -- turns out that the default configuration
of the emulator is different than in previous versions. You have to
actually setup networking and be able to establish a connection (I thought
there was some "F.M." that just handled all that in the background for
you--gettin' too used to Microsoft doing everything for me I guess...).
Then, as stated by Simon in this post, you can't use localhost 'cause the
emulator doesn't know what that is. <excuse> I've never had to setup
anything on the emulator before going to release 2005</excuse>


Don Miller said:
Greetings,

Just started with the CF during beta 2 of VS2005 and had no trouble
adding a web reference to a CF Pocket PC 2003 SE project and consuming
it.

Then comes the RTM/Release version and poof! when I try on any machine
(I've tried about 5 of 'em) I get a break in Reference.cs that says
"Could not establish connection to network". I'm uising a simple hello
world as a service running on my localhost. I can connect and use the
service just fine in windows and web apps, but not in the CF. My code is
simple:
private void button1_Click(object sender, EventArgs e)

{

localhost.Service svc = new DeviceApplication1.localhost.Service();

label1.Text = svc.HelloWorld();

}



The code breaks in Reference.cs at the object[] results line.

/// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/HelloWorld",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

public string HelloWorld() {

object[] results = this.Invoke("HelloWorld", new object[0]);

return ((string)(results[0]));

}



Any help?



Thanks!

don
 

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

Top