开发者

Java web service client not decoding base64

I'm currently trying to implement a WS client in java but I have the following problem:

The server is running in IIS 7.5 and was implemented with c#. It is sending a base64Binary string (which I believe it is supposed to since the original data was a byte array) but on the j开发者_高级运维ava side, all I get is an object of class B.

How can I get a byte array back from that object?

Thanks


It sounds like you have a object of type array of byte (byte[])

System.out.println("class=" + byte[].getClass());
System.out.println("class=" + byte[].getClass().getName());

produces an output of

class=class [B
class=[B

If this matches your output, then just cast the object into a byte[]

(byte[]) array;


Do you mean Class [B? In that case all you need is to cast:

byte[] bytes = (byte[]) obj;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜