Comments (18)
已经注册了,请在网关修改
from surging.
拉取最新代码?
from surging.
public static void TestForRoutePath(IServiceProxyProvider serviceProxyProvider)
{
Dictionary<string, object> model = new Dictionary<string, object>();
model.Add("user", new
{
Name = "fanly",
Age = 18,
UserId = 1
});
string path = "api/user/getuser";
string serviceKey = "User";
var userProxy = serviceProxyProvider.Invoke<object>(model, path, serviceKey);
var s = userProxy.Result;
Console.WriteLine("Press any key to exit...");
Console.ReadLine();
}
from surging.
在客户端调用服务端的时候 发生错误给定的密钥不在字典当中不知是什么意思,服务端提示消息发送失败。 @fanliang11
from surging.
Dictionary<string, object> model = new Dictionary<string, object>
{
{
"audit", JsonConvert.SerializeObject(new
{
UserName = "simple",
Action = "testaction",
MentodName = "test",
MethodParams = "params",
OperatorIp = "127.0.0.1"
})
}
};
string path = "api/audit/insertAuditAsync";
string serviceKey = "Audit";
var userProxy = serviceProxyProvider.Invoke<object>(model, path, serviceKey); 调用方法是这样
from surging.
不需要再JsonConvert.SerializeObject
from surging.
serviceProxyProvider.Invoke(model, path, serviceKey);
不推荐使用,因为不支持缓存拦截
from surging.
不是这样的,在源码的demo中JsonConvert.SerializeObject 有这个也是可以调用成功,nuget上下载的,有没有JsonConvert.SerializeObject 都会报出这样的错误
from surging.
因为不想去引用服务的dll,所以用serviceProxyProvider.Invoke(model, path, serviceKey)这种方式
from surging.
贴下你的方法参数
from surging.
ModuleName 设置的什么
from surging.
from surging.
ModuleName 设置的是Audit
from surging.
from surging.
Dictionary<string, object> model = new Dictionary<string, object>
{
{
"entity", new
{
UserName = "simple",
Action = "testaction",
MentodName = "test",
MethodParams = "params",
OperatorIp = "127.0.0.1"
}
}
};
string path = "api/audit/insertAuditAsync";
string serviceKey = "Audit";
var userProxy = serviceProxyProvider.Invoke(model, path, serviceKey);
试试
from surging.
ok,调用成功,感谢作者。这里实体的时候 字典的键 都必须是entity?
from surging.
记得点个赞
from surging.
嗯呐,测试完了之后,会写个博客把踩了的坑 都写出来,大家一起学习。
from surging.
Related Issues (20)
- 单服务热加载问题 HOT 3
- 用jmeter对sayhello做压力测试时,返回结果不一致,entity为1 HOT 1
- k8s
- k8s中单服务重发之后 提示如下 HOT 3
- The community version is the last version. HOT 3
- new feature Protokollwandler component will be updated in SurgingVista version
- 统计一下有多少人使用社区版 HOT 1
- Hot deployment modules and components
- 请问Surging 中使用的 WebSocketCore 的源码是这个地址吗 HOT 1
- server进程占用的内存一直增长,直到进程崩溃,是什么原因? HOT 11
- NLog HOT 6
- surgingSettings.json配置中的Consul 连接ConnectionString配置 HOT 1
- Surging.Core.KestrelHttpServer HOT 1
- 请求参数
- 开源**NCC介绍 HOT 4
- 使用serviceProxyProvider.Invoke调用接口内存持续增长 HOT 4
- TCP network components that support configuring properties
- 服务间通讯导致内存持续增加 HOT 5
- skywalking报错 HOT 2
- 关于使用VS0222附加调试,偶尔出现VS进程一直无响应的问题 HOT 2
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 surging.