With the attached WSDL, there are 2 problems
(Using AXIS Beta 2 , JDK 1.4, Win2k)
1. It doesnot generate any set/get() methods for Holder objects. This is the generated code.
public final class ArrayOfstringHolder implements javax.xml.rpc.holders.Holder {
public String[] value;
public ArrayOfstringHolder() {
}
public ArrayOfstringHolder(String[] value) {
this.value = value;
}
// ?++?
}
2. The return type is not correct (. The resp is expected to be int but it is not. I had to
do this to get around the problem ( I added the set/get method in the Holder objects)
TestServiceStub.java
// Put the resp in the holder object
holder.setValue ((String[]) resp);
/* AXIS BUG ???
try {
return ((Integer) resp).intValue();
} catch (java.lang.Exception e) {
return ((Integer) org.apache.axis.utils.JavaUtils.convert(resp,
int.class)).intValue();
}
*/
return 0;
The Apache Bugzilla (nagyoa.apache.org) site seems to be down.
Will be happy to provide more info.
thanks,
/prasanta
<?xml version='1.0'?> <wsdl:definitions name='TestService' targetNamespace='http://netscape.com/SOAP/test/service/' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:tns='http://netscape.com/SOAP/test/service/' xmlns:http='http://schemas.xmlsoap.org/wsdl/http/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:mime='http://schemas.xmlsoap.org/wsdl/mime/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'> <wsdl:types> <xsd:schema targetNamespace="http://netscape.com/SOAP/test/service/"> <xsd:complexType name="ArrayOfstring"> <xsd:complexContent> <xsd:restriction base="SOAP-ENC:Array"> <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="UserAttribute"> <xsd:sequence> <xsd:element name="value" type="xsd:string"/> <xsd:element name="name" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ArrayOfUserAttribute"> <xsd:complexContent> <xsd:restriction base="SOAP-ENC:Array"> <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:UserAttribute[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="TestUser"> <xsd:sequence> <xsd:element name="attributes" type="tns:ArrayOfUserAttribute"/> <xsd:element name="name" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ArrayOfTestUser"> <xsd:complexContent> <xsd:restriction base="SOAP-ENC:Array"> <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:TestUser[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> </xsd:schema> </wsdl:types> <wsdl:message name='TestService_getAllUsers_Request'> <wsdl:part name='group' type='xsd:string'/> <wsdl:part name='users' type='tns:ArrayOfTestUser'/> </wsdl:message> <wsdl:message name='TestService_getAllUsers_Response'> <wsdl:part name='response' type='xsd:int'/> <wsdl:part name='users' type='tns:ArrayOfTestUser'/> </wsdl:message> <wsdl:message name='TestService_getAllGroups_Request'> <wsdl:part name='groups' type='tns:ArrayOfstring'/> </wsdl:message> <wsdl:message name='TestService_getAllGroups_Response'> <wsdl:part name='response' type='xsd:int'/> <wsdl:part name='groups' type='tns:ArrayOfstring'/> </wsdl:message> <wsdl:message name='TestService_addGroup_Request'> <wsdl:part name='group' type='xsd:string'/> <wsdl:part name='nAttributes' type='xsd:int'/> <wsdl:part name='attributes' type='tns:ArrayOfstring'/> </wsdl:message> <wsdl:message name='TestService_addGroup_Response'> <wsdl:part name='response' type='xsd:int'/> </wsdl:message> <wsdl:portType name='TestService'> <wsdl:operation name='getAllGroups' parameterOrder='groups'> <wsdl:input name='getAllGroups' message='tns:TestService_getAllGroups_Request'/> <wsdl:output name='getAllGroups' message='tns:TestService_getAllGroups_Response'/> </wsdl:operation> <wsdl:operation name='getAllUsers' parameterOrder='group users'> <wsdl:input name='getAllUsers' message='tns:TestService_getAllUsers_Request'/> <wsdl:output name='getAllUsers' message='tns:TestService_getAllUsers_Response'/> </wsdl:operation> </wsdl:portType> <wsdl:binding name='TestService' type='tns:TestService'> <soap:binding transport='http://schemas.xmlsoap.org/soap/http' style='rpc'/> <wsdl:operation name='getAllGroups'> <soap:operation soapAction='' style='rpc'/> <wsdl:input name='getAllGroups'> <soap:body use='encoded' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' namespace='http://netscape.com/SOAP/test/service/TestService'/> </wsdl:input> <wsdl:output name='getAllGroups'> <soap:body use='encoded' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' namespace='http://netscape.com/SOAP/test/service/TestService'/> </wsdl:output> </wsdl:operation> <wsdl:operation name='getAllUsers'> <soap:operation soapAction='' style='rpc'/> <wsdl:input name='getAllUsers'> <soap:body use='encoded' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' namespace='http://netscape.com/SOAP/test/service/TestService'/> </wsdl:input> <wsdl:output name='getAllUsers'> <soap:body use='encoded' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' namespace='http://netscape.com/SOAP/test/service/TestService'/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name='JavaService'> <wsdl:port name='TestService' binding='tns:TestService'> <soap:address location='http://localhost:6070/TestService/'/> </wsdl:port> </wsdl:service> </wsdl:definitions>