Web Services
MapForce supports WSDL-based and non-WSDL Web services. Non-WSDL Web services include a large category of generic HTTP APIs that are often referred to as REST or RESTful APIs. MapForce also supports the Shopify API and generic GraphQL APIs.
WSDL-based Web services
A WSDL-based web service uses a WSDL (Web Services Description Language) file to describe the service's operations, input and output messages, and network details. WSDL files are XML-based and typically use the SOAP protocol that defines how messages are exchanged between a client and a service.
MapForce also allows you to design a SOAP web service project and generate Java or C# code that implements the SOAP web service. Besides, you can make a call to the SOAP web service and output the response data to any format supported in MapForce. If the WSDL file implements multiple services, endpoints, and operations, you can select or update them directly in MapForce.
Protocols of WSDL-based services
For WSDL-based web services, you can use the following protocols:
•SOAP 1.1, 1.2 over HTTP: Both the RPC/Encoded and Document/Literal styles are supported. If the web server returns a WSDL fault, the mapping execution stops. In such cases, you can optionally insert an exception component in the mapping area to handle the error. If the web server returns a non-WSDL error, the mapping execution stops, and an error message is returned (or displayed on the screen if you are previewing the mapping in MapForce).
•Non-SOAP over HTTP: This refers to less common, non-SOAP HTTP services. With HTTP GET, the url-encoded style is supported. With HTTP POST, the url-encoded and text/xml styles are supported.
HTTP APIs
HTTP APIs typically have request or response structures in the message body part. MapForce supports the following kinds of request and response bodies: JSON, XML, Protocol Buffers, and unstructured bodies with custom MIME types.
For HTTP APIs, you can enter web service details manually or automatically. The web service details include a URL, a request method (e.g., GET, POST, PUT), request and response structures (e.g., XML, JSON, custom MIME types), and parameters.
XML and JSON
You can use JSON, XML, or DTD schemas for your request/response structures. MapForce can also accept an XML file with a valid schema reference. Besides, you can also import the web service definition from a WADL file and make any necessary adjustments manually. Note, however, that WADL provides no standard way to define JSON structures, only XML structures.
If you have a sample XML or JSON instance file without a schema file, you can create the schema with XMLSpy (https://www.altova.com/xmlspy.html). If necessary, XMLSpy can also convert your instance file from XML to JSON, or vice versa.
Protocol Buffers
In case you want to work with Protocol Buffers requests and responses, you will need a .proto file that describes the Protocol Buffers binary file. In this scenario, the body of the web service can be mapped to or from a Protocol Buffers component. For more information, see Example: Read Data from Protocol Buffers and Example: Write Data to Protocol Buffers.
Unstructured bodies with custom MIME types
You can also call web services if the request or response structure is flexible and not tied to a particular schema. For such cases, you can use MapForce built-in mime functions to create a raw message body sent to a web service (the MIME entity) or process the MIME entity returned by the web service.
Shopify API and generic GraphQL APIs
MapForce enables you to make a call to the Shopify API or to a generic GraphQL API.
GraphQL is a query language for APIs. Shopify is an e-commerce platform that enables businesses to create and manage online stores, sell products, manage orders, customers, payments and shipping. Developers can access and manipulate store data programmatically via the Shopify API and automate various processes. The Shopify API supports GraphQL to interact with store data.
For details, see the topic Shopify API and GraphQL API. To find our more about how to create GraphQL queries and mutations, see Examples.
Examples
For examples of mappings with web service calls, see the following topics:
•Example: Mapping Data from an RSS Feed
•Example: Calling a SOAP Web Service
•Example: OAuth 2.0 Authorization