Hello, has anyone successfully used XFire with XMLBeans bindings?  If so, 
can you post any guidelines? How to choose a target namespace for the XSD 
file, special XMLBeans options required, etc?

I'm trying to get this to work using Maven2 (and the XMLBeans Maven 
plugin) and have been unable to get a simple web service to work. (I had 
no trouble with the default bindings - I only started encountering 
problems when I introduced XMLBeans into the mix.)

I've gotten as far as being able to generate the XMLBeans, build the 
application, and deploy a WAR file to Tomcat. XFire generates WSDL which 
even includes the comments from my XSD file which is cool. However, if I 
try to invoke the web service via SoapUI I get errors about duplicate 
global types, and types not found:

Sat May 26 19:06:46 EDT 2007:WARN:Error: 
http://localhost:8080/cops-service-null/services/BaseServices?wsdl:0: 
error: sch-props-correct.2: Duplicate global type: 
[EMAIL PROTECTED]://schema.foo.com (Original global type found 
in file: 
http_3A_2F_2Flocalhost_3A8080_2Fcops_2Dservice_2Dnull_2Fservices/BaseServices_3Fwsdl)
Sat May 26 19:06:46 EDT 2007:WARN:Error: 
http://localhost:8080/cops-service-null/services/BaseServices?wsdl:0: 
error: sch-props-correct.2: Duplicate global type: 
[EMAIL PROTECTED]://schema.foo.com (Original global type found in 
file: 
http_3A_2F_2Flocalhost_3A8080_2Fcops_2Dservice_2Dnull_2Fservices/BaseServices_3Fwsdl)
...
Sat May 26 19:06:46 EDT 2007:WARN:Error: 
http://localhost:8080/cops-service-null/services/BaseServices?wsdl:0: 
error: src-resolve.a: Could not find type 
'[EMAIL PROTECTED]://schema.foo.com'. Do you mean to refer to the element 
with that name (in BaseServices_3Fwsdl)?

I am defining wrapped web service functions using only the Document 
XMLBeans types as arguments. Excerpt from my XSD file is below:

<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:cs="http://schema.foo.com"; elementFormDefault="qualified" 
targetNamespace="http://schema.foo.com";>

  <xs:element name="Principal">
    <xs:complexType>
      <xs:all>
        <xs:element name="PrincipalId" type="xs:integer"/>
        <xs:element name="Created" type="xs:dateTime" />
        <xs:element name="Login" type="xs:string"/>
        <xs:element name="FirstName" type="xs:string"/>
        <xs:element name="LastName" type="xs:string"/>
      </xs:all>
    </xs:complexType>
  </xs:element>

  ...
 
</xs:schema>

I am creating the xfire ServiceBean like this:

<?xml version="1.0" encoding="UTF-8"?>
<beans>

  <bean name="baseServices" class="org.codehaus.xfire.spring.ServiceBean">
    <property name="name" value="BaseServices" />
    <property name="namespace" value="http://service.foo.com"; />
    <property name="style" value="wrapped" />
    <property name="use" value="literal" />
    <property name="serviceClass" 
value="com.db.csb.endpoint.soap.IBaseServices" />
    <property name="serviceBean" ref="baseServicesImpl" />
    <property name="serviceFactory"><ref 
bean="xfire.xmlbeansServiceFactory"/></property>
    <property name="scope" value="application" />
    <property name="inHandlers"><list><ref bean="addressingHandler" 
/></list></property>
  </bean>

  <bean id="xfire.xmlbeansServiceFactory" 
class="org.codehaus.xfire.xmlbeans.XmlBeansServiceFactory" 
singleton="true">
    <constructor-arg index="0"><ref 
bean="xfire.transportManager"/></constructor-arg>
  </bean>
 
  <bean id="addressingHandler" 
class="org.codehaus.xfire.addressing.AddressingInHandler" />
  <bean id="baseServicesImpl" 
class="com.db.csb.endpoint.soap.BaseServicesImpl" />

</beans>

I tried enabling the namespace hack and that didn't seem to help.  The 
errors about duplicate types disappeared, but the "Could not find type" 
errors did not.

Can anyone provide an explanation of what might be happening, suggest a 
solution, suggest a schema namespace naming convention, or post a "hello 
world" recipe that works including XSD file and XFire Spring 
configuration?

Any help greatly appreciated. Thanks,
- Joe

-- 
Joe Morrison
Deutsche Bank, 60 Wall Street, 8th floor 
office: +1 (212) 250-8486        mobile: +1 (917) 952-2935


---

This e-mail may contain confidential and/or privileged information. If you 
are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.

Reply via email to