diff --git a/samples/master-data-services/BusinessRules/README.md b/samples/master-data-services/BusinessRules/README.md index 66ac288f..3f3bb6e9 100644 --- a/samples/master-data-services/BusinessRules/README.md +++ b/samples/master-data-services/BusinessRules/README.md @@ -4,28 +4,35 @@ The next step creates a member that causes a business rule validation error (add For every action that changes the business rule status (creates, edits, excludes, and deletes), the business rule must be published to finalize the change. Please set the MDS URL (plus /Service/Service.svc) to mdsURL in Program.cs. + +```C# string mdsURL = @"http://localhost/MDS/Service/Service.svc"; +``` Program.cs uses Reference.cs (the service reference class file) that was generated by using Visual Studio to access MDS Web service API. You may need to regenerate Reference.cs in case when MDS Web service API is changed. To generate Reference.cs using Visual Studio: + You need to expose the WSDL. Exposing the WSDL is only necessary at the time when you want to generate proxy classes using a client development tool such as Visual Studio. After a proxy has been generated, the WSDL does not need to be exposed going forward for client programs to call the API. To enable an http/https Get on the WSDL: -1. Open the MDS web.config file in a text editor (\Microsoft SQL Server\Master Data Services\WebApplication\web.config). -2. Search for the tag serviceMetadata and set httpGetEnabled to true (or httpsGetEnabled if using SSL). + +1. Open the MDS web.config file in a text editor (\Microsoft SQL Server\Master Data Services\WebApplication\web.config). +2. Search for the tag serviceMetadata and set httpGetEnabled to true (or httpsGetEnabled if using SSL). + To also enable service exception details for additional debugging (not necessary for standard, trapped errors): -1. Search for the tag ‘serviceDebug’ and set includeExceptionDetailInFaults to true. +1. Search for the tag ‘serviceDebug’ and set includeExceptionDetailInFaults to true. -After that you need to add a Service Reference to http:////service/service.svc and set the namespace to the service to "MDSTestService" in the following steps using Visual Studio. - 1. Click "Add Service Reference". - 2. In Address, enter the URL to the MDS service which will be “http:////service/service.svc”. - 3. Specify the namespace to the service as "MDSTestService" in the Namespace box. - 4. Click the Advanced button to configure advanced settings. - 5. Check Always generate message contracts. - 6. Set the Collection type drop-down to System.Collections.ObjectModel.Collection. - 7. Click OK to return to the Add Service Reference dialog. - 8. Click OK. +After that you need to add a Service Reference to http://ServerName/MdsSiteName/service/service.svc and set the namespace to the service to "MDSTestService" in the following steps using Visual Studio. + +1. Click "Add Service Reference". +2. In Address, enter the URL to the MDS service which will be “http://ServerName/MdsSiteName/service/service.svc”. +3. Specify the namespace to the service as "MDSTestService" in the Namespace box. +4. Click the Advanced button to configure advanced settings. +5. Check Always generate message contracts. +6. Set the Collection type drop-down to System.Collections.ObjectModel.Collection. +7. Click OK to return to the Add Service Reference dialog. +8. Click OK. Reference.cs will be generated in BusinessRules\Service References\MDSTestService folder. You can replace BusinessRules\Reference.cs with the newly generated one. diff --git a/samples/master-data-services/EntityBasedStaging/README.md b/samples/master-data-services/EntityBasedStaging/README.md index 20cd2efe..a36b4a27 100644 --- a/samples/master-data-services/EntityBasedStaging/README.md +++ b/samples/master-data-services/EntityBasedStaging/README.md @@ -1,44 +1,61 @@ # Master Data Services Entity Based Staging API Sample This is a C# code sample to show how to process, clear, and get information about entity based staging data by using MDS APIs. This sample has the following scenarios. + 1. Process the staging data in the staging table that has the specified batch tag (“Test1”). After calling the API to process the staging data wait untill the batch process completes (wait for 60 seconds). 2. Get the staging information such as the batch status and the error information. In this example, GetStagingInformation method returns the batch id for the specified batch tag. 3. Clear the batch staging data for the specified batch id. 4. Create a new business rule to validate the record that is added by Entity Based Staging and get the validation error. Before running this sample code you need to populate the staging table for the entity that you use with a staging record. + The staging record should have batch tag = "Test1". + Example: + Populate the record into stg.TestEntity_Leaf staging table with batch tag = “Test1” by running the SQL script. + Note that the Code and Name below is set to trigger the business rule validation error (if Code is “ABC”, Name must be equal to “Test”). + +```SQL Insert into stg.TestEntity_Leaf (ImportType, BatchTag, Code, Name) values (0, N'Test1', N'ABC', N'Name2'); +``` + ImportType = 0 means the import type is merge optimistic. + Please set the MDS URL (plus /Service/Service.svc) to mdsURL in Program.cs. + +```C# string mdsURL = @"http://localhost/MDS/Service/Service.svc"; +``` Program.cs uses Reference.cs (the service reference class file) that was generated by using Visual Studio to access MDS Web service API. You may need to regenerate Reference.cs in case when MDS Web service API is changed. To generate Reference.cs using Visual Studio: + You need to expose the WSDL. Exposing the WSDL is only necessary at the time when you want to generate proxy classes using a client development tool such as Visual Studio. After a proxy has been generated, the WSDL does not need to be exposed going forward for client programs to call the API. To enable an http/https Get on the WSDL: + 1. Open the MDS web.config file in a text editor (\Microsoft SQL Server\Master Data Services\WebApplication\web.config). 2. Search for the tag serviceMetadata and set httpGetEnabled to true (or httpsGetEnabled if using SSL). To also enable service exception details for additional debugging (not necessary for standard, trapped errors): + 1. Search for the tag ‘serviceDebug’ and set includeExceptionDetailInFaults to true. -After that you need to add a Service Reference to http:////service/service.svc and set the namespace to the service to "MDSTestService" in the following steps using Visual Studio. - 1. Click "Add Service Reference". - 2. In Address, enter the URL to the MDS service which will be “http:////service/service.svc”. - 3. Specify the namespace to the service as "MDSTestService" in the Namespace box. - 4. Click the Advanced button to configure advanced settings. - 5. Check Always generate message contracts. - 6. Set the Collection type drop-down to System.Collections.ObjectModel.Collection. - 7. Click OK to return to the Add Service Reference dialog. - 8. Click OK. +After that you need to add a Service Reference to http://ServerName/MdsSiteName/service/service.svc and set the namespace to the service to "MDSTestService" in the following steps using Visual Studio. + +1. Click "Add Service Reference". +2. In Address, enter the URL to the MDS service which will be “http://ServerName/MdsSiteName/service/service.svc”. +3. Specify the namespace to the service as "MDSTestService" in the Namespace box. +4. Click the Advanced button to configure advanced settings. +5. Check Always generate message contracts. +6. Set the Collection type drop-down to System.Collections.ObjectModel.Collection. +7. Click OK to return to the Add Service Reference dialog. +8. Click OK. Reference.cs will be generated in EntityBasedStaging\Service References\MDSTestService folder. You can replace EntityBasedStaging\Reference.cs with the newly generated one. diff --git a/samples/master-data-services/MasterData/README.md b/samples/master-data-services/MasterData/README.md index d1d546b5..c2e4c49e 100644 --- a/samples/master-data-services/MasterData/README.md +++ b/samples/master-data-services/MasterData/README.md @@ -1,7 +1,9 @@ # Master Data Services Master Data API Sample This is a C# code sample to show how to use MDS APIs to create, read, update, and delete entity members. + The sample code includes the following scenarios. + 1. Create a leaf member using MDS API. 2. Get the leaf member information (the member identifier) by the member code using MDS API. 3. Update the leaf member information (change the name) using MDS API. @@ -12,28 +14,33 @@ The sample code includes the following scenarios. 8. Delete the leaf member using MDS API. Please set the MDS URL (plus /Service/Service.svc) to mdsURL in Program.cs. + string mdsURL = @"http://localhost/MDS/Service/Service.svc"; Program.cs uses Reference.cs (the service reference class file) that was generated by using Visual Studio to access MDS Web service API. You may need to regenerate Reference.cs in the case when MDS Web service API is changed. To generate Reference.cs using Visual Studio: + You need to expose the WSDL. Exposing the WSDL is only necessary at the time when you want to generate proxy classes using a client development tool such as Visual Studio. After a proxy has been generated, the WSDL does not need to be exposed going forward for client programs to call the API. To enable an http/https Get on the WSDL: -1. Open the MDS web.config file in a text editor (\Microsoft SQL Server\Master Data Services\WebApplication\web.config). + +1. Open the MDS web.config file in a text editor (//service/service.svc and set the namespace to the service to "MDSTestService" in the following steps using Visual Studio. - 1. Click "Add Service Reference". - 2. In Address, enter the URL to the MDS service which will be “http:////service/service.svc”. - 3. Specify the namespace to the service as "MDSTestService" in the Namespace box. - 4. Click the Advanced button to configure advanced settings. - 5. Check Always generate message contracts. - 6. Set the Collection type drop-down to System.Collections.ObjectModel.Collection. - 7. Click OK to return to the Add Service Reference dialog. - 8. Click OK. +After that you need to add a Service Reference to http://ServerName/MdsSiteName/service/service.svc and set the namespace to the service to "MDSTestService" in the following steps using Visual Studio. + +1. Click "Add Service Reference". +2. In Address, enter the URL to the MDS service which will be “http://ServerName/MdsSiteName/service/service.svc”. +3. Specify the namespace to the service as "MDSTestService" in the Namespace box. +4. Click the Advanced button to configure advanced settings. +5. Check Always generate message contracts. +6. Set the Collection type drop-down to System.Collections.ObjectModel.Collection. +7. Click OK to return to the Add Service Reference dialog. +8. Click OK. Reference.cs will be generated in MasterData\Service References\MDSTestService folder. You can replace MasterData\Reference.cs with the newly generated one. diff --git a/samples/master-data-services/MetaData/README.md b/samples/master-data-services/MetaData/README.md index 6ef37981..cc6989d4 100644 --- a/samples/master-data-services/MetaData/README.md +++ b/samples/master-data-services/MetaData/README.md @@ -1,34 +1,42 @@ # Master Data Services Metadata API Sample This is a C# code sample to show how to use MDS APIs to create, read, update, and delete Metadata. + The sample code includes the following scenarios. + 1. Create, get information of, update, and delete a Model using MDS API. 2. Create, get information of, update, and delete an Entity using MDS API. 3. Create, get information of, update, and delete an Attribute using MDS API. 4. Create, get information of, update, and delete an Attribute Group using MDS API. Please set the MDS URL (plus /Service/Service.svc) to mdsURL in Program.cs. +```C# string mdsURL = @"http://localhost/MDS/Service/Service.svc"; +``` Program.cs uses Reference.cs (the service reference class file) that was generated by using Visual Studio to access MDS Web service API. You may need to regenerate Reference.cs in the case when MDS Web service API is changed. To generate Reference.cs using Visual Studio: + You need to expose the WSDL. Exposing the WSDL is only necessary at the time when you want to generate proxy classes using a client development tool such as Visual Studio. After a proxy has been generated, the WSDL does not need to be exposed going forward for client programs to call the API. To enable an http/https Get on the WSDL: + 1. Open the MDS web.config file in a text editor (\Microsoft SQL Server\Master Data Services\WebApplication\web.config). 2. Search for the tag serviceMetadata and set httpGetEnabled to true (or httpsGetEnabled if using SSL). To also enable service exception details for additional debugging (not necessary for standard, trapped errors): + 1. Search for the tag ‘serviceDebug’ and set includeExceptionDetailInFaults to true. -After that you need to add a Service Reference to http:////service/service.svc and set the namespace to the service to "MDSTestService" in the following steps using Visual Studio. - 1. Click "Add Service Reference". - 2. In Address, enter the URL to the MDS service which will be “http:////service/service.svc”. - 3. Specify the namespace to the service as "MDSTestService" in the Namespace box. - 4. Click the Advanced button to configure advanced settings. - 5. Check Always generate message contracts. - 6. Set the Collection type drop-down to System.Collections.ObjectModel.Collection. - 7. Click OK to return to the Add Service Reference dialog. - 8. Click OK. +After that you need to add a Service Reference to http://ServerName/MdsSiteName/service/service.svc and set the namespace to the service to "MDSTestService" in the following steps using Visual Studio. + +1. Click "Add Service Reference". +2. In Address, enter the URL to the MDS service which will be “http://ServerName/MdsSiteName/service/service.svc”. +3. Specify the namespace to the service as "MDSTestService" in the Namespace box. +4. Click the Advanced button to configure advanced settings. +5. Check Always generate message contracts. +6. Set the Collection type drop-down to System.Collections.ObjectModel.Collection. +7. Click OK to return to the Add Service Reference dialog. +8. Click OK. Reference.cs will be generated in Metadata\Service References\MDSTestService folder. You can replace Metadata\Reference.cs with the newly generated one. diff --git a/samples/master-data-services/ModelDeployment/README.md b/samples/master-data-services/ModelDeployment/README.md index 13840825..6b3bff5c 100644 --- a/samples/master-data-services/ModelDeployment/README.md +++ b/samples/master-data-services/ModelDeployment/README.md @@ -7,6 +7,7 @@ Building the Visual Studio 2013 Solution This sample has the following external dependencies: Microsoft.MasterDataServices.Deployment.dll + Microsoft.MasterDataServices.Services.contracts.dll In order to build the solution, adjust the project references to point to these binaries in your Microsoft SQL Server Master Data Services deployment. @@ -14,6 +15,7 @@ In order to build the solution, adjust the project references to point to these Configuring the sample project Update the ConnectionString in ModelDUtil.config to point to your deployed database. Do not to change the name of the connection -- that should be left as "defaultMdsConnection". + ModelDUtil.config must be co-located with ModelDUtil.exe. Using the sample executable @@ -27,24 +29,31 @@ Usage: where [mode] is one of the following: ListModels -- returns a list of all the user models in the target system + ModelDUtil ListModels ListVersions -- returns a list of the versions for a given model + ModelDUtil ListVersions [model name] CreatePackage -- create a package file for a given model + ModelDUtil CreatePackage [output package file name] [model name] [version name] DeployClone -- deploys a clone of a model from a given package + ModelDUtil DeployClone [input package file name] DeployNew -- deploys a model from a given package with the new given name + ModelDUtil DeployNew [input package file name] [new model name] DeployUpdate -- deploys an update to a given version of a model from a given package + ModelDUtil DeployUpdate [input package file name] [version name to update] Help -- displays this help + ModelDUtil Help Note: names that contain spaces should be wrapped with double quotation marks. For Example: ModelDUtil DeployUpdate mypackage.pkg "Version 1" \ No newline at end of file diff --git a/samples/master-data-services/README.md b/samples/master-data-services/README.md index ee207332..206c48bf 100644 --- a/samples/master-data-services/README.md +++ b/samples/master-data-services/README.md @@ -4,10 +4,7 @@ Master Data Services (MDS) is the SQL Server solution for master data management Master Data Services (MDS) samples are C# console application samples that demonstrate how to customize the way that you and your users interact with Master Data Services. -For information about the new features in SQL Server 2016, see [What's New in Master Data Services (MDS)] (https://msdn.microsoft.com/en-us/library/ff929136.aspx). +For information about the new features in SQL Server 2016, see [What's New in Master Data Services (MDS)](https://msdn.microsoft.com/en-us/library/ff929136.aspx). -For more information about the MDS API, see [Master Data Services Developer Documentation] (https://msdn.microsoft.com/en-us/library/hh230994.aspx). - -## Questions -Email questions to: sqlmdsfeedback@micrososft.com. +For more information about the MDS API, see [Master Data Services Developer Documentation](https://msdn.microsoft.com/en-us/library/hh230994.aspx). diff --git a/samples/master-data-services/Security/README.md b/samples/master-data-services/Security/README.md index 3b786253..dcd14cd3 100644 --- a/samples/master-data-services/Security/README.md +++ b/samples/master-data-services/Security/README.md @@ -1,47 +1,53 @@ # Master Data Services Security API Sample This is a C# sample code to show how to export security information into the specified file and import security information from the file by using MDS APIs. + Export security information method gets the security information (the security principals) from the specified MDS application and exports (serializes) it to the specified file (the file will be created in the folder where the sample application runs). Import security information method gets (deserializes) the user and group security principals from the file and clones them (creates them with the same GUIDs) in the target MDS application. This sample code takes the following parameters. + 1. Mode (the first parameter) This parameter indicates whether the code exports or imports the security information. Export: The code exports the security information. Import: The code imports the security information. -2. MDS Host Name (the second parameter) +2. MDS Host Name (the second parameter) This parameter indicates the host name of the MDS web site. For example, if the MDS URL is http://mydomain.com/mds MDS Host Name is "mydomain.com". If the mode is “Export” it is the host name from which the security information is exported. If the mode is “Import” it is the host name to which the security information is imported. 3. MDS Application Name (the third parameter) This parameter indicates the MDS Application name. For example, if the MDS URL is http://mydomain.com/mds MDS Application Name is "mds". 4. File name (the fourth parameter) The name of the file that stores the security information for users and groups. -5: Exclude Metadata Model Permissions (the fifth parameter) +5. Exclude Metadata Model Permissions (the fifth parameter) This is an optional parameter that indicates if Metadata Model Permissions are excluded or not. When "ExcludeMetadata" is specified here Metadata Model Permissions are excluded. When Metadata Model's GUID in the target MDS application is different from the one in the source MDS application, the import of the security information fails. To avoid this issue the user can exclude Metadata Model Permissions. The import of the security information creates users and user groups that were exported from the source MDS application data, so there should not be any user and user group in the target MDS application data that are the same as the source MDS application data. Before the security privileges on models and member hierarchies are imported, the target MDS application should have the same models and member hierarchies with the same GUIDs. Model Deployment can deploy models (other than Metadata) with the same GUIDs. - + Program.cs uses Reference.cs (the service reference class file) that was generated by using Visual Studio to access MDS Web service API. You may need to regenerate Reference.cs in case when MDS Web service API is changed. To generate Reference.cs using Visual Studio: + You need to expose the WSDL. Exposing the WSDL is only necessary at the time when you want to generate proxy classes using a client development tool such as Visual Studio. After a proxy has been generated, the WSDL does not need to be exposed going forward for client programs to call the API. To enable an http/https Get on the WSDL: + 1. Open the MDS web.config file in a text editor (\Microsoft SQL Server\Master Data Services\WebApplication\web.config). 2. Search for the tag serviceMetadata and set httpGetEnabled to true (or httpsGetEnabled if using SSL). To also enable service exception details for additional debugging (not necessary for standard, trapped errors): + 1. Search for the tag ‘serviceDebug’ and set includeExceptionDetailInFaults to true. -After that you need to add a Service Reference to http:////service/service.svc and set the namespace to the service to "MDSTestService" in the following steps using Visual Studio. - 1. Click "Add Service Reference". - 2. In Address, enter the URL to the MDS service which will be “http:////service/service.svc”. - 3. Specify the namespace to the service as "MDSTestService" in the Namespace box. - 4. Click the Advanced button to configure advanced settings. - 5. Check Always generate message contracts. - 6. Set the Collection type drop-down to System.Collections.ObjectModel.Collection. - 7. Click OK to return to the Add Service Reference dialog. - 8. Click OK. +After that you need to add a Service Reference to http://ServerName/MdsSiteName/service/service.svc and set the namespace to the service to "MDSTestService" in the following steps using Visual Studio. + +1. Click "Add Service Reference". +2. In Address, enter the URL to the MDS service which will be “http://ServerName/MdsSiteName/service/service.svc”. +3. Specify the namespace to the service as "MDSTestService" in the Namespace box. +4. Click the Advanced button to configure advanced settings. +5. Check Always generate message contracts. +6. Set the Collection type drop-down to System.Collections.ObjectModel.Collection. +7. Click OK to return to the Add Service Reference dialog. +8. Click OK. Reference.cs will be generated in Security\Service References\MDSTestService folder. You can replace Security\Reference.cs with the newly generated one. diff --git a/samples/master-data-services/Workflow/README.md b/samples/master-data-services/Workflow/README.md index 4d880912..bc355011 100644 --- a/samples/master-data-services/Workflow/README.md +++ b/samples/master-data-services/Workflow/README.md @@ -2,8 +2,11 @@ A sample class that demonstrates how to implement a workflow type extender for SharePoint workflows. Once built, the assembly that contains this class should be put in the same folder as the workflow listener (Microsoft.MasterDataServices.Workflow.exe), and the listener's config file should be updated to reference this class, like this: - - - SPWF=Microsoft.MasterDataServices.SharePointWorkflow.SharePointWorkflowExtender, Microsoft.MasterDataServices.SharePointWorkflow, Version=1.0.0.0 - - \ No newline at end of file + +```XML + + + SPWF=Microsoft.MasterDataServices.SharePointWorkflow.SharePointWorkflowExtender, Microsoft.MasterDataServices.SharePointWorkflow, Version=1.0.0.0 + + +``` \ No newline at end of file