我有一个包含三个方法的Service类,并且我想为该服务生成wsdl文件,我尝试使用Axis2提供的JAVA2WSDL实用程序,但是我不断收到此异常:
import random
score=0
with open('space_quiz_test.txt') as f:
quiz = f.readlines()
questions = random.sample(quiz, 10)
for question in questions:
detail = question.split(",")
print(detail[0],detail[1],detail[2],detail[3],detail[4],detail[5])
print(" ")
answer=input("Answer: ")
while True:
if answer.upper() not in ('A','B','C','D'):
print("Answer not valid, try again")
else:
break
if answer.upper() == detail[6]:
print("Well done, that's correct!")
score=score + 1
print(score)
elif answer.upper() != detail[6]:
print("Incorrect, the correct answer is ",detail[6])
print(score)
我创建了一个蚂蚁
java.lang.IllegalStateException: Error looking for paramter names in bytecode: unexpected bytes in file
at org.apache.axis2.description.java2wsdl.bytecode.ClassReader.readCpool(ClassReader.java:354)
at org.apache.axis2.description.java2wsdl.bytecode.ParamReader.<init>(ParamReader.java:78)
at org.apache.axis2.description.java2wsdl.bytecode.ParamReader.<init>(ParamReader.java:57)
at org.apache.axis2.description.java2wsdl.bytecode.ChainedParamReader.<init>(ChainedParamReader.java:52)
at org.apache.axis2.description.java2wsdl.bytecode.MethodTable.<init>(MethodTable.java:31)
at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.<init>(DefaultSchemaGenerator.java:177)
at org.apache.ws.java2wsdl.Java2WSDLBuilder.resolveSchemaGen(Java2WSDLBuilder.java:443)
at org.apache.ws.java2wsdl.Java2WSDLBuilder.generateWSDL(Java2WSDLBuilder.java:230)
at org.apache.ws.java2wsdl.Java2WSDLCodegenEngine.generate(Java2WSDLCodegenEngine.java:60)
at org.apache.axis2.tool.ant.Java2WSDLTask.execute(Java2WSDLTask.java:281)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:834)
at org.apache.tools.ant.Main.startAnt(Main.java:223)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
。xml文件:
build
但是错误是相同的。
我只是想知道JAVA2WSDL.sh是如何工作的,以及是否还有一种很棒的生成WSDL文件的方法!
谢谢。