You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Paulo Soares <ps...@consiste.pt> on 2004/05/12 13:12:26 UTC
java2WSDL in WRAPPED style does not define the array
I have the following java files:
package wsc;
public class LinhaReceita {
public String produto;
}
package wsc;
public class ValidaPergunta {
public LinhaReceita linhasReceita[];
}
package wsc;
public class ValidaCartao {
public int doValidacao(ValidaPergunta pergunta) {
return 0;
}
}
I compile them into an wsdl with:
java org.apache.axis.wsdl.Java2WSDL -o wsfile.wsdl
-l"http://localhost:8084/axis/services/ValidaCartao" -y WRAPPED -u
LITERAL -n "urn:ValidaCartao" -p"wsc" "urn:ValidaCartao"
wsc.ValidaCartao
The result is that the array is not defined and when I run:
java org.apache.axis.wsdl.WSDL2Java -s
-N"urn:ValidaCartao=ValidaCartao_server" wsfile.wsdl
I correctly get the exception:
java.io.IOException: Type Array is referenced but not defined.
at
org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(SymbolTab
le.java:652)
at
org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:532)
at
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:5
06)
at
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:4
83)
at
org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:356)
at java.lang.Thread.run(Unknown Source)
I'm using the latest cvs and just for curiosity the rpc/encoded style
works. The wsdl is:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:ValidaCartao"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="urn:ValidaCartao" xmlns:intf="urn:ValidaCartao"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: #axisVersion#
Built on #today#-->
<wsdl:types>
<schema elementFormDefault="qualified"
targetNamespace="urn:ValidaCartao"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="doValidacao">
<complexType>
<sequence>
<element name="pergunta" type="impl:ValidaPergunta"/>
</sequence>
</complexType>
</element>
<complexType name="LinhaReceita">
<sequence>
<element name="produto" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfLinhaReceita">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="impl:LinhaReceita[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ValidaPergunta">
<sequence>
<element name="linhasReceita" nillable="true"
type="impl:ArrayOfLinhaReceita"/>
</sequence>
</complexType>
<element name="doValidacaoResponse">
<complexType>
<sequence>
<element name="doValidacaoReturn" type="xsd:int"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="doValidacaoRequest">
<wsdl:part element="impl:doValidacao" name="parameters"/>
</wsdl:message>
<wsdl:message name="doValidacaoResponse">
<wsdl:part element="impl:doValidacaoResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="ValidaCartao">
<wsdl:operation name="doValidacao">
<wsdl:input message="impl:doValidacaoRequest"
name="doValidacaoRequest"/>
<wsdl:output message="impl:doValidacaoResponse"
name="doValidacaoResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ValidaCartaoSoapBinding"
type="impl:ValidaCartao">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="doValidacao">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="doValidacaoRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="doValidacaoResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ValidaCartaoService">
<wsdl:port binding="impl:ValidaCartaoSoapBinding"
name="ValidaCartao">
<wsdlsoap:address
location="http://localhost:8084/axis/services/ValidaCartao"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Best Regards,
Paulo Soares