Add Service Reference and MessageContract

Topics: General Discussion Forum, July and December Releases Forum, Service Factory Modeling Edition Forum
Jun 4, 2007 at 6:29 PM
Hi, I modeled my service using the messagecontract approach (Request/Response parameter/return value). The problem is when I run the "Add Service Reference recipies", the proxy generated translate the CreateOrganizationRequest members to actual operation (method) parameters - see below

Look like the svcutil.exe is not invoked with /messagecontract flag.

Any idea?
Thanks
Stephane


OperationContract
void CreateOrganization(CreateOrganizationRequest request)

translated to:
void CreateOrganization(OrganizationInfo request)

[MessageContract(WrapperName = "CreateOrganizationRequest",
WrapperNamespace = "http://sasas/")]
public class CreateOrganizationRequest
{
private OrganizationInfo _organizationInfo;

MessageBodyMember(Name = "Organization", Order = 0)
public OrganizationInfo Organization
{
get { return _organizationInfo; }
set { _organizationInfo = value; }
}
}


[DataContract(Namespace = "http://sasas/",
Name = "OrganizationInfo")]
public partial class OrganizationInfo
{
private System.String _organizationName;
private System.String _organizationDescription;
private LocationInfo _locationInfo;

DataMember(Name = "Name", IsRequired = true, Order = 0)
public System.String Name
{
get { return _organizationName; }
set { _organizationName = value; }
}

DataMember(Name = "Description", IsRequired = true, Order = 1)
public System.String Description
{
get { return _organizationDescription; }
set { _organizationDescription = value; }
}

DataMember(Name = "LocationInfo", IsRequired = true, Order = 2)
public LocationInfo LocationInfo
{
get { return _locationInfo; }
set { _locationInfo = value; }
}


}
Developer
Jun 4, 2007 at 11:04 PM
I'm not sure if I understand your scenario but the "Add Service Reference" recipe does not use svcutil whatsoever. However, it does use the same API of svcutil tool, so perhaps the generation is being done without that setting (/messagecontract ), nevertheless this should be working as well. Perhaps you might have a namespace issue.
Did you try removing/updating the "WrapperNamespace" in the MessageContract attribute?
Jun 5, 2007 at 1:25 PM
Thanks for the help, yes I tried without the WrapperNamespace attribute value. It may work but my goal is to have request/response type parameters/ret value.
I think the web service factory Add Service Reference recipies should expose options for generating the client proxy such as /messagecontract.
To solve the problem, I had to use the svcutil.exe command line tool directly.

Stephane


charlyfriend wrote:
I'm not sure if I understand your scenario but the "Add Service Reference" recipe does not use svcutil whatsoever. However, it does use the same API of svcutil tool, so perhaps the generation is being done without that setting (/messagecontract ), nevertheless this should be working as well. Perhaps you might have a namespace issue.
Did you try removing/updating the "WrapperNamespace" in the MessageContract attribute?