diff --git a/src/zutil/net/ws/WSMethodDef.java b/src/zutil/net/ws/WSMethodDef.java index b279fbd..942b6dd 100755 --- a/src/zutil/net/ws/WSMethodDef.java +++ b/src/zutil/net/ws/WSMethodDef.java @@ -108,8 +108,8 @@ public class WSMethodDef { else path = name; - if (path.startsWith("/")) - path = path.substring(1); + if (!path.startsWith("/")) + path = '/' + path; // ------------------------------------------------ // Handle inputs @@ -191,10 +191,17 @@ public class WSMethodDef { } /** - * @return the path to the WS method endpoint + * @return the relative path to the WS method endpoint */ public String getPath() { - return wsDef.getPath() + "/" + path; + return path; + } + + /** + * @return the path to the WS method endpoint + */ + public String getAbsolutePath() { + return wsDef.getPath() + path; } /** diff --git a/src/zutil/net/ws/soap/SOAPHttpPage.java b/src/zutil/net/ws/soap/SOAPHttpPage.java index 3c2d3ea..d8a5e58 100755 --- a/src/zutil/net/ws/soap/SOAPHttpPage.java +++ b/src/zutil/net/ws/soap/SOAPHttpPage.java @@ -291,7 +291,7 @@ public class SOAPHttpPage implements HttpPage{ // generate response XML if (outputParamDefs.size() > 0) { Element response = responseRoot.addElement(""); - response.addNamespace("m", methodDef.getPath() ); + response.addNamespace("m", methodDef.getAbsolutePath() ); response.setName("m:" + methodDef.getName() + "Response"); if (outputParams instanceof WSReturnObject) { @@ -307,7 +307,7 @@ public class SOAPHttpPage implements HttpPage{ } } else { - throw new NoSuchMethodException("Unable to find method: "+e.getQName().getName()+"!"); + throw new NoSuchMethodException("Unable to find method: " + e.getQName().getName() + "!"); } } } diff --git a/src/zutil/net/ws/wsdl/WSDLServiceSOAP.java b/src/zutil/net/ws/wsdl/WSDLServiceSOAP.java index cf9a906..25787e0 100644 --- a/src/zutil/net/ws/wsdl/WSDLServiceSOAP.java +++ b/src/zutil/net/ws/wsdl/WSDLServiceSOAP.java @@ -28,7 +28,7 @@ import org.dom4j.Element; import zutil.net.ws.WSMethodDef; /** - * User: Ziver + * A SOAP service generator for WSDL specification */ public class WSDLServiceSOAP extends WSDLService{ @@ -56,7 +56,7 @@ public class WSDLServiceSOAP extends WSDLService{ // definitions -> binding -> operation -> soap:operation Element soap_operation = operation.addElement("soap:operation"); - soap_operation.addAttribute("soapAction", method.getPath()); + soap_operation.addAttribute("soapAction", method.getAbsolutePath()); // ------------------------------------------------ // Input @@ -67,7 +67,7 @@ public class WSDLServiceSOAP extends WSDLService{ // definitions -> binding -> operation -> input -> body Element input_body = input.addElement("soap:body"); input_body.addAttribute("use", "literal"); - input_body.addAttribute("namespace", method.getPath()); + input_body.addAttribute("namespace", method.getAbsolutePath()); // ------------------------------------------------ // Output @@ -79,7 +79,7 @@ public class WSDLServiceSOAP extends WSDLService{ // definitions -> binding -> operation -> input -> body Element output_body = output.addElement("soap:body"); output_body.addAttribute("use", "literal"); - output_body.addAttribute("namespace", method.getPath()); + output_body.addAttribute("namespace", method.getAbsolutePath()); } } }