【发布时间】:2011-07-31 11:19:43
【问题描述】:
我正在尝试从 WCF 客户端与 Apache 服务通信
我已经这样设置了客户端:
<client>
<endpoint name="ApacheService"
address="SomeUrl"
behaviorConfiguration="ApacheBehavior"
binding="webHttpBinding"
contract="ISomeContrect" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="ApacheBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
我的合同看起来像
[OperationContract]
[WebInvoke(Method = WebRequestMethods.Http.Post,
RequestFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Bare,
UriTemplate = "?user={username}&action=someaction")]
void dosomeaction(string username, List<SomeJSONSerializableObject> data);
不知道接收端使用什么框架,但用户和操作变量显示为 get 变量,根本看不到 json 有效负载。
debug started
post:
Array
(
)
get:
Array
(
[user] => someusername
[action] => someaction
)
json:
我使用 WCF 服务进行了一些本地测试,它运行良好。
有什么想法会出错吗?
【问题讨论】:
标签: wcf apache wcf-client webhttpbinding