Author: chris.laprun(a)jboss.com
Date: 2007-03-03 14:23:42 -0500 (Sat, 03 Mar 2007)
New Revision: 6505
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
Log:
Revert to use openStream for BETA1.
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-03-03
19:22:03 UTC (rev 6504)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-03-03
19:23:42 UTC (rev 6505)
@@ -35,12 +35,9 @@
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLLocator;
import javax.xml.namespace.QName;
-import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.PrintStream;
import java.net.MalformedURLException;
-import java.net.Socket;
import java.net.URL;
import java.util.Collection;
import java.util.Iterator;
@@ -204,51 +201,17 @@
try
{
- int port = wsdlURL.getPort();
- boolean isSecure = false;
- // check if we use default ports
- if (port == -1)
- {
- port = wsdlURL.getDefaultPort();
- String protocol = wsdlURL.getProtocol();
- if ("https".equals(protocol))
- {
- isSecure = true;
- }
- else
- {
- throw new IllegalArgumentException("Unknown protocol: " +
protocol);
- }
- }
-
- String host = wsdlURL.getHost();
- Socket socket = new Socket(host, port);
- socket.setSoTimeout(1000);
-
- // Create a DataInputStream for reading from socket
- DataInputStream din = new DataInputStream(socket.getInputStream());
-
- // Create a PrintStream for writing to socket
- PrintStream pout = new PrintStream(socket.getOutputStream());
-
- // Print get request
- pout.print("GET " + wsdlURL.getFile() + " HTTP" +
(isSecure ? "S" : "") + "/1.1\n\n");
-
- InputStream is = Tools.safeBufferedWrapper(din);
+ InputStream is = Tools.safeBufferedWrapper(wsdlURL.openStream());
if (is == null)
{
- String message = "Cannot retrieve WSDL: '" + wsdlURL +
"' is not a valid URL.";
- log.info(message);
- throw new IllegalArgumentException(message);
+ throw new IllegalArgumentException("Cannot obtain wsdl from [" +
wsdlURL + "]");
}
return new InputSource(is);
}
catch (IOException e)
{
- String message = "Cannot access wsdl from [" + wsdlURL + "],
" + e.getMessage();
- log.info(message);
- throw new RuntimeException(message);
+ throw new RuntimeException("Cannot access wsdl from [" + wsdlURL +
"], " + e.getMessage());
}
finally
{
Show replies by date