0
解決策を探しています。私はWSDLファイルからeclipseでWebサービスをやっていました。 Tomcat 7をサーバーとして使用し、Javaで作業しています。私はテストのためSOAPUIに行きますとき 事は、私はこれを取得することです:eclipseで作成されたWebサービスを呼び出せません。
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>java.lang.NullPointerException</faultstring>
<detail>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">LES004372</ns1:hostname>
</detail>
</soapenv:Fault>
私が何をするか分かりません。私はすでにWSDLファイルの構造上のエラーをチェックし、すべてのWebサービスプロジェクトを再作成しようとしましたが、解決策が見つかりませんでした。私たちを手伝ってくれますか?ここで
は、私は、ウェブサービスのプロジェクトを作成するために使用する前のWSDLを含める(デザインビューでそれをやった):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/ICalculator/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ICalculator" targetNamespace="http://www.example.org/ICalculator/">
<wsdl:types>
<xsd:schema targetNamespace="http://www.example.org/ICalculator/">
<xsd:element name="MSEAddition" type="tns:MSEAdditionType">
</xsd:element>
<xsd:element name="MSSAdditionResponse"
type="tns:MSSAdditionResponseType">
</xsd:element>
<xsd:complexType name="MSEAdditionType">
<xsd:sequence>
<xsd:element name="numberOne" type="xsd:int"></xsd:element>
<xsd:element name="numberTwo" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="MSSAdditionResponseType">
<xsd:sequence>
<xsd:element name="result" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="AdditionRequest">
<wsdl:part element="tns:MSEAddition" name="MSE"/>
</wsdl:message>
<wsdl:message name="AdditionResponse">
<wsdl:part element="tns:MSSAdditionResponse" name="MSS"/>
</wsdl:message>
<wsdl:portType name="ICalculator">
<wsdl:operation name="Addition">
<wsdl:input message="tns:AdditionRequest"/>
<wsdl:output message="tns:AdditionResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ICalculatorSOAP" type="tns:ICalculator">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Addition">
<soap:operation soapAction="http://www.example.org/ICalculator/Addition"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ICalculator">
<wsdl:port binding="tns:ICalculatorSOAP" name="ICalculatorSOAP">
<soap:address location="http://www.example.org/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
を、ここには私が呼び出しています方法です:
public MSSAdditionResponseType addition(MSEAdditionType MSE) throws java.rmi.RemoteException {
MSSAdditionResponseType mssResponse = new MSSAdditionResponseType(Integer.toString(MSE.getNumberOne() + Integer.getInteger(MSE.getNumberTwo())));
return mssResponse;
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.example.org/ICalculator/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ICalculator"
targetNamespace="http://www.example.org/ICalculator/">
<wsdl:types>
<xsd:schema targetNamespace="http://www.example.org/ICalculator/">
<xsd:element name="MSEAddition" type="tns:MSEAdditionType">
</xsd:element>
<xsd:element name="MSSAdditionResponse" type="tns:MSSAdditionResponseType">
</xsd:element>
<xsd:complexType name="MSEAdditionType">
<xsd:sequence>
<xsd:element name="numberOne" type="xsd:int" />
<xsd:element name="numberTwo" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="MSSAdditionResponseType">
<xsd:sequence>
<xsd:element name="result" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="AdditionRequest">
<wsdl:part element="tns:MSEAddition" name="MSE" />
</wsdl:message>
<wsdl:message name="AdditionResponse">
<wsdl:part element="tns:MSSAdditionResponse" name="MSS" />
</wsdl:message>
<wsdl:portType name="ICalculator">
<wsdl:operation name="Addition">
<wsdl:input message="tns:AdditionRequest" />
<wsdl:output message="tns:AdditionResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ICalculatorSOAP" type="tns:ICalculator">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Addition">
<soap:operation soapAction="http://www.example.org/ICalculator/Addition" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ICalculator">
<wsdl:port binding="tns:ICalculatorSOAP" name="ICalculatorSOAP">
<soap:address
location="http://localhost:8080/WebServiceProject/services/ICalculatorSOAP" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
:
私は信じている問題は、このファイルで、ここでウェブサービス(私がSOAPUIに使用するもの)の後に作成されたWSDLであります0
あなたのご協力をお待ちしております!
サーバはNPEを投げて、 ''エンベロープでラップしました... –