views:

384

answers:

1

Hi, I would like to create a Web Service in Eclipse. I already wrote a class and generated a WSDL file from it with Java2WSDL. I started a new "Dynamic Web Project" and added the axis2 facet to it. After that I wanted to create a new "Web Service" project. When I now select my WSDL file and click on "Finish" I get the following error:

IWAB0399E Error in generating Java from WSDL: java.io.IOException: ERROR: Missing element inFault "Exception" in operation "Exception", in binding execute

My WSDL

A: 

One problem is that your CompileAndExecuteServiceHttpBinding binding doesn't have an Exception fault defined in the operation. It should be something like:

<wsdl:binding name="CompileAndExecuteServiceHttpBinding" 
              type="ns:CompileAndExecuteServicePortType">
<http:binding verb="POST"/>
<wsdl:operation name="execute">
 <http:operation location="CompileAndExecuteService/execute"/>
 <wsdl:input>
  <mime:content type="text/xml" part="execute"/>
 </wsdl:input>
 <wsdl:output>
  <mime:content type="text/xml" part="execute"/>
 </wsdl:output>
 <wsdl:fault name="Exception">
  <soap12:fault use="literal" name="Exception"/>
 </wsdl:fault>
</wsdl:operation>
Robert Grant
However, I think that's only the start of the problem. Try regenerating :)
Robert Grant
The problem was that my methods where throwing exceptions. It seems you can´t throw exceptions "over the line" in web services like you can in CORBA.
dax