线程“主”中的异常java.lang.IllegalArgumentException wsdl

时间:2019-02-21 22:27:10

标签: java wsdl wsimport

尝试在wsdl中使用wsiport时,出现此错误:

Exception in thread "main" java.lang.IllegalArgumentException
        at com.sun.tools.internal.xjc.api.XJC.getDefaultPackageName(XJC.java:63)
        at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.getJavaPackage(WSDLModeler.java:2297)
        at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2275)
        at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:183)
        at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:126)
        at com.sun.tools.internal.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:429)
        at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:190)
        at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:168)
        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 com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:159)
        at com.sun.tools.internal.ws.WsImport.main(WsImport.java:42)

这是我的代码:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="AgeCalculator" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" TargetNamespace="namespace1">
  <wsdl:types>
    <schema>
        <element name="findAge">
            <complexType>
                <sequence>
                    <element name="birthDate" type="xsd:date"/>
                </sequence>
            </complexType>
        </element>
        <element name="findAge Response">
            <complexType>
                <sequence>
                    <element name="age" type="xsd:int"/>
                </sequence>
            </complexType>
        </element>
    </schema>
</wsdl:types>
<wsdl:message name="findAgeRequest">
    <wsdl:part name="parameters" element="findAge"/>
</wsdl:message>
<wsdl:message name="findAgeResponse">
    <wsdl:part name="parameters" element="findAgeResponse"/>
</wsdl:message>
<wsdl:portType name="PT">
    <wsdl:operation name="findAge">
        <wsdl:input message="findAgeRequest"/>
        <wsdl:output message="findAgeResponse"/>
    </wsdl:operation>
</wsdl:portType>
<wsdl:service name="AgeCalculatorService">
    <wsdl:port name="AgeCalculatorPort" binding="AgeCalculatorPortBinding">
        <soap:address location="http://127.0.0.1:9876/ts"/>
    </wsdl:port>
</wsdl:service>
</wsdl:definitions>

0 个答案:

没有答案