开发者

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

开发者 https://www.devze.com 2023-03-30 07:42 出处:网络
I have a WCF client that used to call a WCF method with an out parameter: int SomeMethod(out int anotherReturnValue);

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

精彩评论

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