Hi Ulhas,

As I talked to Willem, it turns out that the "addr" is not the absoulte path url, it is the relative url.
that's why we might have the "addr" as an empty string.

Say I published an endpoint at the http://localhost:9999/GreeterBean address. at this scenario, the addr is an empty string. and if I execute the "http://localhost:9999/GreeterBean?wsdl"; in the browser, I will get an exception. but if I execute the "http://localhost:9999/GreeterBean/?wsdl";, I will get the correct wsdl.

Thanks
Jeff

Bhole, Ulhas wrote:
Hi Jeff,

Thanks for pointing out the null check requirement. Can you please
explain how the wsdl or xsd will be queried in the scenario you
expecting the address to be null? In normal scenario the WSDL query is
<http-address>?wsdl how would it look like in case of jca?
Regards,

Ulhas Bhole

-----Original Message-----
From: Jeff Yu [mailto:[EMAIL PROTECTED] Sent: 18 October 2007 12:16
To: [email protected]
Cc: [EMAIL PROTECTED]
Subject: Re: svn commit: r585445 - in /incubator/cxf/trunk:
rt/core/src/main/java/org/apache/cxf/transport/http/
rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jet
ty/ systests/src/test/java/org/apache/cxf/systest/factory_pattern/

Hi,

See one comment inline.

Thanks
Jeff

[EMAIL PROTECTED] wrote:
Author: ulhasbhole
Date: Wed Oct 17 03:57:01 2007
New Revision: 585445

URL: http://svn.apache.org/viewvc?rev=585445&view=rev
Log:
* Fix for JIRA CXF-1113 related to WSDLPublish and Default Servant.

Modified:

incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/
WSDLQueryHandler.java
incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cx
f/transport/http_jetty/JettyHTTPDestination.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/factor
y_pattern/MultiplexHttpAddressClientServerTest.java
Modified:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/
WSDLQueryHandler.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/o
rg/apache/cxf/transport/http/WSDLQueryHandler.java?rev=585445&r1=585444&
r2=585445&view=diff
========================================================================
======
---
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/
WSDLQueryHandler.java (original)
+++
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/
WSDLQueryHandler.java Wed Oct 17 03:57:01 2007
@@ -358,7 +358,7 @@
             baseURI = url.getPath();
             int idx = baseURI.lastIndexOf('/');
             if (idx != -1) {
-                baseURI = baseURI.substring(0, idx + 1);
+                baseURI = baseURI.substring(0, idx);
             }
} return baseURI;

Modified:
incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cx
f/transport/http_jetty/JettyHTTPDestination.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jett
y/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination
.java?rev=585445&r1=585444&r2=585445&view=diff
========================================================================
======
---
incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cx
f/transport/http_jetty/JettyHTTPDestination.java (original)
+++
incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cx
f/transport/http_jetty/JettyHTTPDestination.java Wed Oct 17 03:57:01
2007
@@ -173,13 +173,21 @@
         }
     }
- private synchronized void updateEndpointAddress(String addr) {
+    private String removeTrailingSeparator(String addr) {
+        if (addr.lastIndexOf('/') == addr.length() - 1) {
+            return addr.substring(0, addr.length() - 1);
+        } else {
+            return addr;
+        }
+    }
I am not sure should the "addr" always be not null and not an empty string, but in the jca inbound case, the addr is an *Empty String*, and then I will get the below exception:

 java.lang.StringIndexOutOfBoundsException: String index out of range:
-1

So I add a null check here * if (addr != null && !"".equals(addr) && addr.lastIndexOf("/" == addr.length() - 1) * as a work around... Do we need a null check here?



Reply via email to