我有一个用Java编写的Web服务TaskListWS,我正在使用NetBeans 8.0.2
我已经创建了wsdl并通过测试Web服务功能对其进行了测试。
然后我做了一个"生成并复制WSDL"给我的客户sc_demo。
JSP文件现在都有错误说
com.shoulderscorp.services.TaskListWS service = new com.shoulderscorp.services.TaskListWS();
com.shoulderscorp.services.TaskListWS port = service.getTaskListWSPort();
出错,因为TaskListWS是抽象的,无法实例化。该类不是抽象的,并且类中没有抽象方法。
这是被调用的方法:
@WebService(serviceName = "TaskListWS")
public class TaskListWS {
private boolean inited = false;
private QueueManager qm = new QueueManager();
private static final String[] statusValues = {"Active", "Completed", "Waiting", "Damaged"};
/**
* Web service operation
*/
@WebMethod(operationName = "getTaskListForUser")
public String getTaskListForUser(@WebParam(name = "userToken") String userToken) {
...
}
wsdl文件包含:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.3 (tags/2.3-7528; 2013-04-29T19:34:10+0000) JAXWS-RI/2.2.8 JAXWS/2.2 svn-revision#unknown. -->
<definitions targetNamespace="http://services.shoulderscorp.com/" name="TaskListWS" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:tns="http://services.shoulderscorp.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
<types>
<xsd:schema>
<xsd:import namespace="http://services.shoulderscorp.com/" schemaLocation="TaskListWS_schema1.xsd"/>
</xsd:schema>
</types>
<message name="toString">
<part name="parameters" element="tns:toString"/>
</message>
<message name="toStringResponse">
<part name="parameters" element="tns:toStringResponse"/>
</message>
<message name="deleteQueueEntry">
<part name="parameters" element="tns:deleteQueueEntry"/>
</message>
<message name="deleteQueueEntryResponse">
<part name="parameters" element="tns:deleteQueueEntryResponse"/>
</message>
<message name="getTaskListForUser">
<part name="parameters" element="tns:getTaskListForUser"/>
</message>
<message name="getTaskListForUserResponse">
<part name="parameters" element="tns:getTaskListForUserResponse"/>
</message>
<message name="getAllQueueEntriesWithStatus">
<part name="parameters" element="tns:getAllQueueEntriesWithStatus"/>
</message>
<message name="getAllQueueEntriesWithStatusResponse">
<part name="parameters" element="tns:getAllQueueEntriesWithStatusResponse"/>
</message>
<message name="updateWaitingEntriesService">
<part name="parameters" element="tns:updateWaitingEntriesService"/>
</message>
<message name="updateWaitingEntriesServiceResponse">
<part name="parameters" element="tns:updateWaitingEntriesServiceResponse"/>
</message>
<message name="getAllQueueEntries">
<part name="parameters" element="tns:getAllQueueEntries"/>
</message>
<message name="getAllQueueEntriesResponse">
<part name="parameters" element="tns:getAllQueueEntriesResponse"/>
</message>
<message name="updateEntry">
<part name="parameters" element="tns:updateEntry"/>
</message>
<message name="updateEntryResponse">
<part name="parameters" element="tns:updateEntryResponse"/>
</message>
<message name="queueEntry">
<part name="parameters" element="tns:queueEntry"/>
</message>
<message name="queueEntryResponse">
<part name="parameters" element="tns:queueEntryResponse"/>
</message>
<portType name="TaskListWS">
<operation name="toString">
<input wsam:Action="http://services.shoulderscorp.com/TaskListWS/toStringRequest" message="tns:toString"/>
<output wsam:Action="http://services.shoulderscorp.com/TaskListWS/toStringResponse" message="tns:toStringResponse"/>
</operation>
<operation name="deleteQueueEntry">
<input wsam:Action="http://services.shoulderscorp.com/TaskListWS/deleteQueueEntryRequest" message="tns:deleteQueueEntry"/>
<output wsam:Action="http://services.shoulderscorp.com/TaskListWS/deleteQueueEntryResponse" message="tns:deleteQueueEntryResponse"/>
</operation>
<operation name="getTaskListForUser">
<input wsam:Action="http://services.shoulderscorp.com/TaskListWS/getTaskListForUserRequest" message="tns:getTaskListForUser"/>
<output wsam:Action="http://services.shoulderscorp.com/TaskListWS/getTaskListForUserResponse" message="tns:getTaskListForUserResponse"/>
</operation>
<operation name="getAllQueueEntriesWithStatus">
<input wsam:Action="http://services.shoulderscorp.com/TaskListWS/getAllQueueEntriesWithStatusRequest" message="tns:getAllQueueEntriesWithStatus"/>
<output wsam:Action="http://services.shoulderscorp.com/TaskListWS/getAllQueueEntriesWithStatusResponse" message="tns:getAllQueueEntriesWithStatusResponse"/>
</operation>
<operation name="updateWaitingEntriesService">
<input wsam:Action="http://services.shoulderscorp.com/TaskListWS/updateWaitingEntriesServiceRequest" message="tns:updateWaitingEntriesService"/>
<output wsam:Action="http://services.shoulderscorp.com/TaskListWS/updateWaitingEntriesServiceResponse" message="tns:updateWaitingEntriesServiceResponse"/>
</operation>
<operation name="getAllQueueEntries">
<input wsam:Action="http://services.shoulderscorp.com/TaskListWS/getAllQueueEntriesRequest" message="tns:getAllQueueEntries"/>
<output wsam:Action="http://services.shoulderscorp.com/TaskListWS/getAllQueueEntriesResponse" message="tns:getAllQueueEntriesResponse"/>
</operation>
<operation name="updateEntry">
<input wsam:Action="http://services.shoulderscorp.com/TaskListWS/updateEntryRequest" message="tns:updateEntry"/>
<output wsam:Action="http://services.shoulderscorp.com/TaskListWS/updateEntryResponse" message="tns:updateEntryResponse"/>
</operation>
<operation name="queueEntry">
<input wsam:Action="http://services.shoulderscorp.com/TaskListWS/queueEntryRequest" message="tns:queueEntry"/>
<output wsam:Action="http://services.shoulderscorp.com/TaskListWS/queueEntryResponse" message="tns:queueEntryResponse"/>
</operation>
</portType>
<binding name="TaskListWSPortBinding" type="tns:TaskListWS">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="toString">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="deleteQueueEntry">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="getTaskListForUser">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="getAllQueueEntriesWithStatus">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="updateWaitingEntriesService">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="getAllQueueEntries">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="updateEntry">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="queueEntry">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="TaskListWS">
<port name="TaskListWSPort" binding="tns:TaskListWSPortBinding">
<soap:address location="REPLACE_WITH_ACTUAL_URL"/>
</port>
</service>
</definitions>
我不确定为什么会这样或者如何修复它。