On Friday 11 January 2008, fox_lubiky wrote:
> The documentation
> (http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html) says you
> can provide your own binding factory:
 
Hm... I think that page is wrong.   The jaxws:binding points to a 
BindingConfiguration object.   It allows you to provide a bean that will 
be used to provide default configuration for the binding.   
Unfortunately, the binding name isn't one of them right now.   

I've just committed a change on trunk that would allow you to configure 
this.   If you create a bean of type 
org.apache.cxf.binding.soap.SoapBindingConfiguration, you should be able 
to set either the bindingName (type QName) or the bindingNamePrefix 
(String) property on it.     I'll try and get that merged into 2.0.4.

Dan


>
>   "You can specify the BindingFactory for this endpoint to use. This
> can be supplied using the Spring <bean
>   class="MyBindingFactory"/> syntax."
>
> Like this:
>
>               <jaxws:binding>
>                       <bean class='...MySoapBindingFactory'/>
>               </jaxws:binding>
>
> However, that gives the error:
>
>   Cannot convert value of type [demo.spring.NamedSoapBindingFactory]
> to required type
>   [org.apache.cxf.binding.BindingConfiguration] for property
> 'bindingConfig'
>
> Another possibility I'm considering is an interceptor that rewrites
> the WSDL returned to the client. Any suggestions on the correct way to
> handle this?
>
> Thanks,
>
> mnereson wrote:
> > Is there a way to override the binding name property?
> >
> > For example
> >
> >     <service xmlns="http://xfire.codehaus.org/config/1.0";>
> >         <name>MyFulfillmentService</name>
> >         <serviceClass>
> >             com.myco.myapp.MyFulfillmentServiceImpl
> >         </serviceClass>
> >         <serviceFactory>#jsr181ServiceFactory</serviceFactory>
> >     </service>
> >
> > Results in a binding named MyFulfillmentServiceHttpBinding
> >
> > The wsdl shows
> >
> > <wsdl:binding name="MyFulfillmentServiceHttpBinding"
> > type="tns:MyFulfillmentServicePortType">
> >    ...
> > </wsdl:binding>
> >
> > However, Our lightweight enterprise service bus requires the binding
> > name to be SomethingSoapBinding so I need
> > MyFulfillmentServiceSoapBinding.
> >
> > My current configuration uses annotations and resembles the
> > following:
> >
> > === services.xml ===
> >
> > <beans>
> >
> >     <bean name="jsr181ServiceFactory"
> >          
> > class="org.codehaus.xfire.annotations.AnnotationServiceFactory">
> >
> >         <constructor-arg ref="xfire.transportManager"
> >
> > type="org.codehaus.xfire.transport.TransportManager"
> >                          index="0"/>
> >
> >         <constructor-arg ref="config" index="1"
> >
> > type="org.codehaus.xfire.aegis.type.Configuration"/>
> >     </bean>
> >
> >     <bean id="config"
> > class="org.codehaus.xfire.aegis.type.Configuration"> <property
> > name="defaultNillable" value="true"/>
> >         <property name="defaultMinOccurs" value="1"/>
> >     </bean>
> >
> >     <service xmlns="http://xfire.codehaus.org/config/1.0";>
> >         <name>MyFulfillmentService</name>
> >         <serviceClass>
> >             com.myco.myapp.MtFulfillmentServiceImpl
> >         </serviceClass>
> >         <serviceFactory>#jsr181ServiceFactory</serviceFactory>
> >     </service>
> >
> >
> > </beans>
> >
> >
> > == web.xml ==
> >
> > <web-app>
> >
> >     <servlet>
> >         <servlet-name>XFireServlet</servlet-name>
> >         <display-name>XFire Servlet</display-name>
> >         <servlet-class>
> >            
> > org.codehaus.xfire.transport.http.XFireConfigurableServlet
> > </servlet-class>
> >     </servlet>
> >
> >     <servlet-mapping>
> >         <servlet-name>XFireServlet</servlet-name>
> >         <url-pattern>/services/*</url-pattern>
> >     </servlet-mapping>
> >
> > </web-app>
> >
> >
> > == excerpts RemoteFulfillmentServiceImpl.java ==
> >
> > import javax.jws.WebMethod;
> > import javax.jws.WebService;
> >
> > @WebService
> > public class MyFulfillmentServiceImpl implements
> > MyFulfillmentService {
> >
> >    // various private methods
> >
> >    @WebMethod
> >     public String soemPublicMethod(final int someId) {
> >        // maybe a couple lines of code
> >     }
> >
> > }
> >
> >
> > Thanks for the help.
> >
> > ~ mnereson



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to