I need to know how does svcutil and Visual Studio decide which types can be re-used from referenced assemblies when generating a web service proxy class.
I have an assembly with some types that are declared like this:
namespace MYCOMPANY.BO.Accounting
{
[Serializable, DataContract]
public class AccountingPackagePutRequest : Request
{
// Fields
[DataMember]
public IBooking[] bookings;
[DataMember]
public IDocument[] documents;
// Methods
public AccountingPackagePutRequest();
}
}
Now I have an ASP.NET 2.0 web service (ASMX) that is declared like this:
[WebService(Namespace = "uri://my_company.com/XXXImport")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class GLSImportAccountingPackagePut : System.Web.Services.WebService
{
[WebMethod]
public MYCOMPANY.BO.Accounting.AccountingPackagePutResponse AccountingPackagePut(MYCOMPANY.BO.Accounting.AccountingPackagePutRequest request)
{
return new MYCOMPANY.BO.Accounting.AccountingPackagePutResponse();
}
}
Now I can't force VS nor svcutil to re-use types from the first assembly on the client when generating a proxy class for this web service.
However if I create a similar web service in WCF and try to generate a proxy class for it types from the first assembly are re-used.
What is the problem here and how can I force VS or svcutil to reuse the types for the ASP.NET 2.0 (ASMX) version of the web service?