Skip to Content
0
Former Member
Jul 28, 2010 at 03:43 AM

Calling Webservices from Webservice client

53 Views

Hi Guyz,

A RFC is published as a Webservice and I am trying to call the same thru a webservice cllient. I am using NWDS 7.1.1 for the same. I have generated the Java proxy classes and I developed a Main Java class with the following code -

1) String wsdlURL = "http://localhost:8001/sap/bc/srt/rfc/sap/BAPIFlightList?sap-client=800&wsdl=1.1"

2) String namespace = "urn:sap-com:document:sap:soap:functions:mc-style";

3) String serviceName = "BAPIFlightList";

4) QName serviceQN = new QName(namespace, serviceName);

5) ServiceFactory serviceFactory = ServiceFactory.newInstance();

6) Service service = serviceFactory.createService(new URL(wsdlURL), serviceQN);

7) Service.createCall();

At line# 6 i am getting following exception-:

28 Jul, 2010 8:59:32 AM org.apache.axis.utils.JavaUtils isAttachmentSupported

WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.

javax.xml.rpc.ServiceException: Error processing WSDL document:

java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8001/sap/bc/srt/rfc/sap/BAPIFlightList?sap-client=800&wsdl=1.1

at org.apache.axis.client.Service.initService(Service.java:250)

at org.apache.axis.client.Service.<init>(Service.java:165)

at org.apache.axis.client.ServiceFactory.createService(ServiceFactory.java:198)

at com.abhi.checksso.CheckSSO.main(CheckSSO.java:36)

Can Any one have any idea about the above exception and how to correct the same.

Also, is my approach to call a webservice from Java correct or are there any other approach. I am trying this First time and open to all kinds of suggesstions.

Thanks

Abhinav Sharma