使用SQL Server 2008 R2的主数据服务调用API创建Model

复制private static ServiceClient mdsProxy; protected void Page_Load(object sender,使用数据 EventArgs e) { try { mdsProxy = CreateMdsProxy("http://devserver:8080/Service/Service.svc"); } catch (Exception ex) { Response.Redirect("Error connecting:" + ex.Message); } } private static ServiceClient CreateMdsProxy(string mdsURL) { System.ServiceModel.EndpointAddress endptAddress = new System.ServiceModel.EndpointAddress(mdsURL); System.ServiceModel.WSHttpBinding wsBinding = new System.ServiceModel.WSHttpBinding(); return new ServiceClient(wsBinding, endptAddress); } private void CreateModel(string newModelName) { MetadataCreateRequest request = new MetadataCreateRequest(); MetadataCreateResponse response = new MetadataCreateResponse(); request.Metadata = new Metadata(); request.Metadata.Models = new System.Collections.ObjectModel.Collection<Model>() { new Model() }; request.Metadata.Models[0].Identifier = new Identifier(); request.Metadata.Models[0].Identifier.Name = newModelName; response = mdsProxy.MetadataCreate(request); } protected void btnCreateModel_Click(object sender, EventArgs e) { CreateModel("TestModel"); } } 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.58.59.60.61.62.63.64.65.