Author: dkulp
Date: Thu Sep 3 21:56:08 2009
New Revision: 811148
URL: http://svn.apache.org/viewvc?rev=811148&view=rev
Log:
[CXF-2419] Fix runtime problems with mismatch wsdl and jaxws frontend
Added:
cxf/trunk/testutils/src/main/resources/wsdl/hello_world_ref-options
cxf/trunk/testutils/src/main/resources/wsdl/hello_world_ref.wsdl (with
props)
Modified:
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/jaxws/Server.java
Modified:
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?rev=811148&r1=811147&r2=811148&view=diff
==============================================================================
---
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++
cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Thu Sep 3 21:56:08 2009
@@ -65,6 +65,7 @@
import org.apache.cxf.jaxws.interceptors.WebFaultOutInterceptor;
import org.apache.cxf.service.factory.AbstractServiceConfiguration;
import org.apache.cxf.service.factory.FactoryBeanListener;
+import org.apache.cxf.service.factory.FactoryBeanListener.Event;
import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
import org.apache.cxf.service.factory.ServiceConstructionException;
import org.apache.cxf.service.model.BindingInfo;
@@ -199,13 +200,15 @@
o.setProperty(METHOD, method);
initializeWrapping(o, method);
- bindOperation(o, method);
-
// rpc out-message-part-info class mapping
Operation op =
(Operation)o.getProperty(WSDLServiceBuilder.WSDL_OPERATION);
initializeClassInfo(o, method, op == null ? null
: CastUtils.cast(op.getParameterOrdering(), String.class));
+
+ bindOperation(o, method);
+
+ sendEvent(Event.INTERFACE_OPERATION_BOUND, o, method);
}
protected void bindOperation(OperationInfo op, Method method) {
Modified:
cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=811148&r1=811147&r2=811148&view=diff
==============================================================================
---
cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++
cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Thu Sep 3 21:56:08 2009
@@ -650,10 +650,10 @@
: CastUtils.cast(op.getParameterOrdering(), String.class))) {
bindOperation(o, method);
o.setProperty(ReflectionServiceFactoryBean.METHOD, method);
+ sendEvent(Event.INTERFACE_OPERATION_BOUND, o, method);
} else {
LOG.log(Level.WARNING, "NO_METHOD_FOR_OP", o.getName());
}
- sendEvent(Event.INTERFACE_OPERATION_BOUND, o, method);
}
/**
Modified:
cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java?rev=811148&r1=811147&r2=811148&view=diff
==============================================================================
---
cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
(original)
+++
cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
Thu Sep 3 21:56:08 2009
@@ -103,7 +103,13 @@
assertTrue("server did not launch correctly",
launchServer(Server.class));
}
-
+ @Test
+ public void testCXF2419() {
+ org.apache.cxf.hello_world.elrefs.SOAPService serv
+ = new org.apache.cxf.hello_world.elrefs.SOAPService();
+ assertEquals("Hello CXF", serv.getSoapPort().greetMe("CXF"));
+ }
+
@Test
public void testBase64() throws URISyntaxException {
URL wsdl =
getClass().getResource("/wsdl/others/dynamic_client_base64.wsdl");
Modified:
cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/jaxws/Server.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/jaxws/Server.java?rev=811148&r1=811147&r2=811148&view=diff
==============================================================================
---
cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/jaxws/Server.java
(original)
+++
cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/jaxws/Server.java
Thu Sep 3 21:56:08 2009
@@ -51,6 +51,10 @@
address = "http://localhost:9000/SoapContext/SoapPort";
Endpoint.publish(address, implementor);
+ implementor = new RefGreeterImpl();
+ address = "http://localhost:9000/SoapContext/SoapPort2";
+ Endpoint.publish(address, implementor);
+
//publish port with soap12 binding
address = "http://localhost:9009/SoapContext/SoapPort";
@@ -68,6 +72,7 @@
address = "http://localhost:9015/SoapContext/SoapPort";
Endpoint.publish(address, implementor);
}
+
@WebService(endpointInterface = "org.apache.hello_world_soap_http.Greeter",
targetNamespace = "http://apache.org/hello_world_soap_http")
public class Greeter12Impl extends BaseGreeterImpl {
@@ -86,7 +91,21 @@
}
}
-
+ @WebService(serviceName = "SOAPService",
+ portName = "SoapPort",
+ endpointInterface =
"org.apache.cxf.hello_world.elrefs.Greeter",
+ targetNamespace = "http://apache.org/hello_world_soap_http",
+ wsdlLocation = "testutils/hello_world_ref.wsdl")
+ public class RefGreeterImpl implements
org.apache.cxf.hello_world.elrefs.Greeter {
+ public String greetMe(String requestType) {
+ return "Hello " + requestType;
+ }
+
+ public String sayHi() {
+ return "hi";
+ }
+ }
+
@WebService(serviceName = "SOAPServiceBogusAddressTest",
portName = "SoapPort",
endpointInterface = "org.apache.hello_world_soap_http.Greeter",
Added: cxf/trunk/testutils/src/main/resources/wsdl/hello_world_ref-options
URL:
http://svn.apache.org/viewvc/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_ref-options?rev=811148&view=auto
==============================================================================
--- cxf/trunk/testutils/src/main/resources/wsdl/hello_world_ref-options (added)
+++ cxf/trunk/testutils/src/main/resources/wsdl/hello_world_ref-options Thu Sep
3 21:56:08 2009
@@ -0,0 +1,2 @@
+-p org.apache.cxf.hello_world.elrefs -allowElementReferences
+
Added: cxf/trunk/testutils/src/main/resources/wsdl/hello_world_ref.wsdl
URL:
http://svn.apache.org/viewvc/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_ref.wsdl?rev=811148&view=auto
==============================================================================
--- cxf/trunk/testutils/src/main/resources/wsdl/hello_world_ref.wsdl (added)
+++ cxf/trunk/testutils/src/main/resources/wsdl/hello_world_ref.wsdl Thu Sep 3
21:56:08 2009
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
contributor license
+ agreements. See the NOTICE file distributed with this work for additional
information regarding
+ copyright ownership. The ASF licenses this file to you under the Apache
License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
License. You may obtain
+ a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
required by
+ applicable law or agreed to in writing, software distributed under the
License is distributed on
+ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See
+ the License for the specific language governing permissions and
limitations under the License.
+ -->
+<wsdl:definitions name="HelloWorld"
targetNamespace="http://apache.org/hello_world_soap_http"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://apache.org/hello_world_soap_http"
xmlns:x1="http://apache.org/hello_world_soap_http/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <schema targetNamespace="http://apache.org/hello_world_soap_http/types"
xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://apache.org/hello_world_soap_http/types"
elementFormDefault="qualified">
+
+ <element name="requestType" type="tns:MyStringType" />
+
+ <simpleType name="MyStringType">
+ <restriction base="string">
+ <maxLength value="30" />
+ </restriction>
+ </simpleType>
+
+ <element name="sayHi">
+ <complexType />
+ </element>
+ <element name="sayHiResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMe">
+ <complexType>
+ <sequence>
+ <element ref="tns:requestType" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string" />
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="sayHiRequest">
+ <wsdl:part element="x1:sayHi" name="in" />
+ </wsdl:message>
+ <wsdl:message name="sayHiResponse">
+ <wsdl:part element="x1:sayHiResponse" name="out" />
+ </wsdl:message>
+ <wsdl:message name="greetMeRequest">
+ <wsdl:part element="x1:greetMe" name="in" />
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part element="x1:greetMeResponse" name="out" />
+ </wsdl:message>
+
+ <wsdl:portType name="Greeter">
+ <wsdl:operation name="sayHi">
+ <wsdl:input message="tns:sayHiRequest" name="sayHiRequest" />
+ <wsdl:output message="tns:sayHiResponse" name="sayHiResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMe">
+ <wsdl:input message="tns:greetMeRequest" name="greetMeRequest" />
+ <wsdl:output message="tns:greetMeResponse" name="greetMeResponse" />
+ </wsdl:operation>
+
+ </wsdl:portType>
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
+
+ <wsdl:operation name="sayHi">
+ <soap:operation soapAction="" style="document" />
+ <wsdl:input name="sayHiRequest">
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output name="sayHiResponse">
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMe">
+ <soap:operation soapAction="" style="document" />
+ <wsdl:input name="greetMeRequest">
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output name="greetMeResponse">
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SOAPService">
+ <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
+ <soap:address location="http://localhost:9000/SoapContext/SoapPort2" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+
Propchange: cxf/trunk/testutils/src/main/resources/wsdl/hello_world_ref.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/testutils/src/main/resources/wsdl/hello_world_ref.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/trunk/testutils/src/main/resources/wsdl/hello_world_ref.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml