Skip to Content
0
Former Member
Jan 22, 2004 at 01:23 PM

Null Pointer Exception when consuming Amazone (or Google Web) Web Service

45 Views

With our NetWeaver Developer Studio version (Version: 2.0.3, Build: 200310160341), consuming web services, which we generated out of Session Beans, works perfectly. We're using this functionality frequently.

However, when we try to consume external web services by importing the corresponding WSDL file, this only seems the work for very simple model structures (e.g. a simple currency converter web service).

When we try to consume the Amazon web service or the Google web service e.g., we get a Nullpointer exception at the moment the model is bind to the context (see further details below).

Did anyone succeed in consuming the Amazon or Google web services?

Many thanks in advance,

Rob

PS. We know that a key (Google), or keyword fields etc. (Amazon) for these web services have to be filled before the actual web service call, but our problem appears already before the .execute() method is called.

Details:

-

-


wsdl url: http://soap.amazon.com/schemas2/AmazonWebServices.wsdl

Context-Node:

SearchBooks

keywordSearchRequest

.. etc.

Response

.. etc.

wdDoInit coding:

//@@begin wdDoInit()

Request_AmazonSearchPort_keywordSearchRequest req =

new Request_AmazonSearchPort_keywordSearchRequest();

wdContext.nodeSearchBooks().bind(req); // <---HERE THINGS GO WRONG!!

//@@end

Coding for web service execution:

//@@begin onActionSearchPressed(ServerEvent)

try {

// ... fill required fields (keywords string e.g.) ...

wdContext.currentSearchBooksElement().modelObject().execute();

} catch (Exception e) {

// ...

}

wdContext.nodeResponse().invalidate();

//@@end

-

-


Error stacktrace: (appears immediately, when starting the web dynpro application)

com.sap.tc.webdynpro.services.cal.core.exceptions.ClientRuntimeException

at com.sap.tc.webdynpro.clientimpl.csf.client.CSFClient.sendResponse(CSFClient.java:489)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:573)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:48)

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:236)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:137)

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

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

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:363)

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

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

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

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

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

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

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

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

at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)

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:162)

Caused by: com.sap.tc.webdynpro.services.cal.core.exceptions.ClientRuntimeException

at com.sap.tc.webdynpro.clientimpl.csf.client.CSFUpdateClientPeer.sendResponse(CSFUpdateClientPeer.java:177)

at com.sap.tc.webdynpro.clientimpl.csf.client.CSFClient.sendResponse(CSFClient.java:486)

... 22 more

Caused by: java.lang.NullPointerException

at mode.ws.proxies.types.ComplexType_ProductInfo.setDetails(ComplexType_ProductInfo.java:150)

at mode.ws.proxies.types.ComplexType_ProductInfo.getDetails(ComplexType_ProductInfo.java:137)

at components.searchbooks.wdp.InternalSearchBooks$DetailsNode.doSupplyElements(InternalSearchBooks.java:1387)

at com.sap.tc.webdynpro.progmodel.context.Node.supplyElements(Node.java:361)

at com.sap.tc.webdynpro.progmodel.context.Node.getElementList(Node.java:325)

at com.sap.tc.webdynpro.progmodel.context.Node.createMappedElementList(Node.java:453)

at com.sap.tc.webdynpro.progmodel.context.Node.supplyElements(Node.java:348)

at com.sap.tc.webdynpro.progmodel.context.Node.getElementList(Node.java:325)

at com.sap.tc.webdynpro.progmodel.context.Node.getElements(Node.java:310)

at com.sap.tc.webdynpro.progmodel.context.Node.size(Node.java:652)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.visitNodeOrElements(DataContainerRenderer.java:601)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.visitNodeOrElements(DataContainerRenderer.java:690)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.visitNodeOrElements(DataContainerRenderer.java:690)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.visitNodeOrElements(DataContainerRenderer.java:690)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.visitNodeOrElements(DataContainerRenderer.java:690)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.visitNodeOrElements(DataContainerRenderer.java:552)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.visitNodeInfo(DataContainerRenderer.java:262)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.visitNodeInfo(DataContainerRenderer.java:285)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.visitNodeInfo(DataContainerRenderer.java:285)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.visitNodeInfo(DataContainerRenderer.java:285)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.visitNodeInfo(DataContainerRenderer.java:285)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.visitContext(DataContainerRenderer.java:181)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.visitDataContainer(DataContainerRenderer.java:127)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.data.DataContainerRenderer.render(DataContainerRenderer.java:93)

at com.sap.tc.webdynpro.clientserver.renderer.AbstractRenderManager.render(AbstractRenderManager.java:61)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.core.CSFResponseRenderer.renderDataContainerUpdates(CSFResponseRenderer.java:804)

at com.sap.tc.webdynpro.clientimpl.csf.renderer.core.CSFResponseRenderer.renderUserInterfaceUpdates(CSFResponseRenderer.java:1183)

at com.sap.tc.webdynpro.clientimpl.http.client.AbstractUpdateClientPeer.sendResponse(AbstractUpdateClientPeer.java:146)

at com.sap.tc.webdynpro.clientimpl.csf.client.CSFUpdateClientPeer.sendResponse(CSFUpdateClientPeer.java:171)

... 23 more