Prezados confrades do GUJ,
Estou estudando o Axis2 e fiquei estupefato com a facilidade de implantar WebServices com ele.
Mas vamos à minha história: eu criei um método com a seguinte assinatura:
public boolean processIdentifiableList (List<Identifiable> identifiables)
Sendo Identifiable:
[code]package axis2poc.bean;
public class Identifiable {
private Long id;
private String name;
/**
* @return the id
/
public Long getId() {
return id;
}
/*
* @param id the id to set
/
public void setId(Long id) {
this.id = id;
}
/*
* @return the name
/
public String getName() {
return name;
}
/*
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
}[/code]
O bicho funcionou, mas com um inconveniente: o WSDL gerado (abaixo) não elucida qual o tipo da lista, que é genérica (ou isto ou eu não interpretei direito).
É possível fazer esta restrição?!
Muito grato!
Segue WSDL
<wsdl:definitions targetNamespace="http://service.axis2poc">
<wsdl:documentation>PocPojoService</wsdl:documentation>
−
<wsdl:types>
−
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://bean.axis2poc/xsd">
−
<xs:complexType name="Identifiable">
−
<xs:sequence>
<xs:element minOccurs="0" name="id" nillable="true" type="xs:long"/>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
−
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.axis2poc">
<xs:import namespace="http://bean.axis2poc/xsd"/>
−
<xs:element name="processIdentifiableList">
−
<xs:complexType>
−
<xs:sequence>
<xs:element minOccurs="0" name="identifiables" nillable="true" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
−
<xs:element name="processIdentifiableListResponse">
−
<xs:complexType>
−
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
−
<xs:element name="proccessMapList">
−
<xs:complexType>
−
<xs:sequence>
<xs:element minOccurs="0" name="mapList" nillable="true" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
−
<xs:element name="proccessMapListResponse">
−
<xs:complexType>
−
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
−
<xs:element name="proccessIdentifiable">
−
<xs:complexType>
−
<xs:sequence>
<xs:element minOccurs="0" name="identifiable" nillable="true" type="ax22:Identifiable"/>
</xs:sequence>
</xs:complexType>
</xs:element>
−
<xs:element name="proccessIdentifiableResponse">
−
<xs:complexType>
−
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
−
<wsdl:message name="proccessMapListRequest">
<wsdl:part name="parameters" element="ns:proccessMapList"/>
</wsdl:message>
−
<wsdl:message name="proccessMapListResponse">
<wsdl:part name="parameters" element="ns:proccessMapListResponse"/>
</wsdl:message>
−
<wsdl:message name="processIdentifiableListRequest">
<wsdl:part name="parameters" element="ns:processIdentifiableList"/>
</wsdl:message>
−
<wsdl:message name="processIdentifiableListResponse">
<wsdl:part name="parameters" element="ns:processIdentifiableListResponse"/>
</wsdl:message>
−
<wsdl:message name="proccessIdentifiableRequest">
<wsdl:part name="parameters" element="ns:proccessIdentifiable"/>
</wsdl:message>
−
<wsdl:message name="proccessIdentifiableResponse">
<wsdl:part name="parameters" element="ns:proccessIdentifiableResponse"/>
</wsdl:message>
−
<wsdl:portType name="PocPojoServicePortType">
−
<wsdl:operation name="proccessMapList">
<wsdl:input message="ns:proccessMapListRequest" wsaw:Action="urn:proccessMapList"/>
<wsdl:output message="ns:proccessMapListResponse" wsaw:Action="urn:proccessMapListResponse"/>
</wsdl:operation>
−
<wsdl:operation name="processIdentifiableList">
<wsdl:input message="ns:processIdentifiableListRequest" wsaw:Action="urn:processIdentifiableList"/>
<wsdl:output message="ns:processIdentifiableListResponse" wsaw:Action="urn:processIdentifiableListResponse"/>
</wsdl:operation>
−
<wsdl:operation name="proccessIdentifiable">
<wsdl:input message="ns:proccessIdentifiableRequest" wsaw:Action="urn:proccessIdentifiable"/>
<wsdl:output message="ns:proccessIdentifiableResponse" wsaw:Action="urn:proccessIdentifiableResponse"/>
</wsdl:operation>
</wsdl:portType>
−
<wsdl:binding name="PocPojoServiceSoap11Binding" type="ns:PocPojoServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
−
<wsdl:operation name="proccessMapList">
<soap:operation soapAction="urn:proccessMapList" style="document"/>
−
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
−
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
−
<wsdl:operation name="processIdentifiableList">
<soap:operation soapAction="urn:processIdentifiableList" style="document"/>
−
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
−
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
−
<wsdl:operation name="proccessIdentifiable">
<soap:operation soapAction="urn:proccessIdentifiable" 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="PocPojoServiceSoap12Binding" type="ns:PocPojoServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
−
<wsdl:operation name="proccessMapList">
<soap12:operation soapAction="urn:proccessMapList" style="document"/>
−
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
−
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
−
<wsdl:operation name="processIdentifiableList">
<soap12:operation soapAction="urn:processIdentifiableList" style="document"/>
−
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
−
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
−
<wsdl:operation name="proccessIdentifiable">
<soap12:operation soapAction="urn:proccessIdentifiable" 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="PocPojoServiceHttpBinding" type="ns:PocPojoServicePortType">
<http:binding verb="POST"/>
−
<wsdl:operation name="proccessMapList">
<http:operation location="PocPojoService/proccessMapList"/>
−
<wsdl:input>
<mime:content type="text/xml" part="proccessMapList"/>
</wsdl:input>
−
<wsdl:output>
<mime:content type="text/xml" part="proccessMapList"/>
</wsdl:output>
</wsdl:operation>
−
<wsdl:operation name="processIdentifiableList">
<http:operation location="PocPojoService/processIdentifiableList"/>
−
<wsdl:input>
<mime:content type="text/xml" part="processIdentifiableList"/>
</wsdl:input>
−
<wsdl:output>
<mime:content type="text/xml" part="processIdentifiableList"/>
</wsdl:output>
</wsdl:operation>
−
<wsdl:operation name="proccessIdentifiable">
<http:operation location="PocPojoService/proccessIdentifiable"/>
−
<wsdl:input>
<mime:content type="text/xml" part="proccessIdentifiable"/>
</wsdl:input>
−
<wsdl:output>
<mime:content type="text/xml" part="proccessIdentifiable"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
−
<wsdl:service name="PocPojoService">
−
<wsdl:port name="PocPojoServiceHttpSoap11Endpoint" binding="ns:PocPojoServiceSoap11Binding">
<soap:address location="http://localhost:8080/axis2/services/PocPojoService.PocPojoServiceHttpSoap11Endpoint/"/>
</wsdl:port>
−
<wsdl:port name="PocPojoServiceHttpSoap12Endpoint" binding="ns:PocPojoServiceSoap12Binding">
<soap12:address location="http://localhost:8080/axis2/services/PocPojoService.PocPojoServiceHttpSoap12Endpoint/"/>
</wsdl:port>
−
<wsdl:port name="PocPojoServiceHttpEndpoint" binding="ns:PocPojoServiceHttpBinding">
<http:address location="http://localhost:8080/axis2/services/PocPojoService.PocPojoServiceHttpEndpoint/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>