Add sample @WebParam and targetNamespace definition
authorCarlos Aristu <carlos.aristu@openbravo.com>
Wed, 17 Apr 2019 18:04:19 +0200
changeset 43 6966aa90bd12
parent 42 962fb5f7a4ca
child 44 d93d03b5bffc
Add sample @WebParam and targetNamespace definition
src/org/openbravo/platform/features/service/soap/Calculator.java
src/org/openbravo/platform/features/service/soap/CalculatorImpl.java
--- a/src/org/openbravo/platform/features/service/soap/Calculator.java	Wed Apr 17 14:12:49 2019 +0200
+++ b/src/org/openbravo/platform/features/service/soap/Calculator.java	Wed Apr 17 18:04:19 2019 +0200
@@ -19,6 +19,7 @@
 package org.openbravo.platform.features.service.soap;
 
 import javax.jws.WebMethod;
+import javax.jws.WebParam;
 import javax.jws.WebService;
 
 /**
@@ -26,13 +27,13 @@
  * between a service and the consumers that make requests on it. The methods defined in this class
  * are intended to be mapped to the operations exposed by the service.
  */
-@WebService
+@WebService(targetNamespace = "http://soap.service.features.platform.openbravo.org")
 public interface Calculator {
 
   @WebMethod
-  public int sum(int val1, int val2);
+  public int sum(@WebParam(name = "sum1") int val1, @WebParam(name = "sum2") int val2);
 
   @WebMethod
-  public int multiply(int val1, int val2);
+  public int multiply(@WebParam(name = "mul1") int val1, @WebParam(name = "mul2") int val2);
 
 }
--- a/src/org/openbravo/platform/features/service/soap/CalculatorImpl.java	Wed Apr 17 14:12:49 2019 +0200
+++ b/src/org/openbravo/platform/features/service/soap/CalculatorImpl.java	Wed Apr 17 18:04:19 2019 +0200
@@ -7,7 +7,7 @@
 /**
  * This class is the service implementation of the {@link Calculator} class.
  */
-@WebService(endpointInterface = "org.openbravo.platform.features.service.soap.Calculator", portName = "calculator", serviceName = "calculator")
+@WebService(endpointInterface = "org.openbravo.platform.features.service.soap.Calculator", portName = "calculator", serviceName = "calculator", targetNamespace = "http://soap.service.features.platform.openbravo.org")
 public class CalculatorImpl implements Calculator, OBSingleton {
 
   @Override
@@ -17,7 +17,6 @@
 
   @Override
   public int multiply(int val1, int val2) {
-
     return val1 * val2;
   }
 }