Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi, 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
<?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>
Posted

1 solution

This is not configuration problem. The error is pretty self-explanatory: ProcessPayment operation is not declared properly.
Either it has multiple parameters of which at least one is marked as MessageContract, or returns a type marked as MessageContract but has out parameter(s).

If you have input parameter marked as MessageContract it must be the only parameter.
If you return a MessageContract, you can't have any out or ref parameters.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900