Issues with generating .net 2.0 client for consuming a WCF service
hi all,
I have created a WCF service and specified message contracts for defining how a request should be sent when invoking a WCF method and also the response. I am using a Windows Service to host the WCF service. The service runs fine and there are no issues with that.
The problem is when I try to generate the proxy class (.Net 2.0 client), I am getting a warning as shown below
Warning: This web reference does not conform to WS-I Basic Profile v1.1.
R2710: The operations in a wsdl:binding in a DESCRIPTION MUST result in wire signatures that are different from one another. An end
oint that supports multiple operations must unambiguously identify the operation being invoked based on the input message that it r
ceives. This is only possible if all the operations specified in the wsdl:binding associated with an endpoint have a unique wire si
nature.
- Input message 'SecurityRequest' from namespace 'http://tempuri.org/' has wire signature 'http://XXX.Platform.Caching.Servic
Contracts/2007/01:SecurityRequest'.
- Input message 'SecurityRequest' from namespace 'http://tempuri.org/' has wire signature 'http://XXX.Platform.Caching.Servic
Contracts/2007/01:SecurityRequest'.For more details on the WS-I Basic Profile v1.1, see the specification
at http://www.ws-i.org/Profiles/BasicProfile-1.1.html.Before adding the message contracts for the request and response, I could create the proxy class for my .net 2.0 client without any warnings and issues and could call the methods of the WCF. But after adding the message contracts I am getting the above issue. All my methods that are exposed by the WCF have unique names.
If anybody has encountered this issue before it would be great to know the fix for it.
Thanks
Kiran.
Answers
Kiran,
The information you have included is not enough for investigating this issue. It would be a lot more useful for me to see the server-side code. I need the following:
1) Service contract
2) Service class (you can remove the implementation of each operation contract)
3) Code or config that creates the ServiceHost, adds endpoints and starts up the service
Thanks.
All Replies
Hello,
1) Are you creating your proxy using wsdl.exe?
2) Can you post the definitions of your message contracts as well as your service contract?
Thanks.
1)Yes, I am creating the proxy using WSDL.exe
2)As for the service contract definition its shown below
a)A part of the original Service Contract.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace xxx.Platform.Caching.ServiceContracts
{
using System.ServiceModel;
using System.Collections;
[System.ServiceModel.ServiceContractAttribute(Namespace = "http://xxx.Platform.Caching.ServiceContracts/2007/01", Name = "IxxxSecurityCache")]//,XmlSerializerFormatAttribute]
public interface IxxxSecurityCache
{
#region Cache method definitions[System.ServiceModel.OperationContractAttribute(Action = "RegisterPortalCacheManager")]
SecurityResponse RegisterPortalCacheManager(SecurityRequest sr);[System.ServiceModel.OperationContractAttribute(Action = "AddObjectSecurityListToCache")]
void AddObjectSecurityListToCache(SecurityRequest sr);[System.ServiceModel.OperationContractAttribute(Action = "ForceRefreshOnUserInCache")]
SecurityResponse ForceUserRefresh(SecurityRequest sr);#endregion
#region SecurityManager method definitions
[System.ServiceModel.OperationContractAttribute(Name = "HasPrivilege", Action = "HasPrivilege")]
SecurityResponse HasPrivilege(SecurityRequest sr);[System.ServiceModel.OperationContractAttribute(Action = "ResolveObjectSecurity")]
SecurityResponse ResolveObjectSecurity(SecurityRequest sr);[System.ServiceModel.OperationContractAttribute(Action = "CanCreateChildObject")]
SecurityResponse CanCreateChildObject(SecurityRequest sr);#endregion
#region Test
[System.ServiceModel.OperationContractAttribute(Action = "TestMethod")]
SecurityResponse TestMethod();
#endregion
}
}b)Message Contract definition
I have created a Request Message contract called "SecurityRequest" and a Response Message Contract called "SecurityResponse" . I am only attaching a portion of the message contracts. Their definitions are as shown below
SecurityRequest Message contract:
using System.ServiceModel;
using System.Collections;namespace xxx.Platform.Caching.ServiceContracts
{
[MessageContract]
public class SecurityRequest
{
private System.Int32 _fieldPortalID;
private System.Int32 _fieldRoleFirewallItemID;
private System.Int64 _fieldPortalObjectID;
private System.Int32 _fieldUserID;
private ObjectPrivilege _fieldprivilegeBits;
private ObjectPrivilege _fieldprivilegeToHave;
private System.Int64 _fieldObjectID;
private System.Int32 _fieldchildObjectTypeId;private System.Int64 _fieldparentObjectId;
private System.Int32 _fieldorganizationId;
private RoleType _fieldroleTypeId;
private System.Int32 _fieldobjectTypeId;
private System.Int64 _fieldUserItemObjectID;
private System.Int64 _fieldIdentityObjectId;
[MessageBodyMember(Order = 1)]
public System.Int32 PortalID
{
get { return _fieldPortalID; }
set { _fieldPortalID = value; }
}
[MessageBodyMember(Order = 2)]
public System.Int64 PortalObjectID
{
get { return _fieldPortalObjectID; }
set { _fieldPortalObjectID = value; }
}
[MessageBodyMember(Order = 3)]
public System.Int32 UserID
{
get { return _fieldUserID; }
set { _fieldUserID = value; }
}[MessageBodyMember(Order = 4)]
public ObjectPrivilege PrivilegeBits
{
get { return _fieldprivilegeBits; }
set { _fieldprivilegeBits = value; }
}[MessageBodyMember(Order = 5)]
public int ItemId
{
get { return _fielditemId; }
set { _fielditemId = value; }
}[MessageBodyMember(Order = 6)]
public int ControlId
{
get { return _fieldcontrolId; }
set { _fieldcontrolId = value; }
}[MessageBodyMember(Order = 7)]
public int GroupId
{
get { return _fieldgroupId; }
set { _fieldgroupId = value; }
}[MessageBodyMember(Order = 8)]
public int RoleId
{
get { return _fieldRoleID; }
set { _fieldRoleID = value; }
}[MessageBodyMember(Order =9)]
public int RoleFirewallItemID
{
get { return _fieldRoleFirewallItemID; }
set { _fieldRoleFirewallItemID = value; }
}}
}
SecurityResponse Message Contract:using System.ServiceModel;
namespace xxx.Platform.Caching.ServiceContracts
{
[MessageContract]
public class SecurityResponse
{
private System.Boolean _returnStatus;
private System.Int32 _returnInt;
private System.Int64 _returnLong;
private System.String _returnTestMethod;
private ObjectPrivilege _returnObjectPrivilege;
[MessageBodyMember(Order = 1)]
public System.Boolean ReturnStatus
{
get { return _returnStatus; }
set { _returnStatus = value; }}
[MessageBodyMember(Order = 2)]
public System.Int64 ReturnLong
{
get { return _returnLong; }
set { _returnLong = value; }}
[MessageBodyMember(Order = 3)]
public System.String TestMethod
{
get { return _returnTestMethod; }
set { _returnTestMethod = value; }
}[MessageBodyMember(Order = 4)]
public ObjectPrivilege ReturnObjectPrivilege
{
get { return _returnObjectPrivilege; }
set { _returnObjectPrivilege = value; }
}[MessageBodyMember(Order = 5)]
public System.Int32 ReturnInt
{
get { return _returnInt; }
set { _returnInt = value; }
}
}
}Thanks
Kiran.
Mohammad,
I have sent the definitions of my message contracts. Any idea what could have gone wrong. I mean everything works fine if I do not use message contracts. Its only when I use message contracts that I get this warning while building the proxy for my .Net 2.0 client.
Thanks
Kiran.
Kiran,
The information you have included is not enough for investigating this issue. It would be a lot more useful for me to see the server-side code. I need the following:
1) Service contract
2) Service class (you can remove the implementation of each operation contract)
3) Code or config that creates the ServiceHost, adds endpoints and starts up the service
Thanks.


