Warning produced by com.sun.tools.ws.ant.WsImport when importing wsdl generated 
by xfire 
-----------------------------------------------------------------------------------------

                 Key: XFIRE-860
                 URL: http://jira.codehaus.org/browse/XFIRE-860
             Project: XFire
          Issue Type: Bug
          Components: JAXB 2.0
    Affects Versions: 1.2.4
         Environment: Windows XP, Bea Weblogic 9.2
            Reporter: Matthew Eanor
         Assigned To: Dan Diephouse
            Priority: Minor
         Attachments: buggy_wsdl.xml

The following warning message is produced by com.sun.tools.ws.ant.WsImport when 
importing wsdl generated by xfire running on Bea Weblogic 9.2. I am using the 
jaxb service factory to permit polymorphism on the client side.

warning: s4s-att-invalid-value: Invalid attribute value for 'type' in element 
'element'. Recorded reason: UndeclaredPrefix: Cannot resolve 'ns4:DogTO' as a 
QName: the prefix 'ns4' is not declared.
  line ? of 
http://127.0.0.1:7001/TestApp2/services/HelloService?wsdl#types?schema1

This warning can be reproduced by creating a base class and a subclass of this 
class. In the subclass, there should be a list or map with type arguments that 
are not Object, String, or some other type that can map to elements in the xs 
namespace. Importing the wsdl generated by xfire using WsImport should produce 
a similar warning message.

The sample wsdl extract below has been generated from the derived class 
KennelsTO which derives from the BuildingTO class, and provides methods for 
accessing a List of DogTO objects. (This is a sample to demonstate the issue, 
so bear with the dubious class names)
{{
<xs:complexType name="KennelsTO">
<xs:complexContent>
<xs:extension xmlns:ns4="urn:test:matt" base="ns4:BuildingTO">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="dogs" nillable="true" 
type="ns4:DogTO"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType abstract="true" name="BuildingTO"/>
<xs:complexType name="DogTO">
<xs:sequence>
<xs:element minOccurs="0" name="ID" type="xs:string"/>
</xs:sequence>
</xs:complexType>
}}

I have included the source files that the wsdl is generated from and the 
services xml file below, and attached the complete wsdl generated by xfire.

There do not seem to be any side effects in the generated classes as a result 
of this warning, but would appreciate any comments as to why the wsdl is 
causing these warnings and if there is any way to suppress them. 

Thanks,
Matt


services.xml

<beans xmlns="http://xfire.codehaus.org/config/1.0";>
<service>
  <serviceClass>matt.test.MyServiceImpl</serviceClass>
  <serviceFactory>org.codehaus.xfire.jaxb2.JaxbServiceFactory</serviceFactory>
</service>
</beans>


The sample classes below were used to generate the attached wsdl.


MyServiceImpl.java

package matt.test;
import java.util.Collections;
import javax.jws.*;
import javax.jws.soap.SOAPBinding;
import java.util.*;

@WebService(name="Hello", serviceName="HelloService", 
targetNamespace="http://example.com";)
@SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.BARE, 
style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL)
public class MyServiceImpl {  
    
    private static final KennelsTO myKennels = new KennelsTO();
    
    @javax.jws.WebMethod
    @javax.jws.WebResult(partName="parameters")
    public FindKennelsResponse 
findKennelsEntry(@javax.jws.WebParam(partName="parameters")FindKennelsRequest 
request) {
        FindKennelsResponse resp = new FindKennelsResponse();
        resp.setResult(myKennels);
        return resp;
    } 
    
    public MyServiceImpl() {
    }
}


FindKennelsRequest.java
package matt.test;
@javax.xml.bind.annotation.XmlAccessorType(javax.xml.bind.annotation.XmlAccessType.FIELD)
@javax.xml.bind.annotation.XmlType(name = "findKennelsRequest", propOrder = 
{"identity"}, namespace="urn:test:matt")
@javax.xml.bind.annotation.XmlRootElement (name="findKennelsRequest", 
namespace="urn:test:matt")    

public class FindKennelsRequest {
    private java.util.UUID identity;
    
    public java.util.UUID getIdentity() {
        return identity;
    }
    public void setIdentity(java.util.UUID identity) {
        this.identity = identity;
    }
}

FindKennelsResponse.java
package matt.test;
@javax.xml.bind.annotation.XmlAccessorType(javax.xml.bind.annotation.XmlAccessType.FIELD)
@javax.xml.bind.annotation.XmlType( name = "findKennelsResponse", propOrder = { 
"result" }, namespace="urn:test:matt")
@javax.xml.bind.annotation.XmlRootElement( name="findKennelsResponse", 
namespace="urn:test:matt")
public class FindKennelsResponse {
    private KennelsTO result;
    public KennelsTO getResult() {
        return result;
    }
    public void setResult(KennelsTO result) {
        this.result = result;
    }        
}


KennelsTO.java
package matt.test;
@javax.xml.bind.annotation.XmlType(name="KennelsTO", namespace="urn:test:matt")

public class KennelsTO extends BuildingTO {    
    private java.util.List<DogTO> dogs;
    
    public java.util.List<DogTO> getDogs() {
        return dogs;
    }   
    
    public void setDogs(java.util.List<DogTO> dogs) {
        this.dogs = dogs;
    }      
}


BuildingTO.java
package matt.test;
@javax.xml.bind.annotation.XmlType(name="BuildingTO", namespace="urn:test:matt")
public abstract class BuildingTO {
   
}


DogTO.java
package matt.test;
@javax.xml.bind.annotation.XmlType(name="DogTO", namespace="urn:test:matt")
public class DogTO {
    private java.util.UUID id;
    public java.util.UUID getID() {
        return id;
    }
    public void setID(java.util.UUID id) {
          this.id = id;          
    }        
}


ant build script
    <target name="clientxfire">
        <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
            <classpath path="${javac.classpath}"/>          
        </taskdef>
        <wsimport
            debug="true"
            keep="true"
            destdir="test"
            package="matt.gen.xfire"
            wsdl="http://127.0.0.1:7001/TestApp2/services/HelloService?wsdl";
            />
    </target>    




-- 
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