Continuing this and this questions. I have two service contract with the same methods:
[ServiceContract]
public interface IServices1
{
[OperationContract]
string GetData(int value);
}
[ServiceContract]
public interface IServices2
{
[OperationContract]
string GetData(int value);
}
And service:
public class Service : IServices1, IServices2
{
string IServices1.GetData(int value)
{
return string.Format("You entered: {0}", value);
}
string IServices2.GetData(int value)
{
return string.Format("You entered: {0}", value);
}
}
According to reasons beyond my control:
- this answer not for me, I need to keep the original names.
- this answer not for me, I need single wsdl file. If you use a different namespaces, when you try to open single wsdl from service main page (http://addresToService/Service.svc?singleWsdl) get the error:
System.NotSupportedException: A single WSDL document could not be generated for this service. Multiple service contract namespaces were found (IServices1, IServices2). Ensure that all your service contracts have the same namespace.
- I need one service with several endpoints.
- I need service like this (preferably on WCF).
Summarizing, I need WCF service with multiple service contracts with duplicate method names in single wsdl. Is there a way to achieve it?
<portType name="RegistrationSoapPort">
have<operation name="AcceptRequest" parameterOrder="RequestID">
and<portType name="CertRequestSoapPort">
have<operation name="AcceptRequest" parameterOrder="RequestID Request">
in one namespace. – Alexey