简体   繁体   English

WCF webHttpBinding发布到Apache服务

[英]WCF webHttpBinding post to apache service

I am trying to communicate with an Apache service from a WCF client 我正在尝试从WCF客户端与Apache服务进行通信

I have set up the client like this: 我已经这样设置了客户端:

<client>
    <endpoint name="ApacheService" 
              address="SomeUrl" 
              behaviorConfiguration="ApacheBehavior" 
              binding="webHttpBinding" 
              contract="ISomeContrect" />
</client>
<behaviors>
    <endpointBehaviors>
        <behavior name="ApacheBehavior">
            <webHttp />
        </behavior>
    </endpointBehaviors>
</behaviors>

and my contract looks like 我的合同看起来像

    [OperationContract]
    [WebInvoke(Method = WebRequestMethods.Http.Post, 
               RequestFormat = WebMessageFormat.Json, 
               BodyStyle = WebMessageBodyStyle.Bare,
               UriTemplate = "?user={username}&action=someaction")]
    void dosomeaction(string username, List<SomeJSONSerializableObject> data);

Don't know what framework is used on the receiving side but the user and action variables are presented as get variables and the json payload is not seen at all. 不知道接收方使用什么框架,但是用户变量和操作变量显示为get变量,而根本看不到json负载。

debug started
post:
Array
(
)
get:
Array
(
    [user] => someusername
    [action] => someaction
)
json:

I did some local tests with a WCF service and it works fine. 我使用WCF服务进行了一些本地测试,并且工作正常。

Any ideas what ca be wrong? 任何想法可能是错误的吗?

Never mind. 没关系。 It was some error on the Apache side Apache方面有些错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM