java.lang.reflect.InvocationTargetException 在 switchyard 中从 WSDL 创建 Java 文件
java.lang.reflect.InvocationTargetException while creating Java Files from WSDL in switchyard
我正在尝试从 switchyard 中的现有 WSDL 创建存根(java 文件)并遇到异常:java.lang.reflect.InvocationTargetException
步骤:
- 我在 JBDS 中创建了一个 switchyard 项目并将 wsdl 放在资源文件夹中。然后我做了
New -> Others -> SwitchYard -> Java Files from WSDL
- 我 select 包并浏览 wsdl 文件。
- 当我点击“完成”时,弹出一个错误
java.lang.reflect.InvocationTargetException
并且它不会创建 java 个文件
我已附上错误和 wsdl 文件。
请让我知道如何解决这个问题。我在创建生成 java 文件时做错了什么。请告诉我。
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:mx="http://www.ibm.com/maximo" xmlns:mxws="http://www.ibm.com/maximo/wsdl/web_MXINCIDENT_WS" targetNamespace="http://www.ibm.com/maximo/wsdl/web_MXINCIDENT_WS" name="web_MXINCIDENT_WS">
<types>
<xsd:schema xmlns="http://www.ibm.com/maximo" elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="http://www.ibm.com/maximo">
<xsd:include schemaLocation="common/MXMeta.xsd" />
<xsd:include schemaLocation="MXINCIDENT_WSTB.xsd" />
<xsd:include schemaLocation="common/mxincident_wst.xsd" />
<xsd:complexType name="CreateMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="InvokeMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="QueryMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBQuery" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
<xsd:attributeGroup ref="QueryContentGroup" />
</xsd:complexType>
<xsd:complexType name="SyncMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="PublishMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
<xsd:attributeGroup ref="PublishingContentGroup" />
</xsd:complexType>
<xsd:complexType name="UpdateMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="DeleteMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="InvokeMXINCIDENT_WSTBResponseType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="CreateMXINCIDENT_WSTBResponseType">
<xsd:sequence>
<xsd:element name="MXINCIDENT_WSTBSet" type="MXINCIDENT_WSTBCombinedKeySetType" minOccurs="0" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="QueryMXINCIDENT_WSTBResponseType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
<xsd:attributeGroup ref="ResponseContentGroup" />
</xsd:complexType>
<xsd:complexType name="SyncMXINCIDENT_WSTBResponseType">
<xsd:sequence>
<xsd:element name="MXINCIDENT_WSTBSet" type="MXINCIDENT_WSTBCombinedKeySetType" minOccurs="0" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="DeleteMXINCIDENT_WSTBResponseType">
<xsd:sequence>
<xsd:element name="MXINCIDENT_WSTBSet" type="MXINCIDENT_WSTBCombinedKeySetType" minOccurs="0" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="UpdateMXINCIDENT_WSTBResponseType">
<xsd:sequence>
<xsd:element name="MXINCIDENT_WSTBSet" type="MXINCIDENT_WSTBCombinedKeySetType" minOccurs="0" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:element name="UpdateMXINCIDENT_WSTB" type="UpdateMXINCIDENT_WSTBType" />
<xsd:element name="QueryMXINCIDENT_WSTB" type="QueryMXINCIDENT_WSTBType" />
<xsd:element name="CreateMXINCIDENT_WSTB" type="CreateMXINCIDENT_WSTBType" />
<xsd:element name="SyncMXINCIDENT_WSTB" type="SyncMXINCIDENT_WSTBType" />
<xsd:element name="DeleteMXINCIDENT_WSTB" type="DeleteMXINCIDENT_WSTBType" />
<xsd:element name="PublishMXINCIDENT_WSTB" type="PublishMXINCIDENT_WSTBType" />
<xsd:element name="InvokeMXINCIDENT_WSTB" type="InvokeMXINCIDENT_WSTBType" />
<xsd:element name="InvokeMXINCIDENT_WSTBResponse" type="InvokeMXINCIDENT_WSTBResponseType" />
<xsd:element name="QueryMXINCIDENT_WSTBResponse" type="QueryMXINCIDENT_WSTBResponseType" />
<xsd:element name="CreateMXINCIDENT_WSTBResponse" type="CreateMXINCIDENT_WSTBResponseType" />
<xsd:element name="SyncMXINCIDENT_WSTBResponse" type="SyncMXINCIDENT_WSTBResponseType" />
<xsd:element name="UpdateMXINCIDENT_WSTBResponse" type="UpdateMXINCIDENT_WSTBResponseType" />
<xsd:element name="DeleteMXINCIDENT_WSTBResponse" type="DeleteMXINCIDENT_WSTBResponseType" />
</xsd:schema>
</types>
<portType name="web_MXINCIDENT_WSPortType">
<operation name="CreateMXINCIDENT_WSTB">
<input message="mxws:CreateMXINCIDENT_WSTBRequest" />
<output message="mxws:CreateMXINCIDENT_WSTBResponse" />
</operation>
</portType>
<binding name="web_MXINCIDENT_WSSOAP11Binding" type="mxws:web_MXINCIDENT_WSPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="CreateMXINCIDENT_WSTB">
<soap:operation soapAction="urn:processDocument" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<binding name="web_MXINCIDENT_WSSOAP12Binding" type="mxws:web_MXINCIDENT_WSPortType">
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="CreateMXINCIDENT_WSTB">
<soap12:operation soapAction="urn:processDocument" style="document" />
<input>
<soap12:body use="literal" />
</input>
<output>
<soap12:body use="literal" />
</output>
</operation>
</binding>
<message name="CreateMXINCIDENT_WSTBRequest">
<part name="parameters" element="mx:CreateMXINCIDENT_WSTB" />
</message>
<message name="CreateMXINCIDENT_WSTBResponse">
<part name="parameters" element="mx:CreateMXINCIDENT_WSTBResponse" />
</message>
<service name="web_MXINCIDENT_WS">
<port name="web_MXINCIDENT_WSSOAP11Port" binding="mxws:web_MXINCIDENT_WSSOAP11Binding">
<soap:address location="http://192.168.44.65:9080/meaweb/services/web_MXINCIDENT_WS" />
</port>
<port name="web_MXINCIDENT_WSSOAP12Port" binding="mxws:web_MXINCIDENT_WSSOAP12Binding">
<soap12:address location="http://192.168.44.65:9080/meaweb/services/web_MXINCIDENT_WS" />
</port>
</service>
</definitions>
我终于弄清楚了问题所在。
我意识到的是,
- 如果 WSDL 不正确,您将得到我遇到的异常。
- 在我的 wsdl 中,指定位置缺少两个 xsd。添加这两个 xsd 后,我能够生成存根。
我正在尝试从 switchyard 中的现有 WSDL 创建存根(java 文件)并遇到异常:java.lang.reflect.InvocationTargetException
步骤:
- 我在 JBDS 中创建了一个 switchyard 项目并将 wsdl 放在资源文件夹中。然后我做了
New -> Others -> SwitchYard -> Java Files from WSDL
- 我 select 包并浏览 wsdl 文件。
- 当我点击“完成”时,弹出一个错误
java.lang.reflect.InvocationTargetException
并且它不会创建 java 个文件
我已附上错误和 wsdl 文件。 请让我知道如何解决这个问题。我在创建生成 java 文件时做错了什么。请告诉我。
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:mx="http://www.ibm.com/maximo" xmlns:mxws="http://www.ibm.com/maximo/wsdl/web_MXINCIDENT_WS" targetNamespace="http://www.ibm.com/maximo/wsdl/web_MXINCIDENT_WS" name="web_MXINCIDENT_WS">
<types>
<xsd:schema xmlns="http://www.ibm.com/maximo" elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="http://www.ibm.com/maximo">
<xsd:include schemaLocation="common/MXMeta.xsd" />
<xsd:include schemaLocation="MXINCIDENT_WSTB.xsd" />
<xsd:include schemaLocation="common/mxincident_wst.xsd" />
<xsd:complexType name="CreateMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="InvokeMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="QueryMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBQuery" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
<xsd:attributeGroup ref="QueryContentGroup" />
</xsd:complexType>
<xsd:complexType name="SyncMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="PublishMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
<xsd:attributeGroup ref="PublishingContentGroup" />
</xsd:complexType>
<xsd:complexType name="UpdateMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="DeleteMXINCIDENT_WSTBType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="InvokeMXINCIDENT_WSTBResponseType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="CreateMXINCIDENT_WSTBResponseType">
<xsd:sequence>
<xsd:element name="MXINCIDENT_WSTBSet" type="MXINCIDENT_WSTBCombinedKeySetType" minOccurs="0" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="QueryMXINCIDENT_WSTBResponseType">
<xsd:sequence>
<xsd:element ref="MXINCIDENT_WSTBSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
<xsd:attributeGroup ref="ResponseContentGroup" />
</xsd:complexType>
<xsd:complexType name="SyncMXINCIDENT_WSTBResponseType">
<xsd:sequence>
<xsd:element name="MXINCIDENT_WSTBSet" type="MXINCIDENT_WSTBCombinedKeySetType" minOccurs="0" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="DeleteMXINCIDENT_WSTBResponseType">
<xsd:sequence>
<xsd:element name="MXINCIDENT_WSTBSet" type="MXINCIDENT_WSTBCombinedKeySetType" minOccurs="0" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="UpdateMXINCIDENT_WSTBResponseType">
<xsd:sequence>
<xsd:element name="MXINCIDENT_WSTBSet" type="MXINCIDENT_WSTBCombinedKeySetType" minOccurs="0" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:element name="UpdateMXINCIDENT_WSTB" type="UpdateMXINCIDENT_WSTBType" />
<xsd:element name="QueryMXINCIDENT_WSTB" type="QueryMXINCIDENT_WSTBType" />
<xsd:element name="CreateMXINCIDENT_WSTB" type="CreateMXINCIDENT_WSTBType" />
<xsd:element name="SyncMXINCIDENT_WSTB" type="SyncMXINCIDENT_WSTBType" />
<xsd:element name="DeleteMXINCIDENT_WSTB" type="DeleteMXINCIDENT_WSTBType" />
<xsd:element name="PublishMXINCIDENT_WSTB" type="PublishMXINCIDENT_WSTBType" />
<xsd:element name="InvokeMXINCIDENT_WSTB" type="InvokeMXINCIDENT_WSTBType" />
<xsd:element name="InvokeMXINCIDENT_WSTBResponse" type="InvokeMXINCIDENT_WSTBResponseType" />
<xsd:element name="QueryMXINCIDENT_WSTBResponse" type="QueryMXINCIDENT_WSTBResponseType" />
<xsd:element name="CreateMXINCIDENT_WSTBResponse" type="CreateMXINCIDENT_WSTBResponseType" />
<xsd:element name="SyncMXINCIDENT_WSTBResponse" type="SyncMXINCIDENT_WSTBResponseType" />
<xsd:element name="UpdateMXINCIDENT_WSTBResponse" type="UpdateMXINCIDENT_WSTBResponseType" />
<xsd:element name="DeleteMXINCIDENT_WSTBResponse" type="DeleteMXINCIDENT_WSTBResponseType" />
</xsd:schema>
</types>
<portType name="web_MXINCIDENT_WSPortType">
<operation name="CreateMXINCIDENT_WSTB">
<input message="mxws:CreateMXINCIDENT_WSTBRequest" />
<output message="mxws:CreateMXINCIDENT_WSTBResponse" />
</operation>
</portType>
<binding name="web_MXINCIDENT_WSSOAP11Binding" type="mxws:web_MXINCIDENT_WSPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="CreateMXINCIDENT_WSTB">
<soap:operation soapAction="urn:processDocument" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<binding name="web_MXINCIDENT_WSSOAP12Binding" type="mxws:web_MXINCIDENT_WSPortType">
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="CreateMXINCIDENT_WSTB">
<soap12:operation soapAction="urn:processDocument" style="document" />
<input>
<soap12:body use="literal" />
</input>
<output>
<soap12:body use="literal" />
</output>
</operation>
</binding>
<message name="CreateMXINCIDENT_WSTBRequest">
<part name="parameters" element="mx:CreateMXINCIDENT_WSTB" />
</message>
<message name="CreateMXINCIDENT_WSTBResponse">
<part name="parameters" element="mx:CreateMXINCIDENT_WSTBResponse" />
</message>
<service name="web_MXINCIDENT_WS">
<port name="web_MXINCIDENT_WSSOAP11Port" binding="mxws:web_MXINCIDENT_WSSOAP11Binding">
<soap:address location="http://192.168.44.65:9080/meaweb/services/web_MXINCIDENT_WS" />
</port>
<port name="web_MXINCIDENT_WSSOAP12Port" binding="mxws:web_MXINCIDENT_WSSOAP12Binding">
<soap12:address location="http://192.168.44.65:9080/meaweb/services/web_MXINCIDENT_WS" />
</port>
</service>
</definitions>
我终于弄清楚了问题所在。
我意识到的是,
- 如果 WSDL 不正确,您将得到我遇到的异常。
- 在我的 wsdl 中,指定位置缺少两个 xsd。添加这两个 xsd 后,我能够生成存根。