Returning custom return types(fully qualified namespace) with wcf service svcutil
-
Hi all, I have WCF service (Service1) with webservice methods, few of these webmethods are returning custom classes from a library (dll), this library contains all Serializable classes & few typed datasets. for example dll root namespace is ABC.XYZ.BusinessEntities and it has few sub namespaces like .Entities & .Contracts. 1) i have specified the following at IService.cs file
[ServiceContract(Namespace = "urn:ABC.XYZ.WSTT")]
[XmlSerializerFormat]
[ServiceKnownType(typeof(CustomDataSet1))] //typed dataset
[ServiceKnownType(typeof(Employee))] //custom class
public interface IService- class level i specified as
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
[ServiceBehavior(Namespace = "urn:urn:ABC.XYZ.WSTT")]
public class Service : IService
{
//fun1 returns typeddataset1
public CustomDataSet1 GetDataSet1() {}//fun2 retuns employee1 public Employee GetEmployee(int empID) { return XYZDataManager.GetEmployee(empID); }
}
- i confirgured as bindingConfiguration="basicHttpBindingWindows and now WCF service is working fine. i have generated proxy using
svcutil.exe http://localhost/WSTT/Service.svc?wsdl /r:..\..\BusinessEntities\bin\Debug\ABC.XYZ.BusinessEntities /ser:Auto /out:ServiceClient.cs /noConfig
and finally if i build my client project, GetEmployee return type should be "ABC.XYZ.BusinessEntities.Employee" instead i am getting just as Employee. How do i get the fully qualified custom return types in proxy? please help any thing wrong i did?
Ramana