[ 
http://jira.codehaus.org/browse/XFIRE-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_90874
 ] 

Marcelo Krebber commented on XFIRE-923:
---------------------------------------

I have written a small fix for this problem. Just added a new constructor to 
the AnnotationServicefactory to take a binding provider as:

 public AnnotationServiceFactory(TransportManager transportManager,
                        BindingProvider provider){
                
                        super(transportManager, provider);
                this.webAnnotations = getAnnotations();
                
                AnnotationServiceConfiguration annotationConfig = new 
AnnotationServiceConfiguration();
                annotationConfig.setWebAnnotations(webAnnotations);
                annotationConfig.setServiceFactory(this);
                getServiceConfigurations().add(0, annotationConfig);
        }

after that, just updated services.xml with smthg. like:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xfire.codehaus.org/config/1.0";>
<service>
    <serviceClass>mysample.service.SampleServiceImpl</serviceClass>
     <serviceFactory>#myfix.jsr181</serviceFactory>
    <!--<serviceFactory>jsr181</serviceFactory>-->
  </service>
  
  <bean id="myfix.aegisTypeConfiguration" 
class="org.codehaus.xfire.aegis.type.Configuration">
         <property name="defaultExtensibleElements" value="false"/>
         <property name="defaultExtensibleAttributes" value="false"/>
         <property name="defaultNillable" value="false"/>
     <property name="defaultMinOccurs" value="1"/>
  </bean>

  <bean id="myfix.typeMappingRegistry"
    class="org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry" 
        init-method="createDefaultMappings" singleton="true">
      <property name="configuration" ref="myfix.aegisTypeConfiguration"/>
  </bean>

  <bean id="myfix.aegisBindingProvider"
    class="org.codehaus.xfire.aegis.AegisBindingProvider"
    singleton="true">
    <constructor-arg index="0" ref="myfix.typeMappingRegistry" />
  </bean>
  
  <bean id="myfix.jsr181"
    class="mysample.service.AnnotationServiceFactory">
    <constructor-arg index="0" ref="xfire.transportManager" />
    <constructor-arg index="1" ref="myfix.aegisBindingProvider" />
  </bean>
  
</beans>


after that, clients generated with wsgen produce objects without cumbersome 
jaxb codings, which is what we wanted in the first place.

marcelo

> Services using Annotations are not generating correctly the WSDL when using a 
> Configuration bean for minOCcurs=1
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: XFIRE-923
>                 URL: http://jira.codehaus.org/browse/XFIRE-923
>             Project: XFire
>          Issue Type: Bug
>          Components: Aegis Module
>    Affects Versions: 1.2.4
>         Environment: Window
>            Reporter: Marcelo Krebber
>         Assigned To: Dan Diephouse
>
> There is a documented fix for configuring xfire to avoid the minOcccurs=0 in 
> the generated WSDL. this is being ignored when using annotations to generate 
> the service. xfir.xml updated as follows:
>       <!-- changed  -->
>   <import resource="classpath:org/codehaus/xfire/spring/customEditors.xml"/>
>   
>   <!-- addded  -->
>   <bean id="new.aegisTypeConfiguration" 
> class="org.codehaus.xfire.aegis.type.Configuration">
>        <property name="defaultExtensibleElements" value="false"/>
>        <property name="defaultExtensibleAttributes" value="false"/>
>        <property name="defaultNillable" value="false"/>
>      <property name="defaultMinOccurs" value="1"/>
>   </bean>
> <bean id="xfire.typeMappingRegistry"
>     class="org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry" 
>       init-method="createDefaultMappings" singleton="true">
>       <property name="configuration" ref="new.aegisTypeConfiguration"/>
>   </bean>
> when using JSR181 as the service factory, the configuration is not being 
> delegated correctly to the factory, and default configuration is used, that 
> is minoccurs is 0!! this is an important isue when generating clients from a 
> wsdl in order to avoid cumbersome jaxb codings.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to