我想從我已經創建了一個WSDL定義生成Java服務類。我現在的問題是,它失敗,出現以下消息時,比沒有更多的細節:生成JAX-WS來源NullPointerException異常
Unable to generate JAX-WS Source.
Reason:
java.lang.NullPointerException
(耶〜對於冗長外)
我使用MuleStudio 1.3.0,它是基於Eclipse 3.6.1。我試圖直接從Mule的組件和WSDL創建這些類,但是我得到相同的錯誤。
我混了有目的的WSDL,它正確地開始嘔吐驗證錯誤。這意味着它正在讀取文件並正確解析它。不知道接下來會發生什麼。
我可以如何解決呢?
下面是引用我的WSDL文件:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://tempuri.org/ListenerService/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="ListenerService"
targetNamespace="http://tempuri.org/ListenerService/">
<!-- types -->
<wsdl:types>
<!-- Generic TransactionLog entities -->
<xsd:schema targetNamespace="http://tempuri.org/ListenerService/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="LevelEnumeration">
<xsd:restriction base="xsd:normalizedString">
<xsd:enumeration value="Debug" />
<xsd:enumeration value="Info" />
<xsd:enumeration value="Warning" />
<xsd:enumeration value="Error" />
<xsd:enumeration value="Fatal" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="LogEntry">
<sequence>
<xsd:element name="CorrelationToken" type="xsd:normalizedString"/>
<xsd:element name="SystemId" type="xsd:normalizedString"/>
<xsd:element name="Level" type="tns:LevelEnumeration"/>
<xsd:element name="Description" type="xs:string" />
<xsd:element name="RecordData" type="xs:string" />
<xsd:element name="Timestamp" type="xs:dateTime" />
</sequence>
</xsd:complexType>
<!-- Service Specific Types -->
<xsd:simpleType name="GenericResponseStatusEnumeration">
<xsd:restriction base="xsd:normalizedString">
<xsd:enumeration value="Success" />
<xsd:enumeration value="Error" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="ListenerServiceGenericResponse">
<sequence>
<xsd:element name="Status" type="tns:GenericResponseStatusEnumeration" />
<xsd:element name="Detail" type="xsd:string" minOccurs="0" maxOccurs="1" />
</sequence>
</xsd:complexType>
<xsd:element name="LogEntry" type="tns:LogEntry" />
<xsd:element name="ServiceResponse" type="tns:ListenerServiceGenericResponse" />
</xsd:schema>
</wsdl:types>
<!-- service message types -->
<wsdl:message name="SubmitLogRequest">
<wsdl:part name="LogEntry" type="tns:LogEntry" />
</wsdl:message>
<wsdl:message name="SubmitLogResponse">
<wsdl:part name="Response" type="tns:ListenerServiceGenericResponse" />
</wsdl:message>
<!-- service messages -->
<wsdl:portType name="ListenerService">
<wsdl:operation name="SubmitLog">
<wsdl:input message="tns:SubmitLogRequest" />
<!-- TODO: Remove this to make it a one-way operation -->
<wsdl:output message="tns:SubmitLogResponse" />
</wsdl:operation>
</wsdl:portType>
<!-- service bindings -->
<wsdl:binding name="ListenerServiceSOAP">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="SubmitLog">
<soap:operation soapAction="http://tempuri.org/ListenerService/SubmitLog" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ListenerService">
<wsdl:port binding="tns:ListenerServiceSOAP" name="ListenerServiceSOAP">
<soap:address location="http://tempuri.org" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
我會嘗試調用wsimport的直接指揮對您的WSDL從commad線JAXWS。我相信它現在與JDK一起提供,所以你甚至不需要下載它。您可能遇到了在wsimport的更高版本中修復的bug。 – davidfrancis 2012-07-06 22:35:57
@davidfrancis謝謝,我會嘗試在這裏更新。 – Alpha 2012-07-07 00:17:52
@davidfrancis謝謝,這實際上是我的問題的解決方案。從命令行運行它給了我很多有關WSDL問題的信息,但我仍然無法弄清楚爲什麼它不會給我任何有關Eclipse的反饋。我會更新這個問題來反映這一點。再次感謝! – Alpha 2012-07-09 14:21:24