Hello,
I'm trying to use WSDL2Java to write a client for WSRF services. When I
take the tutorial example from Apache WSRF <http://ws.apache.org/wsrf/>
(FileSystem.wsdl), not all the Java classes corresponding to the
response messages are generated.
(I must point out that I'm using Axis's WSDL2Java and not that of Apache
WSRF, as I want to handle the resource identifiers manually. Generating
a correct Java client from the WSDL file shouldn't be a problem).
Getting a resource property works (after using the right SOAP headers)
using something like this (for example):
GetResourcePropertyResponse property = port.getResourceProperty(new
QName("http://ws.apache.org/resource/example/filesystem","Comment"));
However, the QueryResourceProperties operation does not work.
This generates a fault:
faultString: org.xml.sax.SAXException: Deserializing parameter
'QueryResourcePropertiesResponse': could not find deserializer for type
{http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd}>QueryResourcePropertiesResponse
This seems "normal" since there is no class
QueryResourcePropertiesResponse generated by WSDL2Java.
Would somebody know why this class is not generated?
The other response classes are generated and seem to work fine, in
particular GetResourcePropertyResponse.
The bindings of these two operations (QueryResourceProperties and
GetResourceProperty) are very similar.
The portTypes are similar too:
<operation name="GetResourceProperty">
<input name="GetResourcePropertyRequest"
message="wsrpw:GetResourcePropertyRequest"/>
<output name="GetResourcePropertyResponse"
message="wsrpw:GetResourcePropertyResponse"/>
<fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/>
<fault name="InvalidResourcePropertyQNameFault"
message="wsrpw:InvalidResourcePropertyQNameFault"/>
</operation>
<operation name="QueryResourceProperties">
<input name="QueryResourcePropertiesRequest"
message="wsrpw:QueryResourcePropertiesRequest"/>
<output name="QueryResourcePropertiesResponse"
message="wsrpw:QueryResourcePropertiesResponse"/>
<fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/>
<fault name="InvalidResourcePropertyQNameFault"
message="wsrpw:InvalidResourcePropertyQNameFault"/>
<fault name="UnknownQueryExpressionDialectFault"
message="wsrpw:UnknownQueryExpressionDialectFault"/>
<fault name="InvalidQueryExpressionFault"
message="wsrpw:InvalidQueryExpressionFault"/>
<fault name="QueryEvaluationErrorFault"
message="wsrpw:QueryEvaluationErrorFault"/>
</operation>
Same for the messages:
<wsdl:message name="GetResourcePropertyResponse">
<wsdl:part name="GetResourcePropertyResponse"
element="wsrp:GetResourcePropertyResponse"/>
</wsdl:message>
<wsdl:message name="QueryResourcePropertiesResponse">
<wsdl:part name="QueryResourcePropertiesResponse"
element="wsrp:QueryResourcePropertiesResponse"/>
</wsdl:message>
Again, the types are similar:
<xsd:element name="GetResourcePropertyResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:any minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="QueryResourcePropertiesResponse">
<xsd:complexType>
<xsd:complexContent mixed="true">
<xsd:restriction base="xsd:anyType">
<xsd:sequence>
<xsd:any processContents="lax"
minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
However, the Java equivalent (java.rmi.Remote) differ, since the one for
QueryResourceProperties returns a simple Object, whereas the other one
return the appropriate Response type.
public
org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.GetResourcePropertyResponse
getResourceProperty(javax.xml.namespace.QName
getResourcePropertyRequest) /* throws ... */ ;
public java.lang.Object
queryResourceProperties(org.oasis_open.docs.wsrf._2004._06.wsrf_WS_ResourceProperties_1_2_draft_01_xsd.QueryResourceProperties
queryResourcePropertiesRequest) /* throws ... */ ;
I've tried with both Axis 1.2.1 and 1.3, using an ant script like this:
<taskdef name="wsdl2Java"
classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask"
classpath="..." />
<wsdl2Java verbose="true" url="FileSystem.wsdl" all="true" output="temp"
typemappingversion="1.2" nowrapped="true" />
I don't understand the difference of treatment between
GetResourceProperty and QueryResourceProperties. Could somebody point
out what I did wrong?
Thanks,
Bruno.