Pamplemousse
Pamplemousse

Reputation: 113

Cannot use System.Object type within WCF WebService

I'm trying to create a method using the object type within my WCF WebService, but I get the following error :

Error

Interface :

    [ServiceContract]
public interface IService1
{

    [OperationContract]
   object GetTwoX(object yo);

}

Class :

public class Service1 : IService1
{
    static public Dictionary<string, List<OPUSInfo>> cache;

    public object GetTwoX(object yo)
    {
        return yo;
    }

}

Does somebody know how to pass Object type in ?

Upvotes: 1

Views: 612

Answers (1)

Jesse C. Slicer
Jesse C. Slicer

Reputation: 20157

You can definitely create a method which takes and/or returns object, but as the error says, don't expect the simplistic Test Client to be able to do anything. Use a full-featured service testing application like SoapUI to do that.

Upvotes: 1

Related Questions