Hi, I have this WSDL (that I cannot modify):

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="HelloWorld" targetNamespace="http://acm.org/samples"; xmlns="http://schemas.xmlsoap.org/wsdl/"; xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"; xmlns:tns="http://acm.org/samples"; xmlns:xs="http://www.w3.org/2001/XMLSchema";>


<types>
<schema targetNamespace="http://acm.org/samples"; xmlns="http://www.w3.org/2001/XMLSchema";>
<element name="documento">
<simpleType>
<restriction base="xs:string"/>
</simpleType>
</element>
</schema>
</types>


  <message name="HelloWorldResponseMessage">
     <part name="payload" type="xs:string"/>
  </message>

  <message name="HelloWorldRequestMessage1">
     <part element="tns:documento" name="payload"/>
  </message>

  <portType name="HelloWorld">
     <operation name="process">
        <input message="tns:HelloWorldRequestMessage1"/>
        <output message="tns:HelloWorldResponseMessage"/>
     </operation>
  </portType>

<binding name="clientServiceBinding" type="tns:HelloWorld">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
<operation name="process">
<soap:operation soapAction="" style="rpc" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
<input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; use="encoded" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
</input>
<output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; use="encoded" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
</output>
</operation>
</binding>


<service name="clientService">
<port binding="tns:clientServiceBinding" name="clientServicePort">
<soap:address location="http://sagitta:50000/active-bpel/services/clientService"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
</port>
</service>
</definitions>


note that "documento" in <types>.

Then I do a WSDL2Java with --server-side parameter to generate a server side webservice (in localhost).
But when I Deploy it to my axis server, seeing the WSDL of that service, the notably error occurs:


makeTypeElement() was told to create a type "{http://acm.org/samples}>documento", with no containing element
at org.apache.axis.wsdl.fromJava.Types.makeTypeElement(Types.java:1723)
at org.apache.axis.wsdl.fromJava.Types.writeTypeForPart(Types.java:395)
at org.apache.axis.wsdl.fromJava.Types.writeTypeAndSubTypeForPart(Types.java:416)
at org.apache.axis.wsdl.fromJava.Emitter.writePartToMessage(Emitter.java:1864)
at org.apache.axis.wsdl.fromJava.Emitter.writeRequestMessage(Emitter.java:1460)
at org.apache.axis.wsdl.fromJava.Emitter.writeMessages(Emitter.java:1087)
at org.apache.axis.wsdl.fromJava.Emitter.writePortType(Emitter.java:1056)
at org.apache.axis.wsdl.fromJava.Emitter.getWSDL(Emitter.java:471)
at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:322)
at org.apache.axis.providers.BasicProvider.generateWSDL(BasicProvider.java:237)
at org.apache.axis.strategies.WSDLGenStrategy.visit(WSDLGenStrategy.java:33)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.generateWSDL(SimpleChain.java:104)
at org.apache.axis.handlers.soap.SOAPService.generateWSDL(SOAPService.java:316)
at org.apache.axis.server.AxisServer.generateWSDL(AxisServer.java:467)
at org.apache.axis.transport.http.SimpleAxisWorker.execute(SimpleAxisWorker.java:328)
at org.apache.axis.transport.http.SimpleAxisWorker.run(SimpleAxisWorker.java:155)
at org.apache.axis.transport.http.SimpleAxisServer.run(SimpleAxisServer.java:241)
at org.apache.axis.transport.http.SimpleAxisServer.start(SimpleAxisServer.java:284)
at org.apache.axis.transport.http.SimpleAxisServer.start(SimpleAxisServer.java:292)
at org.apache.axis.transport.http.SimpleAxisServer.main(SimpleAxisServer.java:373)


Then I tried to "manually" modify all ">documento" occurences to "documento", recompiled java files and redeployed it. Now it seems that I can see the WSDL without errors:

<wsdl:definitions targetNamespace="http://acm.org/samples"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:intf="http://acm.org/samples"; xmlns:impl="http://acm.org/samples"; xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:apachesoap="http://xml.apache.org/xml-soap";>
<!--WSDL created by Apache Axis version: 1.2RC1
Built on Sep 29, 2004 (08:29:40 EDT)-->
<wsdl:message name="processResponse">
<wsdl:part name="payload" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="processRequest">
<wsdl:part name="documento" type="intf:documento"/>
</wsdl:message>
<wsdl:portType name="HelloWorld">
<wsdl:operation name="process" parameterOrder="documento">
<wsdl:input name="processRequest" message="intf:processRequest"/>
<wsdl:output name="processResponse" message="intf:processResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="clientServicePortSoapBinding" type="intf:HelloWorld">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="process">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="processRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://acm.org/samples"/>
</wsdl:input>
<wsdl:output name="processResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://acm.org/samples"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="clientService">
<wsdl:port name="clientServicePort" binding="intf:clientServicePortSoapBinding">
<wsdlsoap:address location="http://andromeda:8080/axis/services/clientService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>


But, wait: the <types> section is off!
Then I try to use WSDL2Java to create a client, and this error appears:

java.io.IOException: Type {http://acm.org/samples}documento is referenced but not defined.
at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(SymbolTable.java:652)
at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:532)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:506)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:483)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:356)
at java.lang.Thread.run(Unknown Source)


Any idea?
Thank you in advance,
Luca



Reply via email to