Jasper server reportUnitUri cause 404 error - rest

I use jasper reports rest v2 api, in http:///jasperserver/rest_v2/reportExecutions send post request with the following body
<reportExecutionRequest>
<reportUnitUri>/root/Reports/samples/Department</reportUnitUri>
<async>true</async>
<freshData>false</freshData>
<saveDataSnapshot>false</saveDataSnapshot>
<outputFormat>html</outputFormat>
<interactive>true</interactive>
<ignorePagination>false</ignorePagination>
<pages>1-5</pages>
<parameters>
<reportParameter name="name">
<value>name 1</value>
<value>name 2</value>
</reportParameter>
<reportParameter name="mark1">
<value>200</value>
<value>453</value>
</reportParameter>
</parameters>
</reportExecutionRequest>
reports Resource /root/Reports/samples/Department not found. i tried various combinations in ResourceUnitUri like (Reports/Reports/samples/Depatments, /samples/Department). But none seems to work. Everything returns 404 code. What is the correct value on reportUnitUri?

ReportUnitUri = /reports/<folder name>/<Resource ID>. To get Resource ID select report and click edit button. you get

Related

USPS Shipping API Standard Post Machinable tag

Ok so I've been trying to days now to figure out how to use the USPS shipping API to get the shipping rate of a package under the service "Standard Post". I can do media mail, priority mail and first class but every time I try to do "Standard Post" I get this error:
Machinable value must be 'True' or 'False' for service type Retail Gound and service type All.
If I then add either True or False I now get this error:
The element 'Package' has invalid child element 'Machinable'. List of possible elements expected: 'ZipOrigination'.
Here is the request that I've been toying with:
https://secure.shippingapis.com/ShippingAPI.dll?API=RateV4&XML=<RateV4Request USERID="(omitted)">
<Package ID="standard">
<Service>Standard Post</Service>
<FirstClassMailType>PARCEL</FirstClassMailType>
<Machinable>True</Machinable>
<ZipOrigination>44121</ZipOrigination>
<ZipDestination>99352</ZipDestination>
<Pounds>6</Pounds>
<Ounces>8</Ounces>
<Container>VARIABLE</Container>
<Size>LARGE</Size>
<Width>17</Width>
<Length>13</Length>
<Height>11</Height>
<Girth>1</Girth>
</Package>
</RateV4Request>
Try this sample request:
XML=<RateV4Request USERID=""><Revision>3</Revision><Package ID="0"><Service>PRIORITY</Service><ZipOrigination>22201</ZipOrigination><ZipDestination>26301</ZipDestination><Pounds>8</Pounds><Ounces>2</Ounces><Container></Container><Width>2</Width><Length>3</Length><Height>5</Height><Girth>1</Girth><Machinable>FALSE</Machinable></Package></RateV4Request>

Create Order status code 400 - Server Error

I'm trying to build a simple payment flow using Bluesnap. Currently I've been able to capture the users billing information using Hosted Fields, and then saved it to a "Shopper" in bluesnap. Now I'm trying to use the same Shopper to create an order (https://developers.bluesnap.com/v8976-Extended/docs/create-order), but I can't get it to work.
I'm sending this:
<order>
<ordering-shopper>
<shopper-id>
--Shopper ID--
</shopper-id>
<web-info>
<ip>127.0.0.1:61106</ip>
<remote-host>www.merchant.com</remote-host>
<user-agent>Mozilla/5.0 (Linux; X11)</user-agent>
</web-info>
<fraud-info>
<fraud-session-id>1234567890</fraud-session-id>
</fraud-info>
<authorized-by-shopper>true</authorized-by-shopper>
</ordering-shopper>
<cart>
<cart-item>
<sku>
<sku-id>2425735</sku-id>
</sku>
<quantity>1</quantity>
</cart-item>
</cart>
<expected-total-price>
<amount>15.00</amount>
<currency>USD</currency>
</expected-total-price>
</order>
Using a POST-request to BLUESNAPDOMAINPATH/services/2/orders
The only response I get is a status code 400 with the body containing "Server Error"
Does anyone know how to solve this issue?
Your root xml element is missing the namespace:
<order>
Should be:
<order xmlns="http://ws.plimus.com">

How to invoke a formhandler using ATG REST Client

I'm trying to invoke ProfileFormHandler's create handle using ATG rest client as shown below.
mSession = RestSession.createSession(mHost, mPort,"kim#example.com","password");
mSession.setUseHttpsForLogin(false);
mSession.login();
Map<String,Object> params = new HashMap<String,Object>();
params.put("value.login", "buddha#oracle.com");
params.put("value.email", "buddha#oracle.com");
params.put("value.password", "password");
RestResult result = RestComponentHelper.executeMethod("/atg/userprofiling/ProfileFormHandler","create",null,params,mSession);
I'm getting form exceptions that says, I'm not passing Login and Password Fields.
["Missing value for the required property Password",
"Missing value for the required property Login name"]
I've tried all combinations of login and password fields like value.login, Login, login, value.Login etc., but nothing seemed to work. All combinations giving the same form exceptions.
How do I invoke an ATG form handler using ATG REST Client and pass parameters to it?
Definitely need more information but looking at your code I can see that you have a value.login which is not configured ootb and believe this is causing the NPE. Assuming you have not customized the ootb ATG RegistrationFormHandler and the required field in the repository the only values you need to pass to the form handler are:
value.email
value.password
value.confirmPassword
value.firstName
value.lastName
Also, the help is specific that the data-type of the value property needs to be java.util.Dictionary
Add the following to /atg/rest/security/restSecurityConfiguration.xml
<resource component="/atg/userprofiling/ProfileFormHandler" secure="false">
<method name="handleCreate" secure="false">
<acl value="EVERYONE:read,write,execute" />
</method>
<property name="value.login" secure="false" />
<property name="value.password" secure="false" />
</resource>

Retrieve a List of All Checks for an Account using qbXML

I'm working on a website for a client that integrates into QuickBook desktop. I need to get a listing of all the checks for a specific account (ideally I would like all transactions for that account [regardless of their type] but if I have to get them one at a time that's fine). When I send the following XML:
<ns1:sendRequestXMLResponse>
<ns1:sendRequestXMLResult>
<xml version="1.0" encoding="utf-8" ?>
<qbxml version="12.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<CheckQueryRq>
<AccountFilter>
<ListID>800000F1-1362066981</ListID>
</AccountFilter>
<IncludeLineItems>true</IncludeLineItems>
</CheckQueryRq>
</QBXMLMsgsRq>
</QBXML>
</ns1:sendRequestXMLResult>
</ns1:sendRequestXMLResponse>
I receive the following error:
<CheckQueryRs statusCode="1" statusSeverity="Info" statusMessage="A query request did not find a matching object in QuickBooks" />
If I go into QuickBooks I can see there are checks associated with the account so I'm not sure why this doesn't return a result.
Update 1: I rewrote this without the AccountFilter so it returned every check and I found checkes with the 800000F1-1362066981 account. It's also 10 MB so it's really hard to work with. :-)

jasper Rest client - uuid not found in session

I have to code a PHP front end for my Jasper reports. I could successfully connect to the server, authenticate and view the repositories using the jasper REST calls. However, when I try to access a report, I get the following error in the response body:
Report not found (uuid not found in session)
The php code is given below:
$uri = "http://localhost:8080/jasperserver/rest/report/samples/Client_Information_Report?RUN_OUTPUT_FORMAT=html";
//PUT request to run the report
$response = Httpful\Request::put($uri, $payload)
->authenticateWith("jasperadmin", "jasperadmin")
->send();
$xml = new SimpleXMLElement($response->body);
$uuid = (String)$xml->uuid; //The uuid is successfully returned
$uri = "http://localhost:8080/jasperserver/rest/report/$uuid?file=report";
$report = Httpful\Request::get($uri)
->authenticateWith("jasperadmin", "jasperadmin")
->send();
I am able to confirm that a uuid is returned with the first PUT. Is there anything I am missing here? Any help is appreciated.
Janenz,
First check the info that is coming from the PUT response to see if there is actually a report being generated and that is not empty, you should receive something like this:
<report>
<uuid>d7bf6c9-9077-41f7-a2d4-8682e74b637e</uuid>
<originalUri>/reports/samples/AllAccounts</originalUri>
<totalPages>43</totalPages>
<startPage>1</startPage>
<endPage>43</endPage>
<file type="image/png">img_0_0_0</file>
<file type="image/gif">px</file>
<file type="text/html">report</file>
<file type="image/jpeg">img_0_42_27</file>
<file type="image/png">img_0_42_26</file>
</report>
Notice the number of pages and the files available.
I have not used the Httpful library, but another thing to check is the way that library uses the Basic Authentication. It may happen that the second call is logging you in again and creating a new session; that is why you cannot find the UUID of the current session.
I have a full JasperServer and PHP sample in GitHub that you can check, it has the repository browsing and input control rendering implemented.
I'm not sure what version of JasperReports Server you are using but in the new version there is a new REST API that makes requesting reports a lot easier; check the JasperReports Server Web Services Guide (Section 3.2). I have that implemented in the JRS-Wrapper Branch of my project.
Hope this helps!!
MarianoL