cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conficio <KajKand...@Conficio.com>
Subject Re: separate CXFServlet for private API's
Date Mon, 15 Nov 2010 16:32:45 GMT

Thank Daniel,
here is my sample, based of java first with spring support

/webapp/WEB-INF/beans-private.xml

<?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.
-->
<!-- START SNIPPET: beans -->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jaxws="http://cxf.apache.org/jaxws"
	xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

	<import resource="classpath:META-INF/cxf/cxf.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

	<jaxws:endpoint 
	  id="helloWorld" 
	  implementor="demo.spring.HelloWorldImpl" 
	  address="/HelloWorldPrivate" />
	  
</beans>
<!-- END SNIPPET: beans -->

/webapp/WEB-INF/beans.xml 

... as is ... 

/webapp/WEB-INF/empty.xml

<?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.
-->
<!-- START SNIPPET: beans -->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jaxws="http://cxf.apache.org/jaxws"
	xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

<!-- 
	<import resource="classpath:META-INF/cxf/cxf.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

	<jaxws:endpoint 
	  id="helloWorld" 
	  implementor="demo.spring.HelloWorldImpl" 
	  address="/HelloWorld" />
-->	  
</beans>
<!-- END SNIPPET: beans -->

/webapp/WEB-INF/web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<!--
	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.
-->
<!-- START SNIPPET: webxml -->
<web-app>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>WEB-INF/empty.xml</param-value>
	</context-param>
	<listener>
		<listener-class>
			org.springframework.web.context.ContextLoaderListener
		</listener-class>
	</listener>

	<servlet>
		<servlet-name>CXFServletPrivate</servlet-name>
		<display-name>CXF Servlet Private</display-name>
		<servlet-class>
			org.apache.cxf.transport.servlet.CXFServlet
		</servlet-class>
		<init-param>
      		<param-name>config-location</param-name>
      		<param-value>beans-private.xml</param-value>    
    	</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>CXFServletPrivate</servlet-name>
		<url-pattern>/private/*</url-pattern>
	</servlet-mapping>
	<servlet>
		<servlet-name>CXFServletPublic</servlet-name>
		<display-name>CXF Servlet Public</display-name>
		<servlet-class>
			org.apache.cxf.transport.servlet.CXFServlet
		</servlet-class>
		<init-param>
      		<param-name>config-location</param-name>
      		<param-value>beans.xml</param-value>    
    	</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>CXFServletPublic</servlet-name>
		<url-pattern>/public/*</url-pattern>
	</servlet-mapping>
</web-app>
<!-- END SNIPPET: webxml -->


I don't see the endless loop of loading those contexts in this simple Jetty
example (My app uses tomcat and a lot of other things, incl. spring 3.0)

But with this config I'd expect http://localhost:9002/public/ to present me
with the usual service list or http://localhost:9002/private/ for that
matter and also http://localhost:9002/public/HelloWorld?wsdl should present
the WSDL.

Let me know if I'm doing anything wrong here.

Kaj
P.S.: Even if I do simply config the public service in web.xml, I get no
services listed at http://localhost:9002/public/
-- 
View this message in context: http://cxf.547215.n5.nabble.com/separate-CXFServlet-for-private-API-s-tp3261355p3265972.html
Sent from the cxf-user mailing list archive at Nabble.com.

Mime
View raw message