Create wrapper classes to consume external web services

Completed

To consume external web services within finance and operations apps, you can use wrapper classes. You can wrap logic around methods that are defined in the base class that you're augmenting.

This means that you can extend the code of both public and protected methods without having to use event handlers. When you wrap a method for a table, form, data entity, or other object, you must use an extension class. Before learning about how to use wrapper classes to connect to external web services, consider the following example of a wrapper class.

[ExtensionOf(tableStr(FMCustomer))]
final class MyFleet_Extension
{
	public void salute(str message)
	{
		// ...
	}
}

In the previous code sample, the ExtensionOf attribute is applied to the class, and the FMCustomer table class is extended. Because the class is an extension class, it must be public and final. The salute method doesn't include the default value of the message parameter.

You can create wrapper classes to connect to external web services. You can do this by wrapping a service endpoint in Visual Studio and then adding the reference in your project.

Note

This functionality is available in finance and operations apps Platform update 9 or later. Methods that are compiled by using earlier versions don't have the infrastructure to support wrapping.