我正在尝试研究如何访问外部Web服务。 我在eclipse中为以下Web服务创建了一个Web服务客户端:
http://www.webservicex.net/ws/WSDetails.aspx?WSID=9&CATID=2
我尝试使用下一个代码访问此Web服务:
public static void main(String[] args) {
try{
StockQuoteLocator locator = new StockQuoteLocator();
locator.setEndpointAddress("StockQuoteSoap", "http://www.webservicex.net/stockquote.asmx");
StockQuoteSoapStub stock = new StockQuoteSoapStub(locator);
System.out.println(stock.getQuote("TEVA"));
} catch (Exception e){
e.printStackTrace();
}
}
但我一直在收到错误:
06/02/2012 11:29:51 org.apache.axis.utils.JavaUtils isAttachmentSupported
WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
AxisFault
faultCode: {http://xml.apache.org/axis/}Server.NoEndpoint
faultSubcode:
faultString: No endpoint
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}exceptionName:org.apache.axis.NoEndPointException
{http://xml.apache.org/axis/}stackTrace:No endpoint
at NET.webserviceX.www.StockQuoteSoapStub.getQuote(StockQuoteSoapStub.java:93)
at Main.main(Main.java:17)
{http://xml.apache.org/axis/}hostname:MICHALEDR-DTW7
No endpoint
at NET.webserviceX.www.StockQuoteSoapStub.getQuote(StockQuoteSoapStub.java:93)
at Main.main(Main.java:17)
你能帮我解决一下吗?