本文介绍了这个错误说什么以及如何解决这个问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是WCF的新手并且收到此错误,请帮助我。这是错误
I am new to WCF and getting this error, please help me. this is the error
The operation ProcessPayment either has a parameter or a return type that is attributed with MessageContractAttribute. In order to represent the request message using a Message Contract, the operation must have a single parameter attributed with MessageContractAttribute. In order to represent the response message using a Message Contract, the operation's return value must be a type that is attributed with MessageContractAttribute and the operation may not have any out or ref parameters.
这是我的配置。
and here is my configurations.
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="SOAPBinding">
<security mode="None"/>
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="XMLBinding"/>
<binding name="JSONBinding"/>
</webHttpBinding>
</bindings>
<services>
<service name="BillingApi.ProductPaymentProcessing" behaviorConfiguration="ServiceBehaviorConfig">
<endpoint address="" binding="basicHttpBinding" contract="BillingApi.IProductPaymentProcessing" bindingConfiguration="SOAPBinding" />
<endpoint address="XML" binding="webHttpBinding" contract="BillingApi.IProductPaymentProcessing" behaviorConfiguration="XMLEndpointConfig" bindingConfiguration="XMLBinding" />
<endpoint address="JSON" binding="webHttpBinding" contract="BillingApi.IProductPaymentProcessing" behaviorConfiguration="JSONEndpointConfig" bindingConfiguration="JSONBinding" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="XMLEndpointConfig">
<webHttp automaticFormatSelectionEnabled="false" helpEnabled="true" defaultOutgoingResponseFormat="Xml"/>
</behavior>
<behavior name="JSONEndpointConfig">
<!--<enableWebScript/>-->
<webHttp automaticFormatSelectionEnabled="false" helpEnabled="true" defaultOutgoingResponseFormat="Json"/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviorConfig">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<!--<standardEndpoints>
</standardEndpoints>-->
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
推荐答案
这篇关于这个错误说什么以及如何解决这个问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!