I have a webservice and a client setup (see below), when the client calls the
getEnvironment method from the server, the server code executes correctly
but then null is returned as the response to the client. Why?

{code:title=IEnvironment}
@WebService(name="EnvironmentServicePortType",
                
targetNamespace="http://service.environment.backend.app.company.com/";)
public interface IEnvironmentService {
        
        @WebMethod(operationName="getEnvironment")
        @WebResult(name="environment")
        public String getEnvironment();
        
}
{code}

{code:title=EnvironmentService}
@WebService(
                endpointInterface =
"com.company.app.backend.environment.client.IEnvironmentService")
public class EnvironmentService implements IEnvironmentService{
        
        public String getEnvironment() {
                ...
                return str;
        }
        
}
{code}

{code:title=EnvironmentServiceClient}
public class EnvironmentServiceClient 
extends Service
implements IEnvironmentService {
        
        public EnvironmentServiceClient(URL wsdlDocumentLocation,
                        QName serviceName) {
                super(wsdlDocumentLocation, serviceName);
        }
        
        public String getEnvironment() {
                IEnvironmentService service = 
getPort(IEnvironmentService.class);
                return service.getEnvironment();
        }
}
{code}

{code:title=Test Class}
        private final String urlPath = 
                "http://path/environment?wsdl";;
        private final QName name = new QName(
        
"http://service.environment.backend.app.company.com/","EnvironmentService";);

        public void testClient(){
                URL url = null;
                try {
                        url = new URL(urlPath);
                } catch (MalformedURLException e) {
                        fail(e.getMessage());
                }
                
                IEnvironment env = new EnvironmentServiceClient(url, name);
                String envResponse = env.getEnvironment();
                System.out.println(envResponse);
                assertEquals("jj", envResponse);
        }
{code}
-- 
View this message in context: 
http://cxf.547215.n5.nabble.com/javax-jws-Response-not-being-returned-tp3272699p3272699.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to