cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikolay Elenkov <n...@sarion.co.jp>
Subject Re: wrong targetNamespace in generated WSDL
Date Tue, 27 Apr 2010 01:46:37 GMT
On 2010/04/24 0:24, Daniel Kulp wrote:
> On Friday 23 April 2010 5:09:00 am Nikolay Elenkov wrote:
>> I am using apche-cxf 2.2.7, and I can't seem to find a way to set the
>> target namespace of the WSDL returned by Service?wsdl. It is always
>> http://www.springframework.org/schema/beans. See below:
>>
>> <wsdl:definitions name="MyService"
>> targetNamespace="http://www.springframework.org/schema/beans">
>> <wsdl:import
>> location="https://server/myws/services/MyService?wsdl=MyService.wsdl"
>> namespace="http://my.namespace.com/">
>>     </wsdl:import>
>>
>> The  namespace on the wsdl:import is correct, but not the one on
>> wsdl:definitions is not. I've set the namespace on my implementation class
>> with @WebService(targetNamespace="..."), but that seems to be ignored.
>> My service is defined in cxf-servlet.xml, but there seems to be no way
>> to pass the targetNamespace to <jaxws:endpoint> either. Am I missing
>> something obvious?
>>
>> Any hints are much appreciated.
> 
> Are you using an aop proxy or similar?   You may need to specify the 
> implementorClass attribute on the jaxws:endpoint so we can get the right class 
> and find the appropriate WebService annotation.
> 

I'm not using transactions, etc., but Spring may be creating a proxy. At any
rate, I have specified implementorClass (doesn't work without it) and still
getting a wrong targetNamespace. Here's my cxf-servlet.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">

	<context:annotation-config />

	<context:property-placeholder location="classpath:myservice-config.properties" />

	<bean id="myservice" class="com.namespace.my.MyServiceImpl" />

	<jaxws:endpoint id="ws" implementor="#myservice"
		serviceName="MyService" implementorClass="com.namespace.my.MyServiceImpl"
		address="/MyService" publishedEndpointUrl="${publishedEndpointUrl}" />

</beans>


Mime
View raw message