Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Exception while invoking web service

Hi all,

I am trying to consume a web service which is actually a BAPI which is being exposed as a WS. The BAPI is BAPI_COMPANYCODE_GETLIST. The following is the code that I use to execute the Web service:

/***************************Code Begins*************************/

MO_CompanyWS model_inst = new MO_CompanyWS();

Request_BAPI_COMPANYCODE_GETLIST request_para = new Request_BAPI_COMPANYCODE_GETLIST(model_inst);

BAPI_COMPANYCODE_GETLIST input_values = new BAPI_COMPANYCODE_GETLIST(model_inst);

request_para.setBAPI_COMPANYCODE_GETLIST(input_values);

wdContext.nodeRequest_BAPI_COMPANYCODE_GETLIST().bind(request_para);

try

{

wdContext.currentRequest_BAPI_COMPANYCODE_GETLISTElement().modelObject().execute();

}

catch(Exception exp)

{

wdComponentAPI.getMessageManager().reportException(

"Exception - " + exp,

true);

}

/*************************Code Ends**************************/

I am getting the exception as follows - java.io.FileNotFoundException: C:\Documents and Settings\Desktop\ZGetCompanyList.xml (The system cannot find the path specified)

at java.io.FileInputStream.open(Native Method)

at java.io.FileInputStream.<init>(FileInputStream.java:106)

at java.io.FileInputStream.<init>(FileInputStream.java:66)

at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:69)

at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:156)

Can someone help me out in getting the problem solved?

Here is the detailed exception -

com.sap.tc.webdynpro.model.webservice.exception.WSModelRuntimeException: Exception on creation of service metadata for WSDL URL ' C:\Documents and Settings\Desktop\ZGetCompanyList.xml' and service factory configuration 'null'

at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getOrCreateWsrService(WSModelInfo.java:422)

at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.readOperationsFromWSDL(WSModelInfo.java:372)

at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.importMetadataInternal(WSModelInfo.java:342)

at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.importMetadata(WSModelInfo.java:326)

at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo$Cache.getModelInfo(WSModelInfo.java:199)

at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getModelInfoFromCacheOrCreate(WSModelInfo.java:1035)

at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getModelInfoFromCacheOrCreate(WSModelInfo.java:248)

at com.sap.tc.webdynpro.model.webservice.gci.WSTypedModel.<init>(WSTypedModel.java:41)

at com.cts.wsmodel.MO_CompanyWS.<init>(MO_CompanyWS.java:51)

at com.cts.bapiws.BAPIWSView.wdDoInit(BAPIWSView.java:111)

at com.cts.bapiws.wdp.InternalBAPIWSView.wdDoInit(InternalBAPIWSView.java:233)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)

at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)

at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)

at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doOpen(WebDynproWindow.java:295)

at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.show(ApplicationWindow.java:183)

at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.open(ApplicationWindow.java:178)

at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:364)

at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:707)

at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:269)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:759)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:712)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)

at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

Caused by: com.sap.engine.services.webservices.jaxrpc.exceptions.WebserviceClientException: GenericServiceFactory initialization problem. Could not load web service model. See nested exception for details.

at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DGenericServiceImpl.generateProxyFiles(DGenericServiceImpl.java:150)

at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DGenericServiceImpl.<init>(DGenericServiceImpl.java:50)

at com.sap.engine.services.webservices.espbase.client.dynamic.GenericServiceFactory.createService(GenericServiceFactory.java:71)

at com.sap.engine.services.webservices.espbase.client.dynamic.GenericServiceFactory.createService(GenericServiceFactory.java:91)

at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getOrCreateWsrService(WSModelInfo.java:420)

... 45 more

Caused by: com.sap.engine.services.webservices.jaxrpc.exceptions.ProxyGeneratorException: Proxy Generator Error. Problem with WSDL file parsing. See nested message.

at com.sap.engine.services.webservices.jaxrpc.wsdl2java.ProxyGenerator.generateProxy(ProxyGenerator.java:182)

at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DGenericServiceImpl.generateProxyFiles(DGenericServiceImpl.java:147)

... 49 more

Caused by: com.sap.engine.lib.xml.util.NestedException: IO Exception occurred while parsing file: C:\Documents and Settings\Desktop\ZGetCompanyList.xml (The system cannot find the path specified) -> java.io.FileNotFoundException: C:\Documents and Settings\Desktop\ZGetCompanyList.xml (The system cannot find the path specified)

at com.sap.engine.services.webservices.wsdl.WSDLDOMLoader.loadDOMDocument(WSDLDOMLoader.java:1038)

at com.sap.engine.services.webservices.wsdl.WSDLDOMLoader.loadWSDLDocument(WSDLDOMLoader.java:1125)

at com.sap.engine.services.webservices.jaxrpc.wsdl2java.ProxyGenerator.generateProxy(ProxyGenerator.java:178)

... 50 more

Caused by: java.io.FileNotFoundException: C:\Documents and Settings\Desktop\ZGetCompanyList.xml (The system cannot find the path specified)

at java.io.FileInputStream.open(Native Method)

at java.io.FileInputStream.<init>(FileInputStream.java:106)

at java.io.FileInputStream.<init>(FileInputStream.java:66)

at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:69)

at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:156)

at java.net.URL.openStream(URL.java:913)

at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:201)

at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:263)

at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:280)

at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:342)

at com.sap.engine.lib.xml.parser.DOMParser.parse(DOMParser.java:101)

at com.sap.engine.lib.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:127)

at com.sap.engine.services.webservices.wsdl.WSDLDOMLoader.loadDOMDocument(WSDLDOMLoader.java:1022)

... 52 more

Thanks in advance.

~Subathra M

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question