You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
run the client test with the following java file:
import java.rmi.;
import javax.naming.;
import wstest.server.*;
import javax.xml.ws.Holder;
public class EchoClient {
public static void main(String[] args) {
EchoImplService service = new EchoImplService();
EchoImpl port = service.getPort(EchoImpl.class);
Holder h1 = new Holder("1");
Holder h2 = new Holder("2");
String result = port.holderOperation(h1, h2);
Obviously some changes made the result better, now only the return value is null.
If removing @SOAPBinding(style=SOAPBinding.Style.RPC) from EchoImpl java file or inserting a non-holder parameter at the first place in holderOperation method, it will have return value.
Previously tracked via: https://bugs.openjdk.java.net/browse/JDK-8170462
To reproduce the issue:
package wstest;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.ws.Holder;
import java.rmi.RemoteException;
import javax.jws.soap.SOAPBinding;
@webservice
@SOAPBinding(style=SOAPBinding.Style.RPC)
public class EchoImpl {
@webmethod
public String holderOperation(@WebParam(name="holder1", mode=WebParam.Mode.INOUT)Holder holder1,
@WebParam(name="holder2", mode=WebParam.Mode.INOUT)Holder holder2) throws RemoteException{
holder1.value += "1";
holder2.value += "2";
return "success";
}
}
package wstest;
import javax.xml.ws.Endpoint;
public class EchoService {
public static void main(String[] args) {
Endpoint.publish("http://localhost:8080/WebServices/echoimpl", new EchoImpl());
}
}
generate the client:
wsimport -keep -p wstest.server http://localhost:8080/WebServices/echoimpl?wsdl
run the client test with the following java file:
import java.rmi.;
import javax.naming.;
import wstest.server.*;
import javax.xml.ws.Holder;
public class EchoClient {
public static void main(String[] args) {
EchoImplService service = new EchoImplService();
EchoImpl port = service.getPort(EchoImpl.class);
Holder h1 = new Holder("1");
Holder h2 = new Holder("2");
String result = port.holderOperation(h1, h2);
}
Will get:
null
11
22
Note:
Source: javaee/metro-jax-ws#1224
Author: LanceAndersen
The text was updated successfully, but these errors were encountered: