tags:

views:

394

answers:

3

I developed a program in a mobile device (Pocket PC 2003) to access a web service, the web service is installed on a Windows XP SP2 PC with IIS, the PC has the IP 192.168.5.2.

The device obtains from the wireless network the IP 192.168.5.118 and the program works OK, it calls the method from the web service and executes the action that is needed. This program is going to be used in various buildings.

Now I have this problem, it turns that when I try to test it in another building (distances neraly about 100 mts. or 200 mts.) connected with the network, the program cannot connect to the webservice, at this moment the device gets from an Access Point the IP 192.168.10.25, and it accesses the same XP machine I stated before (192.168.5.2). I made a mobile aspx page to verify that I can reach the web server over the network and it loads it in the device, I even made a winform that access the same webservice in a PC from that building and also works there so I don't understand what is going on. I also tried to ping that 192.168.5.2 PC and it responds alive.

After that fail I returned to the original place where I tested the program before and it happens that it works normally.

The only thing that I look different here is that the third number in the IP is 10 instead of 5, another observation is that I can't ping to the mobile device. I feel confused I don't know what happens here? What could be the problem?

This is how I call the web service;

//Connect to webservice
svc = new TheWebService(); 
svc.Credentials = new System.Net.NetworkCredential(Settings.UserName, Settings.Password);
svc.AllowAutoRedirect = false;
svc.UserAgent = Settings.UserAgent;
svc.PreAuthenticate = true;
svc.Url = Settings.Url;
svc.Timeout = System.Threading.Timeout.Infinite;

//Send information to webservice
svc.ExecuteMethod(info);

the content of the app.config in the mobile device is;

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="UserName" value="administrator" />
    <add key="Password" value="************" />
    <add key="UserAgent" value="My User Agent" />
    <add key="Url" value="http://192.168.5.2/WebServices/TWUD.asmx" />
  </appSettings>
</configuration>

Does anyone have an idea what is going on?

A: 

Not an expert with this stuff but it looks like the first 3 parts of the address are being masked out. Is it possible that the mobile device is being given a network mask of:

255.255.255.0

As to reach beyond the range of the first 3 parts you need the mask to be:

255.255.0.0

This may be an oversimplification or completely wrong but that's was my gut response to the question.

Shaun Austin
A: 

This looks like a network issue, unless there's an odd bug in .Net CF that doesn't allow you to traverse subnets in certain situations (I can find no evidence of such a thing from googling).

Can you get any support from the network/IT team? Also, have you tried it from a different subnet? I.e. not the same as the XP machine (192.168.5.x) and not the same as the one that's not worked so far (192.168.10.).

@Shaun Austin - that wouldn't explain why they can get at a regular web page on the XP machine from the different subnet.

Gareth Jenkins
A: 

It was a network issue, we configurated a proxy server and that was the problem, I need to learn more about network.

nmiranda