cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Webservices from Webservice client

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Abhinav,

Have you specified the login credentials in the XML file?

Thanks and Regards,

Shyam

Abhinav_Sharma
Contributor
0 Kudos

He Shyam,

I have passed the Login Credentials. But it is still not finding the service. Also , when I created the Standalone Proxy, ServiceFactory Implementation Class is not genereated

Abhinav