on 01-29-2009 9:16 AM
Hello.
I have to call webservice method from controller
As described in
Link: [tutorial|http://help.sap.com/saphelp_nw04/helpdata/en/98/4845b1557b8b43a79c4cd8e4518e5f/content.htm]
I made all steps:
1. In the Data Modeler, choose the icon for Component Controller and start the respective context menu.
2. From the context menu, choose the option Apply Template.
3. Choose the Service Controller template in the displayed wizard and then Next.
as a result I defined a structure of context elements.
I've made implementation in methds wdDoInit()
wdContext.nodeCompanyCheck().bind(new Request_CompanyServiceViDocument_filterCompany0());
also I implemented logic to call webservice in another method
try {
wdContext.currentCompanyCheckElement().setACompanyId(contextElement.getCompanyID());
wdContext.currentCompanyCheckElement().modelObject().execute();
wdContext.nodeCompanyCheckResponse().invalidate();
wdContext.nodeCompanyCheckResult().invalidate();
sDebug = " <executed> ";
} catch (Exception ex) {
sDebug += getExceptionStackTrace(ex);
contextElement.setSDebug(sDebug);
wdComponentAPI.getMessageManager().reportException(getExceptionStackTrace(ex), true);
}
contextElement.setSDebug(sDebug);
As result I received runtime exception in line
wdContext.currentCompanyCheckElement().modelObject().execute();
com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.processDocumentFault(MimeHttpBinding.java:916)
com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.call(MimeHttpBinding.java:1432)
com.accenture.mdp.company.model.companybasic.proxies.Config1BindingStub.filterCompany(Config1BindingStub.java:352)
com.accenture.mdp.company.model.companybasic.proxies.Config1BindingStub.filterCompany(Config1BindingStub.java:408)
com.accenture.mdp.company.model.companybasic.Request_CompanyServiceViDocument_filterCompany0.execute(Request_CompanyServiceViDocument_filterCompany0.java:89)
com.accenture.mdp.company.components.CompanyDataEntry.onActionCheckCompany(CompanyDataEntry.java:3890)
com.accenture.mdp.company.components.wdp.InternalCompanyDataEntry.wdInvokeEventHandler(InternalCompanyDataEntry.java:1281)
com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)
com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:304)
com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:659)
com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:251)
com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)/njavax.servlet.http.HttpServlet.service(HttpServlet.java:853)
com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer
Could anybody help me ?
Hi Sergey,
Are some lines missing from the exception chain you have posted? I think some lines are missing, if yes, please post the same.
Regards.
Rajat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Problem still exist.
Can anybody hint me about the reason of exception in
com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.processDocumentFault(MimeHttpBinding.java:916)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you please print the value of wdContext.currentContextElement().getCompanyID()
and check if you are getting it correctly or not.
or can please post what exception you are getting (full exception)
Regards
Narendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sergey,
please check the below line as written by you
input.setACompanyId(contextElement.getCompanyID());
i think it should be
input.setACompanyId(wdContext.currentContextElement().getCompanyID());
please check this also.
Regards
Narendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I made this modification but I received the same exception in runtime
try {
Request_CompanyServiceViDocument_filterCompany0 input = new Request_CompanyServiceViDocument_filterCompany0();
wdContext.nodeCompanyCheck().bind(input);
input.setACompanyId(contextElement.getCompanyID());
input.execute();
wdContext.nodeCompanyCheckResponse().invalidate();
wdContext.nodeCompanyCheckResult().invalidate();
sDebug = " <executed> ";
} catch (Exception ex) {
sDebug += getExceptionStackTrace(ex);
contextElement.setSDebug(sDebug);
wdComponentAPI.getMessageManager().reportException(getExceptionStackTrace(ex), true);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let me just add that authentication is set for each webservice. So, just confirm it once with the WS developer (or execute the WS in wsnavigator) to confirm whether authentication is needed or not. We had a similar problem in the past and was resolved after re-creating a model along with the authentication parameters passed while importing the model.
Regards,
Murtuza
Hi sergey,
I think the error you got because you have binded the node incorrectly as shown in the below line of code.
wdContext.nodeCompanyCheck().bind(new Request_CompanyServiceViDocument_filterCompany0());
I think you should do it like the below code.
Request_CompanyServiceViDocument_filterCompany0() testObject = new Request_CompanyServiceViDocument_filterCompany0();
testObject.setACompanyId(contextElement.getCompanyID());
wdContext.nodeCompanyCheck().bind(testObject);
wdContext.nodeCompanyCheck().currentCompanyCheckElement().modelObject().execute();
Hope this will help as the error looks as its only because of binding miss match.
Regards
Narendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please check the execute() statement you have written.
wdContext.currentCompanyCheckElement().modelObject().execute();
can you try with the below code
wdContext.nodeCompanyCheck().currentCompanyCheckElement().modelObject().execute();
also check if you have passed all the required input parameters.
if still not resolved then can you share the full code which you have used for execution.
Regards
Narendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can try this way also for exceuting ...
Request_CompanyServiceViDocument_filterCompany input = new Request_CompanyServiceViDocument_filterCompany0();
now bind this input to node.
and u can directly execute like this....
input.execute();
try this way may be it will solve your problem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes exactly, sorry. This is continuation:
(RequestAnalizer.java:944)
com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
java.security.AccessController.doPrivileged(Native Method)
com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.