Author: thomas.diesler(a)jboss.com
Date: 2007-10-16 08:21:30 -0400 (Tue, 16 Oct 2007)
New Revision: 4771
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
stack/native/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPConnectionTestCase.java
Log:
[JBWS-1802] RemotingConnectionImpl.addURLParameter() doesn't guarantee a URL as
expected by the JBossRemoting InvokerLocator
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-10-16
08:29:19 UTC (rev 4770)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-10-16
12:21:30 UTC (rev 4771)
@@ -207,11 +207,11 @@
}
}
- private String addURLParameter(String url, String key, String value)
+ private String addURLParameter(String urlStr, String key, String value) throws
MalformedURLException
{
- int qmIndex = url.indexOf("?");
- url += (qmIndex < 0 ? "?" : "&") + key + "=" +
value;
- return url;
+ URL url = new URL(urlStr);
+ urlStr += (url.getQuery() == null ? "?" : "&") + key +
"=" + value;
+ return urlStr;
}
private Client createRemotingClient(Object endpoint, String targetAddress, boolean
oneway)
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPConnectionTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPConnectionTestCase.java 2007-10-16
08:29:19 UTC (rev 4770)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/common/soap/SOAPConnectionTestCase.java 2007-10-16
12:21:30 UTC (rev 4771)
@@ -31,6 +31,7 @@
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
@@ -65,6 +66,27 @@
runEndpointTest(new URL(TARGET_ENDPOINT_ADDRESS));
}
+ // [JBWS-1802] RemotingConnectionImpl.addURLParameter() doesn't guarantee a URL as
expected by the JBossRemoting InvokerLocator
+ public void testNullContext() throws Exception
+ {
+ SOAPMessage request = buildValidMessage();
+ SOAPConnection connection =
SOAPConnectionFactory.newInstance().createConnection();
+ try
+ {
+ connection.call(request, "http://" + getServerHost() +
":8080");
+ }
+ catch (Exception ex)
+ {
+ while (ex != null)
+ {
+ if(ex instanceof SOAPException &&
ex.getMessage().equals("Unsupported content type: text/html"))
+ break;
+ else
+ ex = (Exception)ex.getCause();
+ }
+ }
+ }
+
private void runEndpointTest(Object endPoint) throws Exception
{
SOAPMessage request = buildValidMessage();
Show replies by date