Urgent, Professionals please help: How to call webservice stably from Pocket PC ???

K

Khanh

hi all,
We are developing a Pocket PC App for our client for months, and it
is going to delivering phase. But we are finding a big trouble with
calling webservice stably. Could experienced professionals help us?

Our model app as follows: Pocket PC < -- > Webservice < -- >
Database Server (SQL Server 2000, Oracle 7.3.4). Generally, calling
webservice from PDA meets many abnormal phenomenon, it can run
smoothly for a long period (many hours, many days), then SOMETIMES it
can't call webservice. Errors which is often returned are :
..
1) Since we use the mechanism of session from PDA, that means we must
use cookieless mode, we have to try, catch to change Webserivce URL,
then HTTPWebResponse return NOTHING.
Try
intValidLogin = g_wsMobileWebServices.Login(strUserName,
strPassWord)
Catch ex As Net.WebException
Dim httpResponse As HttpWebResponse = CType(ex.Response,
HttpWebResponse)
If httpResponse.StatusCode = HttpStatusCode.Found Then
g_wsMobileWebServices.Url = (New Uri(New
Uri(g_wsMobileWebServices.Url),
httpResponse.Headers("Location")).AbsoluteUri)
intValidLogin = g_wsMobileWebServices.Login(strUserName,
strPassWord)
End If
End try
2) If creating a session successfully , second error is Web exception:
Unable to read data from transport connection.

Dim ds as dataset = g_wsMobileWebServices.GetCustomerData()

The most important thing is these problems do not happen if calling
the identical webservice from Windows Application.
We tried to do as follows for smooth connection:
- Rebuild webservice
- Update webreference from Pocket PC App
- Rebuild Pocket PC App.
But it is still not stably.
FYI: Pocket PC Fujitsu Loox, Webserver Windows Server 2003,
Developing machine WinXP, Active Syn

Could anyone who has much experience instructs us more clearly. Any
help would be very appreciated.

Nguyen Truong Khanh
Project Leader
FPT Software
 
G

Guilherme Magalhaes [MVP]

Hi Khanh,

Looks like that you're getting your socket disconnected from your server
sometimes. That can occur by timeout, by a firewall or proxy between your
client and server or by the client or the server.

When an HTTP request is sent by the client to the server, an socket
connection is opened. If you server simply closes that connection without
sending any bit to the client, you'll have an Net.WebException with an null
Response object, since your server didn't sent anything.

The second exception seems to be the same thing. If your socket got
disconnected, it's impossible to the client to read information from it,
thus "Unable to read data from transport connection".

I recommend you to use an sniffer to check which side is closing the
connection.

But note that this is common with HTTP and sockets, sometimes you get
some networking inconsistence. That happens all the time when you're
browsing the web, sometimes you have to hit refresh to get a page shown. Try
to call the webservice again, like 3 times. If you're unsuccessfull all the
3 times then your program should deal with the exception seriously and send
a notification to the user.
 
N

Neville Richardson

I have had a very similar problem and talked to Microsoft on this and they
said they would look into it, as yet no reply. I believe that the compact
framework has fundamental problems when calling web services. Sorry but I do
not have a solution, please post if you find one.
 
Top