I found the problem...but I think it might be a defect (or at least it
needs to be documented).  I found that the following code in the
ObjectServiceFactory.create(Class, String, String, Map) on lines 405 and
406 were causing the problem:

        if (theStyle.equals(SoapConstants.STYLE_WRAPPED))
            serviceInfo.setWrapped(true);

For some reason, when you use the standard
org.codehaus.xfire.transport.http.XFireConfigurableServlet, the
parameter the style parameter is set to "message" when using JAXB.
However, when using the org.codehaus.xfire.spring.XFireSpringServlet and
using JAXB2, the default value is "wrapped" which causes the problem I
identified in my previous email.  The only way to get around this is to
provide in your spring configuration a style property to your service as
such:

        <bean name="weatherService"
                class="org.codehaus.xfire.spring.ServiceBean">
                <property name="serviceBean" ref="weatherServiceImpl" />
                <property name="serviceFactory" ref="xfire.jaxbServiceFactory" 
/>
                <property name="style" value="message" />
                <property name="schemas">
                        <list>
                                <value>WeatherForecast.xsd</value>
                        </list>
                </property>
        </bean>

I'm not sure if this is a defect or not, but this seems a little
inconsistent.  I should be able to take the services configured in one
place application, drop it in another and it should work the same as
long as I'm using the same factories, annotations, etc.  No code or
schema was changed.  Any thoughts on this?

Thanks,
Eric Miles

On Fri, 2006-11-17 at 11:28 -0500, Eric Miles wrote:

> All,
> 
> I have taken the JAXB2 example and attempted to incorporate it into
> Spring 2.0.  I am having issues with WSDL generation as not only is
> the WSDL generator providing the types defined in the
> WeatherService.xsd, the generator is also adding a SECOND
> GetWeatherByZipCode and GetWeatherByZipCodeResponse elements to the
> schema.  Here is a snippet of the "extra" elements added (within the
> schema provided by the XSD):
> 
> <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> name="GetWeatherByZipCode"> 
> 
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element maxOccurs="1" minOccurs="1" ref="tns:GetWeatherByZipCode"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
> name="GetWeatherByZipCodeResponse">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element maxOccurs="1" minOccurs="1" 
> ref="tns:GetWeatherByZipCodeResponse"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> 
> I'm attaching the spring configuration (applicationContext.xml), web.xml, the 
> generated WSDL
> that is incorrect and the WSDL that is correct (from the example) both marked 
> bad and good respectively.  I
> have done nothing to the source or schema what so ever from the
> example, so I'm not including that.  I'm merely trying to configure
> these objects in a Spring 2.0 context.
> 
> Thanks for any help you can provide.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
> 
>     http://xircles.codehaus.org/manage_email

Reply via email to