Author: ningjiang
Date: Thu Sep 6 01:14:04 2007
New Revision: 573173
URL: http://svn.apache.org/viewvc?rev=573173&view=rev
Log:
CXF-974 added the serviceName and endpointName support
Modified:
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/schemas/jaxws.xsd
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java
incubator/cxf/trunk/rt/frontend/simple/src/main/resources/schemas/simple.xsd
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/clients.xml
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/servers.xml
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/jaxws-server.xml
Modified:
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java?rev=573173&r1=573172&r2=573173&view=diff
==============================================================================
---
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
(original)
+++
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
Thu Sep 6 01:14:04 2007
@@ -62,6 +62,7 @@
for (int i = 0; i < atts.getLength(); i++) {
Attr node = (Attr) atts.item(i);
String val = node.getValue();
+ String pre = node.getPrefix();
String name = node.getLocalName();
if ("createdFromAPI".equals(name)) {
@@ -70,7 +71,7 @@
bean.setAbstract(true);
} else if ("depends-on".equals(name)) {
bean.addDependsOn(val);
- } else if (!"id".equals(name) && !"name".equals(name)) {
+ } else if (!"id".equals(name) && !"name".equals(name) &&
isAttribute(pre, name)) {
if ("bus".equals(name)) {
if (val != null && val.trim().length() > 0
&& ctx.getRegistry().containsBeanDefinition(val)) {
Modified:
incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/schemas/jaxws.xsd
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/schemas/jaxws.xsd?rev=573173&r1=573172&r2=573173&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/schemas/jaxws.xsd
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/schemas/jaxws.xsd
Thu Sep 6 01:14:04 2007
@@ -91,6 +91,8 @@
<xsd:attribute name="start" type="xsd:boolean" default="true"/>
<xsd:attribute name="transportId" type="xsd:string"/>
<xsd:attribute name="wsdlLocation" type="xsd:string" />
+ <xsd:attribute name="endpointName" type="xsd:QName" />
+ <xsd:attribute name="serviceName" type="xsd:QName" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
@@ -117,7 +119,7 @@
<xsd:attribute name="bus" type="xsd:string" />
<xsd:attribute name="endpointName" type="xsd:QName" />
<xsd:attribute name="password" type="xsd:string" />
- <xsd:attribute name="serviceClass" type="xsd:QName" />
+ <xsd:attribute name="serviceClass" type="xsd:string" />
<xsd:attribute name="serviceName" type="xsd:QName" />
<xsd:attribute name="username" type="xsd:string" />
<xsd:attribute name="wsdlLocation" type="xsd:string" />
Modified:
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml?rev=573173&r1=573172&r2=573173&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml
(original)
+++
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml
Thu Sep 6 01:14:04 2007
@@ -55,7 +55,11 @@
<jaxws:server id="inlineInvoker"
serviceClass="org.apache.hello_world_soap_http.GreeterImpl"
address="http://localhost:8080/simpleWithAddress"
- bus="cxf" >
+ bus="cxf"
+ endpointName="e:HelloEndpointCustomized"
+ serviceName="s:HelloServiceCustomized"
+ xmlns:e="http://service.jaxws.cxf.apache.org/endpoint"
+ xmlns:s="http://service.jaxws.cxf.apache.org/service">
<jaxws:invoker>
<bean class="org.apache.cxf.service.invoker.BeanInvoker">
<constructor-arg>
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java?rev=573173&r1=573172&r2=573173&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java
Thu Sep 6 01:14:04 2007
@@ -68,6 +68,7 @@
private DestinationFactory destinationFactory;
private ReflectionServiceFactoryBean serviceFactory;
private QName endpointName;
+ private QName serviceName;
private Map<String, Object> properties;
private List<AbstractFeature> features;
private BindingConfiguration bindingConfig;
@@ -82,6 +83,10 @@
service = serviceFactory.create();
}
+ if (serviceName != null) {
+ serviceFactory.setServiceName(serviceName);
+ }
+
if (endpointName == null) {
endpointName = serviceFactory.getEndpointName();
}
@@ -364,6 +369,14 @@
public void setServiceFactory(ReflectionServiceFactoryBean serviceFactory)
{
this.serviceFactory = serviceFactory;
+ }
+
+ public void setServiceName(QName name) {
+ serviceName = name;
+ }
+
+ public QName getServiceName() {
+ return serviceName;
}
public QName getEndpointName() {
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java?rev=573173&r1=573172&r2=573173&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java
Thu Sep 6 01:14:04 2007
@@ -21,6 +21,8 @@
import java.util.List;
import java.util.Map;
+import javax.xml.namespace.QName;
+
import org.w3c.dom.Element;
import org.apache.cxf.common.util.StringUtils;
@@ -39,6 +41,16 @@
public ServerFactoryBeanDefinitionParser() {
super();
setBeanClass(ServerFactoryBean.class);
+ }
+
+ @Override
+ protected void mapAttribute(BeanDefinitionBuilder bean, Element e, String
name, String val) {
+ if ("endpointName".equals(name) || "serviceName".equals(name)) {
+ QName q = parseQName(e, val);
+ bean.addPropertyValue(name, q);
+ } else {
+ mapToProperty(bean, name, val);
+ }
}
@Override
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/main/resources/schemas/simple.xsd
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/resources/schemas/simple.xsd?rev=573173&r1=573172&r2=573173&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/main/resources/schemas/simple.xsd
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/main/resources/schemas/simple.xsd
Thu Sep 6 01:14:04 2007
@@ -59,6 +59,8 @@
<xsd:attribute name="start" type="xsd:boolean" default="true"/>
<xsd:attribute name="transportId" type="xsd:string"/>
<xsd:attribute name="wsdlLocation" type="xsd:string" />
+ <xsd:attribute name="endpointName" type="xsd:QName" />
+ <xsd:attribute name="serviceName" type="xsd:QName" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
@@ -85,7 +87,7 @@
<xsd:attribute name="bus" type="xsd:string" />
<xsd:attribute name="endpointName" type="xsd:QName" />
<xsd:attribute name="password" type="xsd:string" />
- <xsd:attribute name="serviceClass" type="xsd:QName" />
+ <xsd:attribute name="serviceClass" type="xsd:string" />
<xsd:attribute name="serviceName" type="xsd:QName" />
<xsd:attribute name="username" type="xsd:string" />
<xsd:attribute name="wsdlLocation" type="xsd:string" />
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java?rev=573173&r1=573172&r2=573173&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java
Thu Sep 6 01:14:04 2007
@@ -129,5 +129,8 @@
assertEquals("get the wrong bindingId",
clientProxyFactoryBean.getBindingId(),
"http://cxf.apache.org/bindings/xformat");
+
+ greeter = (HelloService) ctx.getBean("client2");
+ assertNotNull(greeter);
}
}
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/clients.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/clients.xml?rev=573173&r1=573172&r2=573173&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/clients.xml
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/clients.xml
Thu Sep 6 01:14:04 2007
@@ -70,6 +70,7 @@
address="http://localhost:9000/foo2"
serviceName="s:XMLService"
xmlns:s="http://apache.org/hello_world_soap_http"
+ endpointName="s:XMLPort"
bindingId="http://cxf.apache.org/bindings/xformat">
</simple:client>
</beans>
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/servers.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/servers.xml?rev=573173&r1=573172&r2=573173&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/servers.xml
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/servers.xml
Thu Sep 6 01:14:04 2007
@@ -73,7 +73,11 @@
<simple:server id="inlineSoapBinding"
serviceClass="org.apache.cxf.service.factory.HelloService"
- address="http://localhost:8080/test">
+ address="http://localhost:8080/test"
+ serviceName="t:HelloService"
+ xmlns:t="http://apache.org/hello_world_soap_http"
+ endpointName="t:HelloPort"
+ >
<simple:binding>
<soap:soapBinding mtomEnabled="true" version="1.2"/>
</simple:binding>
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/jaxws-server.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/jaxws-server.xml?rev=573173&r1=573172&r2=573173&view=diff
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/jaxws-server.xml
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/jaxws-server.xml
Thu Sep 6 01:14:04 2007
@@ -48,6 +48,10 @@
<jaxws:server
id="JaxwsHttpsEndpoint"
address="https://localhost:9002/SoapContext/HttpsPort"
+ serviceName="s:SOAPService"
+ endpointName="e:HttpsPort"
+ xmlns:e="http://apache.org/hello_world/services"
+ xmlns:s="http://apache.org/hello_world/services"
depends-on="port-9002-tls-config">
<jaxws:serviceBean>
<bean class="org.apache.cxf.systest.http.GreeterImpl"/>
@@ -55,7 +59,7 @@
</jaxws:server>
<!-- -->
- <!-- TLS Port configuration parameters for port 9001 -->
+ <!-- TLS Port configuration parameters for port 9002 -->
<!-- -->
<httpj:engine-factory id="port-9002-tls-config">
<httpj:engine port="9002">