simpligility / ksoap2-android

ksoap2-android - SOAP support for Android
http://simpligility.github.io/ksoap2-android/
Other
544 stars 247 forks source link

Accept 202 http status code (instead throwing exception). #102

Closed robocik closed 7 years ago

robocik commented 7 years ago

This status is used by WCF IsOneWay operations

Kisty commented 7 years ago

That sounds fair. Checking the OkHttp3 library, a response is counted as a success if the response is:

200 <= code && code < 300

Do you think you could change the status check to that?

https://github.com/square/okhttp/blob/7135628c645892faf1a48a8cff464e0ed4ad88cb/okhttp/src/main/java/okhttp3/Response.java#L105

robocik commented 7 years ago

To change success condition to code >= 200 && code < 300 we need to make a bigger investigation. So as a safer solution I would merge the current pull request and later if we ensure that we can use your condition, then we will create a new pull request.

We have to check for null becaues during my test when WCF service returns from IsOneWay method, then response length was 0 and the response stream was null. Which of course throws exception in parseResponse method.

Kisty commented 7 years ago

@robocik Ah right. That makes sense. Thanks for explaining :)

mosabua commented 7 years ago

Could add some changelog entry and if necessary some documentation?

Kisty commented 7 years ago

@mosabua What changes would we like to be applied? The ability to accept status code 202 as well or any code which is 200 <= code && code < 300? Is there anything else we want added?

mosabua commented 7 years ago

I can do the rest tonight if this is good to go from your perspective... @robocik @Kisty

Kisty commented 7 years ago

If you mean adding the broader status check and adding documentation surrounding that then yes, that's fine with me.