Question: I'm adding sendBroadcast() to one of my apps but I won't be consuming the broadcast myself, so I'm wondering if there is a utility app or a debugger component I can use to monitor all sendBroadcast() messages on my device and see if the message I'm broadcasting is getting across.

I know I could probably throw something together, but if there is an exist app (that is known to work ;) that is the preferred route.

Thanks,

Jason

Answer: 
For deploying Jasper reports on Jasper Server using Rest-API you can use following method:

Uploading JRXML file
--------------------

```
JRXML_DATA=$(cat $PATHTOJRXMLFILE/$JRXML_FILE)

curl  -X POST $JASPER_REST_HOST/jasperserver/rest_v2/resources/reports \
-H "Content-Type:application/jrxml" \
-H "Content-Disposition:attachment; filename=test" \
-H "Content-Description:test file" \
-d "$JRXML_DATA" \
--user $JASPER_USERNAME:$JASPER_USERNAME

```

Creating ReportUnit
-------------------

```
RESOURCEDESCRIPTOR_JSON=$(cat $REPORT/deployable/reportunit.json)

curl  -X POST $JASPER_REST_HOST/jasperserver/rest_v2/resources/reports \
-H "Content-Type:application/repository.reportUnit+json" \
-d "$RESOURCEDESCRIPTOR_JSON" \
--user $JASPER_USERNAME:$JASPER_PASSWORD

```

ResourceDescriptor for reportUnit example
-----------------------------------------

```
{
    "uri": "/reports/test_report", 
    "label": "test_report", 
    "description": "description", 
    "permissionMask": "0",
    "version": "0" ,
    "alwaysPromptControls": "true",
    "controlsLayout": "popupScreen",
    "jrxml": {
        "jrxmlFileReference": {
            "uri": "/reports/test"
        }
    }
}

```

Resource Descriptor references
------------------------------

<http://community.jaspersoft.com/documentation/jasperreports-server-web-services-guide/v56/v2-resource-descriptor-types>
To upload a jrxml file, create a `ResourceDescriptor` with `PROP_HAS_DATA` = `true` and insert the jrxml content in a multipart `PUT` request.

After a while of researching and investigating I got it running and developed a PHP class that's easy to use.

<http://blog.flowl.info/2013/jasper-php-library-on-github/>

To upload a jrxml file this code does the job:

```
// Init the Jasper connection
require_once('Jasper/Jasper.php');
$jasper = new \Jasper\Jasper();
$jasper->login('jasperadmin', 'jasperadmin', 'jasper.host.com:8080');

// Create a Resource Descriptor object for the jrxml file
$jrxml = new \Jasper\JasperJrxml('/reports/test.jrxml');

// Upload the Resource Descriptor object with content
$jasper->createContent($jrxml, file_get_contents('templates/test.jrxml'));

```

To create a report unit, go on with the following lines:

```
// Datasource Resource Descriptor
$mongo = new \Jasper\JasperDatasource();
$mongo->setPropIsReference('true');
$mongo->setPropReferenceUri('/datasources/mongo_local_test');

// Put everything together and deploy the report
$report->addChildResource($mongo);
$report->addChildResource($jrxml);

// Want to see the Resource Descriptor of the Report Unit?
// true = pretty print
print_r($report->getXml(true));

// Create a the Report Unit
$jasper->createResource($report);

```