Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Xpages上使用jsonRpcService时出错_Xpages_Lotus Notes_Xpages Ssjs_Xpages Extlib - Fatal编程技术网

在Xpages上使用jsonRpcService时出错

在Xpages上使用jsonRpcService时出错,xpages,lotus-notes,xpages-ssjs,xpages-extlib,Xpages,Lotus Notes,Xpages Ssjs,Xpages Extlib,我试图使用jsonRpcService在控制台上打印一个值。只是为了测试。 但当我调用该方法时,我在浏览器控制台上收到以下错误: POST http://localhost/Teste.nsf/Teste.xsp/RpcService?$$viewid=!ei0pdt23xx! 400 (Bad Request) Error: Unable to load /Teste.nsf/Teste.xsp/RpcService?$$viewid=!ei0pdt23xx! status:400(…)

我试图使用jsonRpcService在控制台上打印一个值。只是为了测试。 但当我调用该方法时,我在浏览器控制台上收到以下错误:

POST http://localhost/Teste.nsf/Teste.xsp/RpcService?$$viewid=!ei0pdt23xx! 400 (Bad Request)
Error: Unable to load /Teste.nsf/Teste.xsp/RpcService?$$viewid=!ei0pdt23xx! status:400(…)  
Unable to load /Teste.nsf/Teste.xsp/RpcService?$$viewid=!ei0pdt23xx! status:400  
Error: Unable to load /Teste.nsf/Teste.xsp/RpcService?$$viewid=!ei0pdt23xx! status:400(…)  
Error: Unable to load /Teste.nsf/Teste.xsp/RpcService?$$viewid=!ei0pdt23xx! status:400(…)
以下是错误的图像:

我已经为这个错误寻找了很多解决方案,但什么也没有得到

这是我正在使用的代码:

<xe:jsonRpcService id="jsonRpcService1" serviceName="metodos"
    pathInfo="RpcService">
<xe:this.methods>
    <xe:remoteMethod name="teste" script="print('teste')"></xe:remoteMethod>
</xe:this.methods>
</xe:jsonRpcService>
有人知道我做错了什么吗


谢谢

您必须在脚本中返回一个值,您的客户端必须使用回调函数等待回答

这是一个工作示例:


当您点击按钮“Test”时,一个警告框显示消息“teste”


您可以在
返回'teste'
之前添加其他代码,就像原始的
打印('teste')
一样。脚本只需返回一些内容…

“metodos”是jsonRpcService的名称。浏览器会识别它,如果我使用“metodos.teste()”,函数将被调用,但在此之后,服务返回一个错误,由于该错误,我无法处理函数的返回。谢谢,这就是问题所在。Knut,在我的本地应用程序上,此代码有效,但是当我把它放在服务器上的另一个应用程序上时,代码会返回相同的错误。你知道有什么可能的原因吗?我想这个错误是由一些服务器配置引起的。我会尽力解决的。如果我成功了,我会在这里发布。在这里进行测试,我意识到如果我重新启动http服务器,代码工作得很好,但是当我登录服务器上的任何数据库时,即使我注销,代码也会停止工作。
metodos.teste()