Salesforce

How Do I Configure Magic xpi as a Web Services Consumer? (Magic xpi 3.x)

« 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 3.x)

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 service to the flow area, but do not configure it (click OK).

  2. Drag the Web Services service into the flow area as the child of the Data Mapper step. The Component Properties dialog box opens.

  3. Click the Configuration button, select the resource that you created earlier, and then define an operation called GetCapitalCity.

  4. 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.

  1. Return to the Data Mapper step, and select Configuration from its context menu.

  2. Create a new XML Destination, and click Properties.

  3. Select the following XSD file entry: tempuri_org_.xsd. This file is found under the <Magic xpi>\Projects\<ProjectName>\resources\<ServiceName>.

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

  5. Select GetCapitalCity as the XML root.

  1. Click OK to close the Destination configuration dialog box, and click Map to open the Data Mapper screen.

  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 the OK buttons until you exit the Data Mapper.

  2. Drag a Save Message service 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