[ 
https://issues.apache.org/jira/browse/CXF-776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512396
 ] 

Freeman Fang commented on CXF-776:
----------------------------------

Hi Jan,
For servlet, you also need inject serviceFactory in jaxws:endpoint, so the 
spring context should be

<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" />
        <bean id="serviceClass" class="demo.spring.HelloWorldImpl"/>
        <bean id="aegisDatabinding"
              class="org.apache.cxf.aegis.databinding.AegisDatabinding"/>
        <bean id="serviceFactory"
              class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
                <property name="dataBinding" ref="aegisDatabinding"/>
        </bean>
        <bean id="serverBeanFactory" 
class="org.apache.cxf.frontend.ServerFactoryBean"
              init-method="create">
                <property name="address" value="/HelloWorld"/>
                <property name="bindingId" 
value="http://schemas.xmlsoap.org/soap/"/>
                <property name="serviceBean" ref="serviceClass"/>
                <property name="serviceFactory" ref="serviceFactory"/>
        </bean>
        <jaxws:endpoint
          id="helloWorld"
          implementor="demo.spring.HelloWorldImpl"
          address="/HelloWorld">
          <jaxws:serviceFactory>
             <ref bean="serviceFactory"/>
          </jaxws:serviceFactory>
        </jaxws:endpoint>

</beans>

And the attachment is spring_http demo which I change slightly to use aegis 
databinding in spring context, and it works by my test.

> JaxWsServiceFactoryBean doesn't seem to work with AegisDatabinding
> ------------------------------------------------------------------
>
>                 Key: CXF-776
>                 URL: https://issues.apache.org/jira/browse/CXF-776
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.0.1
>         Environment: CXFServlet, resin 3.1.1, JDK 1.6
>            Reporter: Jan Kriesten
>         Attachments: spring.tar
>
>
> There really seems to be an issue with JaxWsServiceFactoryBean and Aegis.
> I tried the following configuration (CXFServlet):
> ---8<---
>   <bean id="serviceClass" 
> class="de.footprint.www.services.auth.AcegiAuthService"/>
>   <bean id="aegisDatabinding"
> class="org.apache.cxf.aegis.databinding.AegisDatabinding"/>
>   <bean id="serviceFactory"
> class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
>   <property name="dataBinding" ref="aegisDatabinding"/>
>   </bean>
>   <bean id="serverBeanFactory" 
> class="org.apache.cxf.frontend.ServerFactoryBean"
> init-method="create">
>           <property name="address" value="/AuthService"/>
>           <property name="bindingId" 
> value="http://schemas.xmlsoap.org/soap/"/>
>           <property name="serviceBean" ref="serviceClass"/>
>           <property name="serviceFactory" ref="serviceFactory"/>
>   </bean>
> ---8<---
> This did _not_ work. The services-log tells me, that the WebService-Parameters
> are blank (btw, only Strings are used). Commenting out the 
> dataBinding-property
> in the serviceFactory-bean solves it again - all parameters are ok!
> My client looks like this:
> ---8<---
> Bus bus = new SpringBusFactory().createBus();
> AegisDatabinding aegisBinding = new AegisDatabinding();
> JaxWsProxyFactoryBean proxyBean = new JaxWsProxyFactoryBean();
> proxyBean.setBus( bus );
> proxyBean.getServiceFactory().setDataBinding( aegisBinding );
> proxyBean.setAddress( "http://localhost/service/AuthService"; );
> proxyBean.setServiceClass( IAuthService.class );
> service = (IAuthService) proxyBean.create();
> ---8<---
> If you need any more information just drop me a note... :-)
> Best regards, --- Jan.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to