<web service URL>/GetBin?<operation parameters>
The GetBin operation is used to get binary data from server using GET request.
Operation parameters contain a moniker and different additional parameters. Depending on the object, for which operation is executed, the repository connection moniker or the opened object instance moniker is specified as a moniker. The required monikers are returned by various Open* operations.
A parameter and its value are separated with the = character in the address bar; different parameters are separated with the & character.
Available parameters of the GetBin operation:
Parameter | Description |
mon | Moniker of the object, for which operation is executed. Available moniker types:
The monikers, which are the PutBin operation execution result, can also be used. |
attach | Indicates whether to load document. Available parameter values:
|
fileName | File name, with which loading is executed. It is used with the attach parameter. Example: &attach=1&fileName=report.xls. |
IMPORTANT. Parameter names are case-sensitive.
Below is the example of code of HTML page that is used to get binary data by means of the GetBin operation. Opening the page connects to repository and two operations are executed:
Contents of the document with the LOGO identifier is obtained.
Preview of the repository object with the 12345 key is obtained.
Operation execution results are opened on new browser tabs.
To reduce the example, the PostRequest function script is excluded from the code, the function is used to execute operations in JSON format. See code of this function in the Connecting to Repository article.
<!DOCTYPE html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Using the GetBin operation</title>
</head>
<body>
<script language="javascript" type="text/javascript">
var svc = "http://localhost:9090/axis2/services/PP.SOM.Som";
OpenMetabase = { "OpenMetabase": { "tDef": { "id": "Warehouse" }, "tCreds": { "user": { "id": "User" }, "pass": "Password" } } }
OpenMetabaseResult = PostRequest(svc, OpenMetabase);
/*
PostRequest script
*/
//Executing GetBin
url = svc + "/GetBin?mon=" + OpenMetabaseResult.OpenMetabaseResult.id + "!$Sys!LOGO";
window.open(url);
url = svc + "/GetBin?mon=" + OpenMetabaseResult.OpenMetabaseResult.id + "!Preview!12345";
window.open(url);
</script>
</body>
</html>
See also: