Testing APIs Using WcfStorm
You can use the WcfStorm application as a test workbench for WCF and Web services.
-
Start the WcfStorm application and navigate to Configuration > Show > Under the hood.
-
If you are working with Web services (.asmx files), select Use Message Contracts, and click OK.
-
If you are working with WCF services (.svc files), clear Use Message Contracts, and click OK.
-
-
In Anthology Student, navigate to Setup > System > File Server & Services and click Configure Web Service Locations.
-
In the Authentication tab of the Set CampusLink Middle-Tier Web Service Locations form, select and copy (Ctrl+C) the Authentication Web Service URL.
Note: When testing APIs, the Authentication service always needs to be invoked first to obtain a TokenId for other WCF or Web services.
Example
http://CLTQAAPI3:15102/Cmc.CampusLink.WebServices.Security/Authentication.asmx
-
In WcfStorm, click File > Service > Add and paste (Ctrl+V) the Authentication Service URL from the clipboard into the service endpoint window.
-
Click
to load the Authentication service.
-
In the left pane, select the GetAuthorizationToken method. Observe the log messages as the method is being invoked.
-
In the Request pane, specify the following values for the GetAuthorizationToken method:
-
UserName: Specify the user name for the Anthology Student system.
-
Password: Specify the user name for the Anthology Student system.
-
StaffId: A StaffId is required only for API services, such as Degree Audit, that can be invoked by staff or students (via the Web portal). For staff, the StaffId value is 2.
-
TokenNeverExpires: Select True to ensure that your TokenId remains active for subsequent service requests during a session.
-
-
Click
in the Request pane to send the in-message. The Response pane displays the out-message or an error if the service was not successfully invoked. A successful response displays OK statuses.
-
In the Response pane, select the TokenId, right-click, and select Copy to clipboard.
-
Open Notepad and paste (Ctrl+V) the contents of the clipboard into a new file.
-
In Notepad, select the TokenId value as shown below and copy it to the clipboard (Ctrl+V).
-
In WcfStorm, click File > Service > Add and specify the service endpoint for the method you want to invoke.
Note: The service must be installed and the endpoint must be configured in Anthology Student. See Configuring API Services.
Copy and paste the appropriate service URL from the Set CampusLink Middle-Tier Web Service Locations form.
Example
http://CLTQAAPI3:15102/Cmc.CampusLink.WebServices/DegreeAuditWebService.asmx
Note:The server and port information for the selected service,
CLTQAAPI3:15102
in our example, must match the server and port information of the Authentication service invoked above. -
Click
to load the service. Observe the log messages as the service is being invoked.
-
Select a method associated with the Web service, for example GetDegreeAudit. The message fields are displayed in the Request pane.
-
In the Request pane, specify the appropriate values for the selected service.
Note: Refer to the API documentation for information about required / optional / conditional parameters, default values, message field descriptions, and other related information.
The following values are required in our example:
-
StudentId: Specify a Student Id value. To obtain the Id, select a student in Anthology Student and right-click the record in the Recent Student list.
-
EnrollId: Specify an Enrollment Id. To obtain the Id, query the database as shown below.
-
TokenId: Paste in the TokenId from Notepad (see above).
-
-
Click
in the Request pane to send the in-message. The Response pane displays the out-message or an error if the service was not successfully invoked.
A successful response returns the requested data and shows MessageStatus = OK.