Help! Webexception after first successful web service call

M

Mike Helstrom

I created a CF application that consumes web services over the Internet.

When the device is in the cradle using ActiveSync, the application functions
properly. All web services are called and return the correct values (no
exceptions are thrown).

When the device uses its' internal modem via Cell Phone, the first web
service call functions properly and returns the correct value, but all
subsequent calls to web services fail. The exception thrown is : "The
remote server returned an error: (404) not found"

I've tried using previous versions of the CF along with the recently
released SP2 and I have similar problems. (When using SP2, a generic
Webexception is thrown without a specific error message)

Has anyone seen this issue?

Thanks!

-Mike Helstrom
 
S

Strider

When the device is in the cradle it uses your desktop pc
to connect to your local network. This means that in can
resolve any addresses using your LANs DNS.

When you connect via Cell Phone (GPRS?) the address
probably cannot be resolved because you do not have
access to your DNS. You could try using an IP address
instead of a computer name (eg.
http://192.168.200.200/myapp/mywebservice.asmx instead of
http://myserver/myapp/mywebservice.asmx) provided that
the server has a static IP address.

As an alternative, you could try specifying a DNS at the
connection's settings.
 
M

Mike Helstrom

It's not DNS because the first call is always successful, but it is related
to a DNS type of issue.

I figured this one out yesterday. It appears to be a bug somewhere within
the device (either the CF or a layer below)

Here's the scenario:

The server I'm hitting against is IIS 5.0 with a single IP address. On the
IIS server, multiple virtual servers are defined for port 80 using host
headers. The first call to the server would send the correct host header and
IIS would direct the request to the proper site (with my web service). All
subsequent calls to the web server do not send the host header in, so IIS
doesn't know how to direct the request. Since there wasn't a host header,
all requests were being directed to anouther virtual server on that box that
didn't have my web service installed.

To resolve the problem, I reconfigured the IIS server to listen on the
default ip without host headers for the virtual server I'm using. Once I did
that, all problems were resolved.
 

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