I just sent my services.xml and here's my client code. That's all. It's the most basic way of creating a webservice, right?

Just to make clear: everything works fine apart from returning an Array or List. So the Spring connection and returning a string works good.

      ...
       DialogueServiceStub stub = new DialogueServiceStub();
DialogueServiceStub.GetDatabases getDatabases = new DialogueServiceStub.GetDatabases(); AuthInfo authInfo = new AuthInfo();
       authInfo.setOrganization("haralds company");
       authInfo.setUserName("[EMAIL PROTECTED]");
       authInfo.setPassword("Ronald1");
       getDatabases.setAuthInfo(authInfo);
DialogueServiceStub.GetDatabasesResponse response = stub.getDatabases(getDatabases);
       for (ContactDatabaseInfo databaseInfo : response.get_return())
       {
           System.out.println("db name: " + databaseInfo.getName());
       }
      ...

Ronald

Deepal Jayasinghe wrote:
Hi Ronald ;

Can you please attach other relevant code as well the client code .

Thanks
Deepal

Absolutely, thanks for the quick reply!

This is my service operation:

    public List<ContactDatabaseInfo> getDatabases(AuthInfo authInfo)
    {
        ClientDomain client =
clientDomainManager.findByLabel(authInfo.getOrganization());
        if (client == null) {
            throw new TripolisSecurityException("client not found");
        }
User user =
userManager.findByNameAndClientDomainId(authInfo.getUserName(),
client.getId());
        if (user == null) {
            throw new TripolisSecurityException("user not found");
        }
List<ContactDatabase> databases =
contactDatabaseManager.findByClientDomain(client.getId());
        ArrayList<ContactDatabaseInfo> databaseInfos = new
ArrayList<ContactDatabaseInfo>();
for (ContactDatabase database : databases) {
            databaseInfos.add(
                    new ContactDatabaseInfo(
                            database.getId().getEncryptedStringValue(),
                            database.getName()
                    )
            );
        }
        return databaseInfos;
    }

Note: The returning of an actual ArrayList I got from a posting on the
mailing list. Before I tried to return an Array and a List of
ContactDatabaseInfo objects.

With the use of Spring I have public setters in my service class
(managers that are injected) which are exposed in the generated wsdl,
so I use a custom wsdl where I removed these sertters:

<wsdl:definitions
        xmlns:axis2="http://services.tripolis.com";
        xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
        xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
        xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/";
        xmlns:ns0="http://model.services.tripolis.com/xsd";
        xmlns:ns1="http://security.business.tripolis.com/xsd";
        xmlns:ns3="http://datamanager.contact.business.tripolis.com/xsd";
        xmlns:ns2="http://services.tripolis.com/xsd";
        xmlns:xs="http://www.w3.org/2001/XMLSchema";
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
        targetNamespace="http://services.tripolis.com";>
<wsdl:documentation>Prototype of the dialogue
service</wsdl:documentation>
    <wsdl:types>
<xs:schema xmlns:ax22="http://model.services.tripolis.com/xsd";
targetNamespace="http://model.services.tripolis.com/xsd";
attributeFormDefault="qualified" elementFormDefault="qualified">
            <xs:element name="AuthInfo" type="ax22:AuthInfo" />
            <xs:complexType name="AuthInfo">
                <xs:sequence>
                    <xs:element name="organization" type="xs:string"
nillable="true" />
                    <xs:element name="userName" type="xs:string"
nillable="true" />
                    <xs:element name="password" type="xs:string"
nillable="true" />
                </xs:sequence>
            </xs:complexType>
            <xs:element name="ContactDatabaseInfo"
type="ax22:ContactDatabaseInfo" />
            <xs:complexType name="ContactDatabaseInfo">
                <xs:sequence>
                    <xs:element name="id" type="xs:string"
nillable="true" />
                    <xs:element name="name" type="xs:string"
nillable="true" />
                    <xs:element name="fieldDescriptors"
maxOccurs="unbounded" type="xs:string" nillable="true" />
                    <xs:element name="fieldGroups"
maxOccurs="unbounded" type="xs:string" nillable="true" />
                    <xs:element name="defaultFieldGroupId"
type="xs:string" nillable="true" />
                </xs:sequence>
            </xs:complexType>
        </xs:schema>
<xs:schema xmlns:ns="http://services.tripolis.com/xsd";
targetNamespace="http://services.tripolis.com/xsd";
attributeFormDefault="qualified" elementFormDefault="qualified">
            <xs:element name="getDatabases">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="authInfo"
type="ns0:AuthInfo" nillable="true" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="getDatabasesResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="return"
maxOccurs="unbounded" type="ns0:ContactDatabaseInfo" nillable="true" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:schema>
    </wsdl:types>
<wsdl:message name="getDatabasesMessage">
        <wsdl:part name="part1" element="ns2:getDatabases" />
    </wsdl:message>
    <wsdl:message name="getDatabasesResponse">
        <wsdl:part name="part1" element="ns2:getDatabasesResponse" />
    </wsdl:message>

    <wsdl:portType name="DialogueServicePortType">
        <wsdl:operation name="getDatabases">
            <wsdl:input
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl";
message="axis2:getDatabasesMessage" wsaw:Action="urn:getDatabases" />
            <wsdl:output message="axis2:getDatabasesResponse" />
        </wsdl:operation>
    </wsdl:portType>

    <wsdl:binding name="DialogueServiceSOAP11Binding"
type="axis2:DialogueServicePortType">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http";
style="document" />
        <wsdl:operation name="getDatabases">
            <soap:operation soapAction="urn:getDatabases"
style="document" />
            <wsdl:input>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="DialogueServiceSOAP12Binding"
type="axis2:DialogueServicePortType">
        <soap12:binding
transport="http://schemas.xmlsoap.org/soap/http"; style="document" />
        <wsdl:operation name="getDatabases">
            <soap12:operation soapAction="urn:getDatabases"
style="document" />
        <wsdl:input>
        <soap12:body use="literal" />
        </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="DialogueServiceHttpBinding"
type="axis2:DialogueServicePortType">
        <http:binding verb="POST" />
        <wsdl:operation name="getDatabases">
            <http:operation location="getDatabases" />
            <wsdl:input>
                <mime:content type="text/xml" />
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>

    <wsdl:service name="DialogueService">
        <wsdl:port name="DialogueServiceSOAP11port_http"
binding="axis2:DialogueServiceSOAP11Binding">
            <soap:address
location="http://localhost:80/axis2/services/DialogueService"; />
        </wsdl:port>
        <wsdl:port name="DialogueServiceSOAP12port_http"
binding="axis2:DialogueServiceSOAP12Binding">
            <soap12:address
location="http://localhost:80/axis2/services/DialogueService"; />
        </wsdl:port>
        <wsdl:port name="DialogueServiceHttpport1"
binding="axis2:DialogueServiceHttpBinding">
            <http:address
location="http://localhost:80/axis2/rest/DialogueService"; />
        </wsdl:port>
    </wsdl:service>

</wsdl:definitions>

Hope this helps.

Deepal Jayasinghe wrote:

Hi Ronald;

Can you please send us the source code , that will help us to find out
the issue.

Thanks
Deepal

Hello,

After working with Axis1.x for some time now I just started working
with Axis2. It works pretty nice out of the box until I tried
returning a List or Array of objects.
I read in some posting that I should get the latest snapshot release
to get this working but that did not help.
I get:* IllegalArgumentException: null rcl*

Does anyone know how I can resolve this? Returning a String or a
complex object works fine by the way.

specs:
I work /code first/; I have a simple webservice operation that should
return a List or an Array of objects. That's it.

Roepie


Reply via email to