on 07-28-2010 4:43 AM
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
Hi Abhinav,
Have you specified the login credentials in the XML file?
Thanks and Regards,
Shyam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.