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
精彩评论