Click here to Skip to main content
15,845,785 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created a WCF Service and I am wondering why the methods that I created i.e. UploadDocument and getDocument are not showing up within the test dialog, any ideas please?

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace DocumentService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    public class Service1 : IService1
    {
        public string GetData(int value)
        {
            return string.Format("You entered: {0}", value);
        }

        public CompositeType GetDataUsingDataContract(CompositeType composite)
        {
            if (composite == null)
            {
                throw new ArgumentNullException("composite");
            }
            if (composite.BoolValue)
            {
                composite.StringValue += "Suffix";
            }
            return composite;
        }

        public bool UploadDocument(Object document)
        {
            // 1. upload the document and save it to web server
            // 2. return successful as true, and, error message if there is an exception
            return true;
        }

        public Object getDocument(String searchFor)
        {
            //1. Search for the document
            //2. return flag indicating whether the search was successful.
            return true;
        }
    }
}


References
1. Andrew Troelsen, Pro C# 5.0 and the .NET 4.5 Framework, published by Apress
Posted
Comments
Kornfeld Eliyahu Peter 15-Jun-14 6:03am    
Does the method listed in IService1 with Operationcontract attribute?

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