cancel
Showing results for 
Search instead for 
Did you mean: 

Exception while calling webservice

Former Member
0 Kudos

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 ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (8)

Answers (8)

Former Member
0 Kudos

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)

Former Member
0 Kudos

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

Former Member
0 Kudos

full exception log above,

I substituted

input.setACompanyId(contextElement.getCompanyID());

on

input.setACompanyId("0008");

in order to understand that problem is not in this code

Former Member
0 Kudos

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

Former Member
0 Kudos

I described it explicitly

input.setACompanyId("0008");

But still I have problem

Former Member
0 Kudos

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);
	  }

Former Member
0 Kudos

I just tried to call execute this way

wdContext.nodeCompanyCheck().currentCompanyCheckElement().modelObject().execute();

But exception still remains

Former Member
0 Kudos

Hi,

Could you please give your node structure once so that your code can be validated with the node structure.

Regards,

Murtuza

Former Member
0 Kudos

Here is my model binding

picture: [http://haxt.narod.ru/modelbinding.JPG]

Former Member
0 Kudos

Hi,

Few questions:

1. Does your WS require authentication? If yes then while importing the WS, did you give the username and pwd?

2. Is company Id only the mandatory parameter? If there are some other mandatory parameters then set their values too before executing the WS.

Regards,

Murtuza

Former Member
0 Kudos

1. authentication is not necessary, other calls of webservice works well

2. CompanyId is only one mandatory parameter

Former Member
0 Kudos

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

Former Member
0 Kudos

I run this webservice in testwebservice screen and authentication is not needed

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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)