Cert++
Close

Live versus mocked service mode and the enabled flag

Key Takeaway

In Mocked mode, mockFull replaces the whole service call when you implement it. Without mockFull, mockCall replaces only the execute step, so createRequest and parseResponse still run.

Every web service that B2C Commerce calls through the service framework has a service configuration in Business Manager. Two settings on the configuration control whether and how calls run: the "Enabled" checkbox and the "Service Mode" list. Service Mode decides whether a call goes to the real web service or gets a simulated response from your own code. Simulated responses let you build and test integration code against expected responses.

Service configurations and your code

You create a service configuration in Business Manager under "Administration > Operations > Services". On the same page you also choose its service type, profile, and credential.

Your script gets a Service object for the configuration by calling LocalServiceRegistry.createService. You pass in the service configuration's name and an object of callbacks that you write. An HTTP or FTP service instance typically implements createRequest, parseResponse, and, for testing, mockCall.

B2C Commerce Developer Study Guide

Checklist progress

0/237Learned

Given a service configuration, recognize how they are applicable to the development process

0/5

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other B2C Commerce Developer studiers.