我试图通过向服务发送soap请求来访问java webservice,奇怪的是直到最近它工作正常,现在它给了我一个内部服务器错误我做错了什么?
这是我的肥皂信息:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:q0="http://webservice.lenabru.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <q0:register><q0:regFirstName></q0:regFirstName><q0:regLastName></q0:regLastName><q0:regLoginName></q0:regLoginName><q0:regPassword></q0:regPassword><q0:regAddress></q0:regAddress><q0:regEmail></q0:regEmail><q0:regPhone></q0:regPhone></q0:register></soapenv:Body></soapenv:Envelope>
这是我从服务器得到的响应
"<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>java.lang.reflect.InvocationTargetException</faultstring>
<detail>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">Lena</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>"
这是我试图达到的 webmethod 的内容:
@WebMethod
public boolean register(String regFirstName, String regLastName, String regLoginName, String regPassword, String regAddress, String regPhone, String regEmail) {
return false;
}
这是我的wsdl:
<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://webservice.lenabru.com" xmlns:intf="http://webservice.lenabru.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://webservice.lenabru.com">
<!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)
-->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://webservice.lenabru.com">
<element name="register">
<complexType>
<sequence>
<element name="regFirstName" type="xsd:string"/>
<element name="regLastName" type="xsd:string"/>
<element name="regLoginName" type="xsd:string"/>
<element name="regPassword" type="xsd:string"/>
<element name="regAddress" type="xsd:string"/>
<element name="regPhone" type="xsd:string"/>
<element name="regEmail" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="registerResponse">
<complexType>
<sequence>
<element name="registerReturn" type="xsd:boolean"/>
</sequence>
</complexType>
</element>
<element name="isUserExists">
<complexType>
<sequence>
<element name="userName" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="isUserExistsResponse">
<complexType>
<sequence>
<element name="isUserExistsReturn" type="xsd:boolean"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="isUserExistsResponse">
<wsdl:part element="impl:isUserExistsResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="registerRequest">
<wsdl:part element="impl:register" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="isUserExistsRequest">
<wsdl:part element="impl:isUserExists" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="registerResponse">
<wsdl:part element="impl:registerResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:portType name="ElectronicArenaWebService">
<wsdl:operation name="register">
<wsdl:input message="impl:registerRequest" name="registerRequest"></wsdl:input>
<wsdl:output message="impl:registerResponse" name="registerResponse"></wsdl:output>
</wsdl:operation>
<wsdl:operation name="isUserExists">
<wsdl:input message="impl:isUserExistsRequest" name="isUserExistsRequest"></wsdl:input>
<wsdl:output message="impl:isUserExistsResponse" name="isUserExistsResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ElectronicArenaWebServiceSoapBinding" type="impl:ElectronicArenaWebService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="register">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="registerRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="registerResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="isUserExists">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="isUserExistsRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="isUserExistsResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ElectronicArenaWebServiceService">
<wsdl:port binding="impl:ElectronicArenaWebServiceSoapBinding" name="ElectronicArenaWebService">
<wsdlsoap:address location="http://localhost:8080/ElectronicArenaLena/services/ElectronicArenaWebService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>