Error accessing web service on localhost from emulator

D

Derek Anderson

I am trying to develop CF app by starting with Pocket TaskVision sample app.
I have a AuthService web service and a DataAccess web service. The
namespaces are
http://kiwi.kanecompany.com/KaneWS/AuthService

http://kiwi.kanecompany.com/KaneWS/DataAccess

The web services are located on my dev machine at:

http://<MachineIP>/KaneWS/AuthService.asmx

http://<MachineIP>/KaneWS/DataAccess.asmx

Within the CF project that is consuming the WS, I added the web references
and can correctly see and call the interfaces. When running the project, it
successfully calls the AuthService and authenticates and returns ticket.
Then, when I try to load data by calling my DataAccess service, I get the
following error:

The remote server returned an error: (404) Not Found
System.Net.WebException


On my local machine, I can successfully call this service at
http://localhost/KaneWS/DataAccess.asmx and it works fine. I have no idea on
where to go from here to debug this problem and have found no help on this
cryptic error message after googling and searching msdn and newsgroups all
day. Any help is greatly appreciated.

Derek
 
C

Chris Tacke, eMVP

"localhost" does not mean "my dev PC", it means "the machine on which this
code is running" which means the Pocket PC itself, when running on a PPC.
Use a host name or IP.
 
G

Ginny Caughey [MVP]

Derek,

Try using the IP address of your desktop machine instead of the fully
qualified name.
 
D

Derek Anderson

Thanks Chris and Ginny for the help, and that was my problem earlier this
morning and I figured out that I needed to use IP. I apologize for not
making it clear in my post, but I actually am referencing the web services
in code by ip:
http://<MachineIP>/KaneWS/AuthService.asmx
http://<MachineIP>/KaneWS/DataAccess.asmx

I can step through the code right up until the Invoke below and then I do
not know how to debug from that point:

public DataAccess() {

this.Url = http://<MachineIP>/KaneWS/DataAccess.asmx;

}

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://kiwi.kane
company.com/KaneWS/DataAccess/GetWorkOrders",
RequestNamespace="http://kiwi.kanecompany.com/KaneWS/DataAccess",
ResponseNamespace="http://kiwi.kanecompany.com/KaneWS/DataAccess",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

public dsWorkOrders GetWorkOrders(string ticket, int BUID) {

object[] results = this.Invoke("GetWorkOrders", new object[] {

ticket,

BUID});

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

}

Thanks for any help
 
D

Derek Anderson

For anyone who cares, I found the "problem". I missed the fact that they had
defined a const in their code:
public const string DataService = "DataService.asmx";

Since, I called mine DataAccess.asmx it of course could not find it. I named
mine what they named their Web Reference instead of what they named the
actual service.



Derek Anderson said:
Thanks Chris and Ginny for the help, and that was my problem earlier this
morning and I figured out that I needed to use IP. I apologize for not
making it clear in my post, but I actually am referencing the web services
in code by ip:
http://<MachineIP>/KaneWS/AuthService.asmx
http://<MachineIP>/KaneWS/DataAccess.asmx

I can step through the code right up until the Invoke below and then I do
not know how to debug from that point:

public DataAccess() {

this.Url = http://<MachineIP>/KaneWS/DataAccess.asmx;

}

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://kiwi.kane
company.com/KaneWS/DataAccess/GetWorkOrders",
RequestNamespace="http://kiwi.kanecompany.com/KaneWS/DataAccess",
ResponseNamespace="http://kiwi.kanecompany.com/KaneWS/DataAccess",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

public dsWorkOrders GetWorkOrders(string ticket, int BUID) {

object[] results = this.Invoke("GetWorkOrders", new object[] {

ticket,

BUID});

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

}

Thanks for any help

Derek,

Try using the IP address of your desktop machine instead of the fully
qualified name.
--
Ginny Caughey
.Net Compact Framework MVP

sample
app. project,
it idea
 

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