Author: heiko.braun(a)jboss.com
Date: 2008-02-29 03:46:44 -0500 (Fri, 29 Feb 2008)
New Revision: 5859
Modified:
stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/RequestHandlerImpl.java
Log:
Implement WSDL request handling
Modified:
stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/RequestHandlerImpl.java
===================================================================
---
stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/RequestHandlerImpl.java 2008-02-29
08:46:10 UTC (rev 5858)
+++
stack/metro/trunk/src/main/java/org/jboss/wsf/stack/metro/RequestHandlerImpl.java 2008-02-29
08:46:44 UTC (rev 5859)
@@ -29,6 +29,7 @@
import org.jboss.wsf.spi.invocation.InvocationContext;
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.invocation.EndpointAssociation;
+import org.jboss.wsf.common.IOUtils;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -40,6 +41,7 @@
import java.io.OutputStream;
import java.io.Writer;
import java.util.Properties;
+import java.net.URL;
/**
* A request handler
@@ -196,7 +198,34 @@
public void handleWSDLRequest(Endpoint endpoint, OutputStream outStream,
InvocationContext context)
{
- throw new IllegalArgumentException("JBWS-1869: Not implemented");
+ InputStream inStream = null;
+
+ try
+ {
+ String epAddress = endpoint.getAddress();
+ if (epAddress == null)
+ throw new IllegalArgumentException("Invalid endpoint address: " +
epAddress);
+
+ URL wsdlUrl = new URL(epAddress + "?wsdl");
+ inStream = wsdlUrl.openStream();
+ IOUtils.copyStream(outStream, inStream);
+ }
+ catch (IOException e)
+ {
+ throw new WebServiceException("Failed to process WSDL request: " +
e.getMessage(), e);
+ }
+ finally
+ {
+ try
+ {
+ if(inStream!=null)inStream.close();
+ if(outStream!=null)outStream.close();
+ }
+ catch (IOException e)
+ {
+ //
+ }
+ }
}
/**
Show replies by date