I have a simple class that contains the required properties for a request to the service.
I want a consumer to instantiate this class on their end, fill it up, then pass it back to the service. Maybe the terminology I’m using isn’t exactly right, but I’m sure I’ve read some project notes in the past where this was possible on other systems.
[DataContract]
public class SearchRequestObject
{
[DataMember]
public string WebsiteGuid { get; set; }
}
I have both DataContract and DataMember set in my service project. Once I publish it and consume it on another project, I don’t see SearchRequestObject anywhere. I’m guessing this is because it has to be defined in the service’s interface? If so, how?
Thanks.
Typically,
SearchRequestObjectwould be one of the objects used in one of your service methods, for instance:When your client classes are then automatically generated, they will include a
SearchRequestObjectin the reference.cs file which contains the definitions.If it’s already being included in a method, it may not be being generated because your client project has a direct reference to the project in which
SearchRequestObjectis defined, and when you create the service reference you’re reusing types from referenced assemblies. You can check if you have the reference in the references list of the client project, and if you’re reusing types from referenced assemblies in the Advanced section of the Add Service Reference dialog.