Designer > About Interfaces Service References and Local WSDL > Using Sample Data for WSDL Messages
  

Using Sample Data for WSDL Messages

Select the source location for the sample you want to add. Select a workspace resource, such as sample data, WSDL, or XSL file.
WSDL files define operations that receive an input message and, optionally, return an output message and a fault message. In the Participants or Interfaces view, you can add sample data values for message parts. When you are ready to test your process, you can load the sample message part values into your variables to simulate the actual messages exchanged by Web services. As you execute and debug your process, you can inspect the input, output, and fault data values as they are processed.
By adding sample data values to WSDL messages, you have a default set of data across all projects. The Project Explorer keeps track of all sample files and their locations and presents them to you when you are loading values into message variables.

Adding or Editing a Sample Data Value for a Simple Type Message Part

You can manage WSDL, schema, and XML data files in the Interfaces view to make your design work faster and easier. Use this dialog to add sample data to a WSDL simple-type message or edit sample data for the simple type variable.
In the Participants or Interfaces view, you can add a sample data value for a simple type message part. When you are ready to test your process, the sample message part value is automatically loaded into your variable. You can also modify the value in Process Variables view as well as override the value during process simulation.
To add a single sample data value:
  1. 1. In the Participants or Interfaces view, expand a message with a part that is a simple type, such as xsd:int.
  2. 2. Double-click the variable to open the Add Sample Data dialog, as shown.
  3. 3. Type in a value and click OK. Notice that the value is displayed as a child node beneath the message part.
  4. 4. As needed, double-click the sample to edit it.
You can add multiple data values and then select one as the default by right-clicking on the sample data value. You can remove any values you do not want.

Generating a Sample Data File

Select the source location for the sample you want to add. This is a workspace resource such a sample data, WSDL, or an XSL file.
When you want to simulate process execution for a process with complex messages, you can generate sample data files for the messages. A sample data file is an XML file structured with message part elements or types that were defined in the schema declared in the WSDL namespace. The following is an example of a partial sample data file for a purchase order output message. Code similar to this example is automatically generated for you, based on the schema type or element.
<purchaseOrders
xmlns="http://samples.cxdn.com/po"
xmlns:tns="http://samples.cxdn.com/po">
<purchaseOrder tns:orderDate="2005-09-05">
<shipTo tns:country="US">
<name>Jay Lor Jr.</name>
<street>100 My Street</street>
<city>My City</city>
<state>CT</state>
<zip>06484</zip>
</shipTo>
...
</purchaseOrder>
</purchaseOrders>
To generate sample data:
  1. 1. In Participants or Interfaces view, expand a message with a complex part, and select a message part for which you want to generate a sample XML data file.
  2. 2. Right-click on the message part and select Generate Sample.
  3. 3. In the XML Data Wizard, fill in your preferences for generating the sample data. For details, see Using the XML Data Wizard. Click Next.
  4. 4. Name the file, and save it to the sample-data folder in your orchestration project.
You can generate multiple sample data files for the same message part. You can name the files uniquely, or you can use the same filename and store the files in different folders. Process Developer keeps track of file locations.

Adding a Sample Data File to a WSDL Message

Select a workspace resource, such as sample data, WSDL, or XSL file.
You can add sample data files to your orchestration project and then add sample data files to WSDL messages that are complex types. You can select a default sample for all processes you create in Process Developer. On a process by process basis, you can add sample data to process variables in addition to or instead of using the samples added to a project or Interfaces view.
To add a sample data file to a message variable:
  1. 1. In Participants or Interfaces view, expand a message with a complex part, and select a message part for which you want to add a sample XML data file.
  2. 2. Double-click the complex part to open the Project dialog.
  3. 3. Select the source project location for the file.
  4. 4. Browse to the file, select it, and click OK.
The first file you add is set as the default sample, but you can add additional files and select one of them as the default.

Selecting a Default Sample Data File

You can add several sample data files for each message part in Participants or Interfaces view. You can select one sample file as the default file loaded into process variables.
In Participants or Interfaces view, expand a WSDL message. To select a default sample data file, right-mouse click on a sample file and select Default Sample.

Viewing the XML Structure of a Sample Data File

To view the XML text of a sample data file that added to a WSDL message in Interfaces view, right-mouse click on the data file name and select Open.

Removing a Sample Data File

To remove a sample data file from a WSDL message in Participants or Interfaces view, right-mouse click on the data file and select Remove Sample.
If you remove the file set as the default file, the first file in the list becomes the default.