logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Login


Options
View
Go to last post Go to first unread
Dave  
#1 Posted : Sunday, March 10, 2013 1:23:02 AM(UTC)
Dave

Rank: Newbie

Groups: Registered
Joined: 1/22/2012(UTC)
Posts: 8
Location: Champaign

Was thanked: 1 time(s) in 1 post(s)
I am trying to convert from using the REST services to the SOAP endpoint. I have not problem making and processing requests, but I am having a hard time handling failure scenarios cases where a request is sent but no response is received (i.e., connection interrupted for some reason). Is there any error/event that is raised via the web service methods for when the request fails?

I am newish to SOAP, so this could just be due to my lack of understanding. I am not sure if any of the web service methods are compiled into my app or if it works completely remotely. If the methods are local, then I would guess there is some way to handle errors, but if that is not the case, then I understand that I will have to handle it on my own (any tips?).

Thanks!
Ryan  
#2 Posted : Monday, March 11, 2013 8:10:34 AM(UTC)
Ryan

Rank: Administration

Groups: Administrators, Registered
Joined: 6/1/2011(UTC)
Posts: 88
United States
Location: Urbana

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)
Hi Dave,

The web service does not run any of the code locally; the SOAP interface is just a way to encapsulate the data transfer.

The web service should always raise an exception if the request fails. Depending on what language you are using, you should be able to catch any exceptions in a try/catch just like with native code. I have attached a simple C# program to demonstrate the error handling using the WS endpoint.

I'm not sure if that fully answered your question. It's very odd that you wouldn't get anything back at all (unless it is something like the network dropping out). If you can give me some more specifics on when you are seeing this (can you consistently reproduce the problem?) I may be able to be more help.
File Attachment(s):
ExampleWS.zip (33kb) downloaded 1 time(s).

You cannot view/download attachments. Try to login or register.
Dave  
#3 Posted : Monday, March 11, 2013 10:23:28 PM(UTC)
Dave

Rank: Newbie

Groups: Registered
Joined: 1/22/2012(UTC)
Posts: 8
Location: Champaign

Was thanked: 1 time(s) in 1 post(s)
That is what I thought regarding SOAP, but after looking at your example, I am hitting another snag. I am programming for WP8, and service references do not support task-based implementations, so I cannot use the async/await combos. I have to set it up with events (i.e., GetStopsBySearchCompleted), which works fine for processing the results, but I do not think it works for some errors--mainly if the network drops out or if there is some problem communicating with the server. I cannot reliably replicate the problem in the emulator, but I can sometimes simulate a brief loss of network connectivity, which results in no problems as far as the phone is concerned, but the response is never received.

http://stackoverflow.com...thout-task-based-proxies

Ryan  
#4 Posted : Tuesday, March 12, 2013 8:38:32 AM(UTC)
Ryan

Rank: Administration

Groups: Administrators, Registered
Joined: 6/1/2011(UTC)
Posts: 88
United States
Location: Urbana

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)
It's disappointing that they wouldn't choose to support the async/await keywords in WP8. If you are having to use event handlers for responses, I'm not really sure of a good, out of the box, way to handle network unreliability. I wonder if you could write a class to wrap the request and resend/display an error if the callback hasn't been hit after a certain timeout?

As far as what we can do, I obviously can't change the existing versions of the API, but we're actually hoping to release v2.2 of the API in the next week or so. So, if you have any suggestions for how we could make things easier on you, I'd definitely be open to hearing them.
Dave  
#5 Posted : Tuesday, March 12, 2013 10:22:24 AM(UTC)
Dave

Rank: Newbie

Groups: Registered
Joined: 1/22/2012(UTC)
Posts: 8
Location: Champaign

Was thanked: 1 time(s) in 1 post(s)
Thanks, I figured I would have to implement some kind of timeout mechanism, but I wanted to make sure I wasn't missing anything. I was looking online, and it appears that some web services have a timeout attribute, which is set to something by default by can also be overwritten. Knowing this value (or even better, being able to set it myself) would help to prevent timing out before receiving a response--basically, it gives more certainty that the response will never come and an error can be more confidently displayed. Not super critical, but it would help. Apparently the next major update for WP8 will unify the Win8 and WP8 APIs so it is more consistent, because the async/await pattern is super useful.
Ryan  
#6 Posted : Tuesday, March 12, 2013 2:18:35 PM(UTC)
Ryan

Rank: Administration

Groups: Administrators, Registered
Joined: 6/1/2011(UTC)
Posts: 88
United States
Location: Urbana

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)
Our timeout is set to 1 minute so you should never receive any responses from us after one minute. This is quite a long time, but I believe you can set a shorter timeout yourself on the client side if you wish.

I attached some more code to demonstrate the shorter timeout as well as how you may be able to handle timeout exceptions. It's pretty trivial, but I think it demonstrates what I'm talking about. Hopefully this helps.
File Attachment(s):
ExampleWS2.zip (76kb) downloaded 1 time(s).

You cannot view/download attachments. Try to login or register.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.