[wsas-java-dev] svn commit r1217 - in trunk/wsas/java: .
modules/core/src/org/wso2/wsas/transport/util
svn at wso2.org
svn at wso2.org
Mon Mar 12 06:52:59 PDT 2007
Author: saminda
Date: Mon Mar 12 06:52:38 2007
New Revision: 1217
Modified:
trunk/wsas/java/modules/core/src/org/wso2/wsas/transport/util/HttpGetRequestProcessor.java
trunk/wsas/java/pom.xml
Log:
fixing a path problem
Modified: trunk/wsas/java/modules/core/src/org/wso2/wsas/transport/util/HttpGetRequestProcessor.java
==============================================================================
--- trunk/wsas/java/modules/core/src/org/wso2/wsas/transport/util/HttpGetRequestProcessor.java (original)
+++ trunk/wsas/java/modules/core/src/org/wso2/wsas/transport/util/HttpGetRequestProcessor.java Mon Mar 12 06:52:38 2007
@@ -144,6 +144,8 @@
response.setContentType("text/xml");
// Filter out the 'root' from serviceContextPath
String serviceContextPath = getServiceContextPath(configurationContext);
+ String contextRoot = request.getContextPath();
+
int index = serviceContextPath.lastIndexOf("/");
String servicePath = serviceContextPath.substring(index + 1,
@@ -152,7 +154,7 @@
ByteArrayOutputStream baos = new ByteArrayOutputStream();
axisService.printWSDL(baos, ip, servicePath);
- writeDocument(baos, outputStream,"annotated-wsdl.xsl");
+ writeDocument(baos, outputStream, "annotated-wsdl.xsl",contextRoot);
} else if (wsdlType == 1) {
axisService.printWSDL2(outputStream, ip, servicePath);
} else {
@@ -314,6 +316,7 @@
AxisService axisService =
configCtx.getAxisConfiguration().getServiceForActivation(serviceName);
OutputStream outputStream = response.getOutputStream();
+ String contextRoot = request.getContextPath();
if (axisService != null) {
if (!axisService.isActive()) {
response.setContentType("text/html");
@@ -329,7 +332,7 @@
response.setContentType("text/xml");
// Write to the output stream
- processSchema((XmlSchema) schemas.get(0), outputStream);
+ processSchema((XmlSchema) schemas.get(0), outputStream,contextRoot);
} else {
String idParam = request.getParameter("id");
@@ -337,7 +340,7 @@
XmlSchema schema = axisService.getSchema(Integer.parseInt(idParam));
if (schema != null) {
response.setContentType("text/xml");
- processSchema(schema, outputStream);
+ processSchema(schema, outputStream,contextRoot);
} else {
response.setContentType("text/html");
outputStream.write("<h4>Schema not found!</h4>".getBytes());
@@ -382,14 +385,15 @@
}
- private static void processSchema(XmlSchema schema, OutputStream outputStream) {
+ private static void processSchema(XmlSchema schema, OutputStream outputStream,
+ String contextRoot) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
schema.write(baos);
- writeDocument(baos, outputStream, "annotated-xsd.xsl");
+ writeDocument(baos, outputStream, "annotated-xsd.xsl", contextRoot);
}
private static void writeDocument(ByteArrayOutputStream byteArryaOutStream, OutputStream out,
- String annotatedXsl) {
+ String annotatedXsl, String contextRoot) {
XMLStreamWriter writer;
try {
@@ -404,7 +408,9 @@
createXMLStreamWriter(out);
if (annotatedXsl != null) {
writer.writeProcessingInstruction("xml-stylesheet",
- "type=\"text/xsl\" href=\"" + "/styles/" +
+ "type=\"text/xsl\" href=\"" +
+ contextRoot +
+ "/styles/" +
annotatedXsl + "\"");
}
Modified: trunk/wsas/java/pom.xml
==============================================================================
--- trunk/wsas/java/pom.xml (original)
+++ trunk/wsas/java/pom.xml Mon Mar 12 06:52:38 2007
@@ -214,6 +214,10 @@
<url>http://ws.zones.apache.org/repository</url>
<layout>legacy</layout>
</repository>
+ <repository>
+ <id>wso2-maven2-repository</id>
+ <url>http://dist.wso2.org/maven2</url>
+ </repository>
<!-- Others are available from http://repo1.maven.org/maven2 -->
</repositories>
More information about the Wsas-java-dev
mailing list