开发者

strings returned by wcf wrapped with extra quotes

开发者 https://www.devze.com 2023-01-31 01:22 出处:网络
I\'m stuck with this problem for the last 2 days: I have server running WCF JSON service that returns type: string.

I'm stuck with this problem for the last 2 days:

I have server running WCF JSON service that returns type: string.

The client that consumes this service is Android application.

The problem:

The string returned by the WCF service seems to be fine (for example: "result_1"), but the value in the Android application looks like this: ""result_1"" (note the problematic extra quotes.开发者_运维技巧..).

What should i do in order to fix this? Thanks.


I have had this problem with iPhone developers in my workplace. The workaround I used was returning a custom class object instead of String like following:

public class StringContainer
{
    public String Value { get; set; }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消