You must Sign In to post a response.
  • Category: WCF

    WCF REST Service Pass object ( Class ) as parameter in POST method

    Hi ,
    I have WCF Rest Service POST Method . this method have more than 50 parameter .
    How to send the POST Parameter in WCF Rest Service ?
    i have class also how to send it and consume the c# 3.5 framework

    Response is XML Format .
  • #768928
    Hai HemzChand,
    You can create a DataContrct which will have the properties similar to the parameters which you want to send. Now this data contract class will be passed as the parameter with the operation.
    1. So first create the DataContract class
    2. Initialize the DataContract class and assign the values to the class properties.
    3. Pass the DataContract as the parameter to the operation contract.
    For more details and references, you can follow the below link:

    http://stackoverflow.com/questions/4913953/post-multiple-parameters-to-wcf-service

    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #768942
    Hi,

    follow below steps to pass multiple parameters to your wcf service.

    1) use DataContrast to avoid duplicates.
    2) use DataContractSerializer to help working with service.
    3) using webclient you can do whatever you want.

    Refer below link this might be helpful to you..
    social.msdn.microsoft.com/Forums/vstudio/en-US/8bb17e6b-3de0-488f-8f10-a8ca7d3a6188/rest-web-service-how-to-pass-multiple-parameters-

    Hope this helps you...

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/


  • Sign In to post your comments