Mobilefirst 7.0 soapadapter无法调用无参数操作

时间:2015-06-17 19:30:04

标签: soap ibm-mobilefirst mobilefirst-adapters

我使用webservice wsdl文件通过向导创建了一个soapadapter。大多数操作成功运行一个。此特定操作返回一个对象数组,不使用任何参数。 示例过程参数是:

{
  "recuperaVariabili": {
  }
}

调用该过程,永远不会调用onSuccess或onFailure函数。查看MobileFirst服务器日志,我可以看到以下stacktrace:`

[ERROR   ] FWLSE0099E: An error occurred while invoking procedure  [project FinancialGuardian]SoapAdapter1/RischiServiceService_recuperaVariabiliFWLSE0100E:  parameters: [project FinancialGuardian]
TypeError: Cannot read property "children" from undefined (2015-06-12T15:19:59.479Z/198f6d0c5bd3a9763e35dfa0268338bb84d5cfae/SoapAdapter1-impl.js#1134)
FWLSE0101E: Caused by:  [project FinancialGuardian]nullorg.mozilla.javascript.EcmaError: TypeError: Cannot read property "children" from undefined (2015-06-12T15:19:59.479Z/198f6d0c5bd3a9763e35dfa0268338bb84d5cfae/SoapAdapter1-impl.js#1134)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3687)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3665)
    at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3693)
    at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3712)
    at org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3725)
    at org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:1432)
    at org.mozilla.javascript.Interpreter.doGetElem(Interpreter.java:2204)
    at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1260)
    at script.handleMappings(2015-06-12T15:19:59.479Z/198f6d0c5bd3a9763e35dfa0268338bb84d5cfae/SoapAdapter1-impl.js:1134)
    at script.buildBody(2015-06-12T15:19:59.479Z/198f6d0c5bd3a9763e35dfa0268338bb84d5cfae/SoapAdapter1-impl.js:1117)
    at script.RischiServiceService_recuperaVariabili(2015-06-12T15:19:59.479Z/198f6d0c5bd3a9763e35dfa0268338bb84d5cfae/SoapAdapter1-impl.js:960)
    at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
    at com.worklight.integration.js.JavaScriptManager.callFunction(JavaScriptManager.java:267)
    at com.worklight.integration.js.JavaScriptManager.invokeFunction(JavaScriptManager.java:241)
    at com.worklight.integration.js.JavaScriptManager.invokeFunction(JavaScriptManager.java:211)
    at com.worklight.integration.services.impl.AdapterManagerImpl.invokeFunction(AdapterManagerImpl.java:125)
    at com.worklight.integration.js.JavaScriptProcedureInvoker.invoke(JavaScriptProcedureInvoker.java:42)
    at com.worklight.integration.model.ProcedureInvoker.invokeProcedure(ProcedureInvoker.java:54)
    at com.worklight.integration.model.Procedure.invoke(Procedure.java:166)
    at com.worklight.integration.services.impl.DataAccessServiceImpl.callProcedureInternal(DataAccessServiceImpl.java:676)
    at com.worklight.integration.services.impl.DataAccessServiceImpl.callProcedure(DataAccessServiceImpl.java:622)
    at com.worklight.integration.services.impl.DataAccessServiceImpl.access$100(DataAccessServiceImpl.java:69)
    at com.worklight.integration.services.impl.DataAccessServiceImpl$3.execute(DataAccessServiceImpl.java:504)
    at com.worklight.core.auth.impl.AuthenticationServiceBean.accessResource(AuthenticationServiceBean.java:76)
    at com.worklight.integration.services.impl.DataAccessServiceImpl.invokeProcedureInternal(DataAccessServiceImpl.java:501)
    at com.worklight.integration.services.impl.DataAccessServiceImpl.invokeProcedure(DataAccessServiceImpl.java:155)
    at com.worklight.gadgets.serving.handler.BackendQueryHandler.getContent(BackendQueryHandler.java:95)
    at com.worklight.gadgets.serving.handler.BackendQueryHandler.doPost(BackendQueryHandler.java:56)
    at com.worklight.gadgets.serving.GadgetAPIServlet.doGetOrPost(GadgetAPIServlet.java:148)
    at com.worklight.gadgets.serving.GadgetAPIServlet.doPost(GadgetAPIServlet.java:108)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1275)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:766)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:472)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:135)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
    at com.worklight.core.auth.impl.AuthenticationFilter$1.execute(AuthenticationFilter.java:215)
    at com.worklight.core.auth.impl.AuthenticationServiceBean.accessResource(AuthenticationServiceBean.java:76)
    at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:220)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:86)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:975)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1097)
    at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:81)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:912)
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:262)
    at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:938)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

我错过了什么?

1 个答案:

答案 0 :(得分:1)

我检查了您提供的WSDL,对于 recuperaVariabili 服务,输入参数定义为:

<element name="recuperaVariabili">
  <complexType/>
</element>

我认为空 complexType 会混淆适配器生成器,因为它可能期望为该复杂类型定义一些元素/属性。我必须说这是XSD / WSDL中的有效声明,因此MF应该能够处理这种情况。

我可以想到两个快速修复,直到它将在MF中修复:

1)更新适配器的 RischiServiceService_recuperaVariabili 函数,以便映射变量应该是这样的:

var mappings = { 
  roots: {
   'recuperaVariabili': { nsPrefix: 'impl', type: 'impl:recuperaVariabili' }                
  },
  types: { 'impl:recuperaVariabili': {
    children: []
    }
  }
};

2)更新WSDL,使声明的元素为 simpleType