Comments (5)
@idevz 谢谢你的回复。第一个问题我去咨询了公司php同事,确实是错误的。第二个问题。感谢example项目,我发现我的问题并正常处理了。问题原因:原来只是java之间的rpc调用。服务端没有设置setSerialization。加上后可正常调用。
再次感谢
from motan-php.
java端服务:采用硬编码形式提供服务;
php端调用:安装motan-go,启动的agent,配置服务形式;
采用zookeeper注册中心, 协议motan2
是否需要贴java服务启动代码和agent配置文件(协议:motan2,序列化:simple)?
from motan-php.
换了下java端参数的形式,使用Map可以正常接收,但是我看Simple序列化中是支持String/Map/byte[]的。我看源码中是会判断instanceof String的,但是还是会到异常中提示个obj的类型是:java.lang.String
from motan-php.
回复内容Motan.php的104行还是无法解析,
java返回String:
Motan/Endpointer.php(96): Motan\Serialize\Motan->deserialize(NULL, '\nhello GD !')
java返回Map:
Motan/Endpointer.php(96): Motan\Serialize\Motan->deserialize(NULL, 'H\x04name\nhello GD...')
java返回utf-8编码byte[]
Motan/Endpointer.php(96): Motan\Serialize\Motan->deserialize(NULL, '*hello GD !')
from motan-php.
@dreamshit 你的问题 1 中,Java 服务端定义的方法参数为 string
public String sayHello(String name)
,但是你 PHP 调用的时候,确是 sayHello(['name'=>''])
map,所以报错 SimpleSerialization not support type:class java.lang.String
。
你的问题 2 ,我这里复现不出来,但是请确保你客户端调用的方法传参与服务端定义的形参保持一致。
另外你可以参考我们 Motan 生态的一个 motan-example项目,里面有所有 Motan 支持的跨语言调用,以及 Weibo-Mesh 的用例。
from motan-php.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from motan-php.