Salesforce

How Do I Configure Magic xpi as a Web Services Consumer? (Magic xpi 4.5)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Configure Magic xpi as a Web Services Consumer? (Magic xpi 4.5)

The Magic xpi Web services consumer can access external Web services providers on the Internet or Intranet.

Follow these steps to access a Countries Demo Web service using the service's WSDL URL.

  1. Create a new project or a new flow.

  2. Define a new Web Service Client resource.

  3. Enter the following value in the WSDL URL field: http://mui.magicsoftware.com/eDevCountriesDemo/Service1.asmx?WSDL

  4. Click Configure to load the WSDL.

  1. Define the following flow variables:

Name

Type

Picture

Default Value

F.Result

BLOB

F.OUT

BLOB

F.Fault

BLOB

F.CountrySymbol

Alpha

2

US

  1. Drag a Data Mapper utility to the flow area.

  2. Drag the Web Services utility into the flow area as the child of the Data Mapper step.

  3. Double-click or right-click on the Web Services utility and select Configuration from the context menu to open the Web Services Configuration dialog box.

  4. Select the operation called GetCapitalCity.

  5. Select F.OUT for the GetCapitalCity parameter, F.Result for the GetCapitalCityResponse parameter, and F.Fault for the Fault parameter (at the bottom left of the screen). Then click OK.

  6. Double-click or right-click on the Data Mapper step and select Configuration from the context menu to open the Data Mapper window.

  7. From the Toolbox's Mapper Schemas section, drag an XML type into the Destination area of the Data Mapper window.

  8. In the XML Source's Properties pane, select the following XSD file entry: tempuri_org_.xsd. This file is found under the <Magic xpi>\Projects\<ProjectName>\resources\<ServiceName> folder.

  1. Select the F.OUT flow variable as the data Destination.

  2. Select GetCapitalCity as the XML root.

  1. Click Save.

  2. In the Data Mapper Destination pane, fully expand the tree to expose the cSymbol element.

  3. Double-click on the cSymbol element, and select the F.CountrySymbol as the calculated value.

  1. Click Save.

  2. Drag a Save Message utility into the flow.

  3. In the Message parameter, enter WS call result.

  4. In the BLOB parameter, select the F.Result variable.

  5. In the File Extension parameter, enter xml. The consumer flow should be set to AutoStart.

  6. Save the project. The project should look like this.

  1. Run the flow using the Debugger or Server.

Note:

  • If the Web service invocation fails, the variable mapped to the Fault (F.Fault) will be populated with the Fault response.

  • The XML result from the Web service call should be parsed using the Data Mapper, and with the same XSD used for the request. However, you should use the GetCapitalCityResponse root.

  • You should populate the F.CountrySymbol with the required country symbol before the first Data Mapper step (the default is US).

Reference
Attachment 
Attachment