Problem accessing Web Service from pda application!

K

ksbhangu

Hi,

I am developing a system on the Compact Framework for Pocket PC. In my
project , I am trying to access Web Service from pda application..
However whenever complie the program, the following error is raised:
______________
A first chance exception of type 'System.IO.FileNotFoundExcepti­on'
occurred in mscorlib.dll


Additional information: FileNotFoundException

______________


The error is raised in Reference.vb file at line

Dim results() As Object = Me.Invoke("Login", New Object(-1) {})

in the follwing code (here login is a web method in service being
accessed)



<System.Web.Services.Protocols.SoapHeaderAttribute("cls_RL_SRV_AuthenticatorValue"),
_
System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/PdaServices/ws_RL_SRV_NewServices/Login",
RequestNamespace:="http://tempuri.org/PdaServices/ws_RL_SRV_NewServices",
ResponseNamespace:="http://tempuri.org/PdaServices/ws_RL_SRV_NewServices",
Use:=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>
_
Public Function Login() As String
Dim results() As Object = Me.Invoke("Login", New Object(-1) {})
Return CType(results(0),String)
End Function
 
I

Ilya Tumanov [MS]

I doubt you're getting System.IO.FileNotFoundExcepti­on. It's probably just
a message in the debugger about handled exception in BCL code.

Add a try/catch block and print out the real exception and message you're
getting, most likely it'll be some network problem like using localhost as
WS host.



Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).

Hi,

I am developing a system on the Compact Framework for Pocket PC. In my
project , I am trying to access Web Service from pda application..
However whenever complie the program, the following error is raised:
______________
A first chance exception of type 'System.IO.FileNotFoundExcepti­on'
occurred in mscorlib.dll


Additional information: FileNotFoundException

______________


The error is raised in Reference.vb file at line

Dim results() As Object = Me.Invoke("Login", New Object(-1) {})

in the follwing code (here login is a web method in service being
accessed)



<System.Web.Services.Protocols.SoapHeaderAttribute("cls_RL_SRV_AuthenticatorValue"),
_
System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/PdaServices/ws_RL_SRV_NewServices/Login",
RequestNamespace:="http://tempuri.org/PdaServices/ws_RL_SRV_NewServices",
ResponseNamespace:="http://tempuri.org/PdaServices/ws_RL_SRV_NewServices",
Use:=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>
_
Public Function Login() As String
Dim results() As Object = Me.Invoke("Login", New Object(-1) {})
Return CType(results(0),String)
End Function
 
K

Kuldeep

Hi Ilya,

You are right about the exception.

In try/cach block i get the following error message:

"Unable to connect to the remote server"

when i choose to break in debugger in case of exception in VS.Net then i
get the following message:

"A first chance exception of type 'System.UriFormatException' occurred
in System.dll
Additional information: Invalid URI: The hostname could not be parsed."


Can u suggest aby thing to resolve this? My Web Service is hosted on the
localhost and i'm developing and testing my pda application on same
machine.

Thank you
 
I

Ilya Tumanov [MS]

First of all, you should ignore exceptions handled in the BCL. Concentrate
on the exception you're getting.

In this case your device can not connect to a server. If you're using
localhost it won't work.

Localhost means "the host this program is running on" which is in this case
Pocket PC (or emulator which is a separate entity even though it's running
on your PC).

And you do not run WS on the Pocket PC, so it would never work.



1. Make sure you're _not_ using "localhost" as WS server name, but the real
server name or IP.

2. If it's of no use, make sure you can reach server by name or IP, try it
in the Pocket IE on device.



If IE can not reach the server, you have a network (configuration) issue.

If you proficient with networking, go ahead and fix it.

If not, please contact your network admin for help.


Best regards,



Ilya



This posting is provided "AS IS" with no warranties, and confers no rights.



*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 

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