开发者

Can Metro make Java webservices interoperable with WCF even if Java lacks out parameter support?

I have a WCF client that used to call a WCF method with an out parameter:

int SomeMethod(out int anotherReturnValue);

When reimplementing this method in a Java Webservice will I have to change this method contract? I heard that something called Metro made Java webservices interoperate with WCF, but I guess in this case I will have to change the c开发者_开发技巧ontract. Is that right?


In Metro, You can annotate the out parameter with the @WebParam annotation. Then define the parameter to a Holder for your original type. For example:

int someMethod(@WebParam(name="anotherReturnValue", mode=Mode.OUT)
    Holder<Integer>anotherReturnValue);

See this article for more details: WebService hints and tips

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜