Author: tejones
Date: 2009-04-27 12:49:34 -0400 (Mon, 27 Apr 2009)
New Revision: 845
Modified:
trunk/soap/src/main/java/com/metamatrix/soap/servlet/MMDiscoverWSDLServlet.java
trunk/soap/src/main/java/com/metamatrix/soap/servlet/MMGetVDBResourceServlet.java
trunk/soap/src/main/java/com/metamatrix/soap/servlet/MMGetWSDLServlet.java
Log:
TEIID-530 Modified import URL building to properly format for any WSDL creation scenario
(pre-configured or dynamic).
Modified: trunk/soap/src/main/java/com/metamatrix/soap/servlet/MMDiscoverWSDLServlet.java
===================================================================
---
trunk/soap/src/main/java/com/metamatrix/soap/servlet/MMDiscoverWSDLServlet.java 2009-04-27
02:01:23 UTC (rev 844)
+++
trunk/soap/src/main/java/com/metamatrix/soap/servlet/MMDiscoverWSDLServlet.java 2009-04-27
16:49:34 UTC (rev 845)
@@ -83,7 +83,7 @@
List wsdlUrls = WebServiceUtil.getWSDLUrls(req.getScheme(),
req.getServerName(),
Integer.toString(req.getServerPort()),
- req.getContextPath(),
+
getApplicationContext(req.getContextPath()),
WebServiceUtil.WSDLUSER,
WebServiceUtil.WSDLPASSWORD,
serverInfo);
Modified:
trunk/soap/src/main/java/com/metamatrix/soap/servlet/MMGetVDBResourceServlet.java
===================================================================
---
trunk/soap/src/main/java/com/metamatrix/soap/servlet/MMGetVDBResourceServlet.java 2009-04-27
02:01:23 UTC (rev 844)
+++
trunk/soap/src/main/java/com/metamatrix/soap/servlet/MMGetVDBResourceServlet.java 2009-04-27
16:49:34 UTC (rev 845)
@@ -214,16 +214,28 @@
* @param httpTypeString
* @return urlPrefix
*/
- private String buildUrlPrefix(HttpServletRequest req) {
+ protected String buildUrlPrefix(HttpServletRequest req) {
StringBuffer urlPrefix = new StringBuffer();
if (req.isSecure()){
-
urlPrefix.append(WSDLServletUtil.HTTPS).append("://").append(req.getServerName()).append(":").append(WSDLServletUtil.getHttpsPort());
//$NON-NLS-1$ //$NON-NLS-2$
+
urlPrefix.append(WSDLServletUtil.HTTPS).append("://").append(req.getServerName()).append(":").append(WSDLServletUtil.getHttpsPort()
+ "/"); //$NON-NLS-1$ //$NON-NLS-2$
}else{
-
urlPrefix.append(WSDLServletUtil.HTTP).append("://").append(req.getServerName()).append(":").append(WSDLServletUtil.getHttpPort());
//$NON-NLS-1$ //$NON-NLS-2$
- }
- urlPrefix.append(req.getContextPath());
+
urlPrefix.append(WSDLServletUtil.HTTP).append("://").append(req.getServerName()).append(":").append(WSDLServletUtil.getHttpPort()
+ "/"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ urlPrefix.append(getApplicationContext(req.getContextPath()));
+
return urlPrefix.toString();
- }
+ }
+
+ /**
+ * Returns the application context name value without slashes.
+ * @param context
+ * @return
+ */
+ public String getApplicationContext(String context) {
+
+ return context.replaceAll("/", "");
+ }
/**
* Get a JDBC connection. Will create a connection. It takes Userid, Password,
Modified: trunk/soap/src/main/java/com/metamatrix/soap/servlet/MMGetWSDLServlet.java
===================================================================
--- trunk/soap/src/main/java/com/metamatrix/soap/servlet/MMGetWSDLServlet.java 2009-04-27
02:01:23 UTC (rev 844)
+++ trunk/soap/src/main/java/com/metamatrix/soap/servlet/MMGetWSDLServlet.java 2009-04-27
16:49:34 UTC (rev 845)
@@ -146,11 +146,11 @@
serverProperties = new StringBuffer(
escapeAttributeEntities(serverProperties.toString()));
- StringBuffer urlPrefix = new StringBuffer();
- urlPrefix.append(webProtocol)
- .append("://").append(webServer).append(":").append(webPortInt);
//$NON-NLS-1$ //$NON-NLS-2$
+ String urlPrefix = new String();
+
+ urlPrefix = buildUrlPrefix(req);
- String servletPath = urlPrefix + "/" + WSDLServletUtil.SERVLET_PATH;
//$NON-NLS-1$
+ String servletPath = urlPrefix + WSDLServletUtil.SERVLET_PATH; //$NON-NLS-1$
String result = escapeAttributeEntities(suffix.toString());
Show replies by thread