1

i'm trying to study about how to access external web services. I have created a Web Service Client in eclipse for the following web service:

http://www.webservicex.net/ws/WSDetails.aspx?WSID=9&CATID=2

And I tried to access this web service with the next code:

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();
    }   
}

But i'm keep getting the error:

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)

Can you please help me fix it?

1 Answer 1

1

It clearly says that those classes are missing in your classpath.

Add activation.jar and javamail.jar to your classpath.

Sign up to request clarification or add additional context in comments.

1 Comment

This is not the answer. There are two issues above, you're only fixing the warnings, not the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.