When adding the service reference this way, each generated message contract is decorated in similar way as following one:
[DebuggerStepThrough]
[GeneratedCode( "System.ServiceModel", "4.0.0.0" )]
[MessageContract( WrapperName = "GetCourseList", WrapperNamespace = "urn:CoursesIntf-ICourses",
IsWrapped = true )]
public partial class GetCourseListRequest
{
[MessageBodyMember( Namespace = "", Order = 0 )]
public string licence;
public GetCourseListRequest()
{
}
public GetCourseListRequest( string licence )
{
this.licence = licence;
}
}
Each generated operation contract is decorated in similar way as following one:
[GeneratedCode( "System.ServiceModel", "4.0.0.0" )]
[ServiceContract( ConfigurationName = "ServiceReferences.ICourses" )]
public interface ICourses
{
[OperationContract( Action = "urn:CoursesIntf-ICourses#GetCourseList", ReplyAction = "*" )]
[XmlSerializerFormat( Style = OperationFormatStyle.Rpc, SupportFaults = true,
Use = OperationFormatUse.Encoded )]
[ServiceKnownType( typeof( TCourse ) )]
GetCourseListResponse GetCourseList( GetCourseListRequest request );
// Remaining operation contracts omitted
}
Check the Reference.cs
to determine whether your message and operation contracts are decorated same way. If they are, the issue lies elsewhere. Exception message would be helpful to track down the issue (e.g. it may be the order of elements in returned SOAP message).
Add Service Reference
or you have built it manually? – Rest Wing