Obama-era homelessness official removed by Trump administration
by Marty JohnsonMatthew Doherty, executive director of the U.S. Interagency Council on Homelessness (USICH), announced Friday that he had left his position at the behest of the Trump administration.
Doherty wrote in an email to co-workers the same day that the administration "no longer wishes to have me," The Washington Post reported.
He also announced his departure from the federal agency via Twitter.
Doherty was appointed to the role in 2015 under the Obama administration.
The USICH, created in 1987, works to coordinate the federal government's response to homelessness across 19 agencies, including the Housing and Urban Development, Education, and Labor and Commerce departments, the Post reported.
The ousting of Doherty comes as President Trump attempts to solve the country's homelessness problem, especially in California.
However, an official with knowledge of the administration's plans told the Post that the USICH hasn't been included in conversations regarding what to do about the country's homelessness problem.
Trump has promised to fix the homelessness problem but has yet to introduce a concrete solution.
 “We’re looking at it, and we’ll be doing something about it.”
The Hill reached out to the White House for comment.


Overview
This guide is intended to walk you through the process of creating a Purchase Order (PO) and Purchase Order Shipment Notice (POSN) in RQ using the Customer Managed Inventory (CMI) API.
The CMI API allows companies to create purchase orders for their own RQ database using an API.
Figure 1: CMI flow
Who Is This Guide For?
You may be interested in this guide if your company uses RQ and you are interested in joining the CMI program.
Postman Example
iQmetrix uses Postman when testing and debugging our APIs.
For Chrome or Mac users, click the button below to import the collection directly into Postman.
Alternatively, you can download the collection by clicking here
Onboarding Package
As part of the onboarding process, you will have received an onboarding package from the iQmetrix API team. This package provides you credentials and access details in order to perform the topics covered in this guide.
Should you require information beyond the scope of this guide, or did not receive the onboarding package, contact API Support.
Architecture
The CMI API is implemented as a web service using standard Simple Object Access Protocol (SOAP) to send XML messages between vendor and iQmetrix.
This allows the API to be platform and programming language independent.
Communication is done using SSL on the standard port 443 in order to secure data transfers.
Environment
iQmetrix provides you with two environments, Sandbox and Production.
Table 1: CMI Environments and WSDL locations
| Name | Description | WSDL |
|---|---|---|
| Sandbox | Used for testing your API and end-to-end testing | https://vmidemo.iqmetrix.net/VMIClientService.asmx |
| Production | Used once development is complete | https://vmi1.iqmetrix.net/VMIClientService.asmx |
For more information, see Environments.
Steps
Step 1 - Authentication
In order to make authorized requests to the CMI API, you need credentials: a username, password, and the CompanyID
for your company.
Please contact API Support for credentials.
Step 2 - Get Store List
Example Request
POST https://vmidemo.iqmetrix.net/VMIClientService.asmx/?op=GetStoreList
Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<GetStoreList xmlns="http://www.iqmetrix.com">
<client>
<ClientID>9DC6AA95-856B-42C9-8AAF-392A2A02AC77</ClientID>
<Username>sampleusername</Username>
<Password>samplepassword</Password>
</client>
</GetStoreList>
</soap:Body>
</soap:Envelope>
Code Example Request
CmiServiceSoapClient cmiService = new CMIServiceSoapClient();
ClientIdentity client = new ClientIdentity();
client.ClientID = new GUID("9DC6AA95-856B-42C9-8AAF-392A2A02AC77");
client.Username = "sampleusername";
client.Password = "samplepassword";
StoreInformation[] stores = cmiService.GetStoreList(client);
Example Response
HTTP 200 Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<GetStoreListResponse xmlns="http://www.iqmetrix.com">
<GetStoreListResult>
<StoreInformation>
<StoreID>36</StoreID>
<Name>Cornwall West</Name>
<Abbreviation>CWW</Abbreviation>
<Address>2102 11th Ave</Address>
<City>Regina</City>
<Country>Canada</Country>
<District>Regina</District>
<PhoneNumber>5555555555</PhoneNumber>
<PostalZipCode>S2S 2S2</PostalZipCode>
<ProvinceState>Saskatchewan</ProvinceState>
<Region>Regina</Region>
<ShipToStoreID>-1</ShipToStoreID>
<BillToStoreID>-1</BillToStoreID>
</StoreInformation>
</GetStoreListResult>
</GetStoreListResponse>
</soap:Body>
</soap:Envelope>
To create a purchase order for a store, you must know its StoreID
.
The request Getting a Store List is used to get a list of all CMI enabled stores for a company.
36
will be used in the following steps.
Step 3 - Run a Report
Example Request
POST https://vmirc.iqmetrix.net/VMIClientService.asmx/?op=GetProductSalesReport
Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<GetProductSalesReport xmlns="http://www.iqmetrix.com">
<client>
<ClientID>9DC6AA95-856B-42C9-8AAF-392A2A02AC77</ClientID>
<Username>sampleusername</Username>
<Password>samplepassword</Password>
<StoreID>36</StoreID>
</client>
<storeId>36</storeId>
<startDate>01/01/2016</startDate>
<endDate>01/30/2016</endDate>
</GetProductSalesReport>
</soap:Body>
</soap:Envelope>
Code Example Request
CmiServiceSoapClient cmiService = new CMIServiceSoapClient();
ClientIdentity client = new ClientIdentity();
client.ClientID = new GUID("9DC6AA95-856B-42C9-8AAF-392A2A02AC77");
client.Username = "sampleusername";
client.Password = "samplepassword";
client.StoreID = 36;
ProductSalesReportData[] productReport = cmiService.GetProductSalesReport(client, "01/01/2016", "01/30/2016", 36);
Example Response
HTTP 200 Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetProductSalesReportResponse
xmlns="http://www.iqmetrix.com">
<GetProductSalesReportResult>
<ProductSalesReportData>
<CategoryPath>Activation >> Dropship</CategoryPath>
<ChannelID>4bbb842d-0340-4ffc-9216-bf170c861424</ChannelID>
<ChannelName>First Channel</ChannelName>
<Description></Description>
<DistrictID>1</DistrictID>
<DistrictName>First District</DistrictName>
<InvoicedBy>iQmetrix User</InvoicedBy>
<ListPrice>99.99</ListPrice>
<ProductItemID>11142</ProductItemID>
<ProductSKU>CECPSM000017</ProductSKU>
<Quantity>1</Quantity>
<Refund>false</Refund>
<RegionID>1</RegionID>
<RegionName>First Region</RegionName>
<RqInvoiceIdByStore>BDP123</RqInvoiceIdByStore>
<SoldOn>1/21/2016 4:58:24 PM</SoldOn>
<StoreID>36</StoreID>
<TrackingNumber>12345</TrackingNumber>
<VendorSKU>WMGCMSSL12</VendorSKU>
</ProductSalesReportData>
</GetProductSalesReportResult>
</GetProductSalesReportResponse>
</soap:Body>
</soap:Envelope>
To assist in determining which products need to be replenished the CMI API provides a report to get detailed sell through data, Product Sales Report.
For this example the Product Sales Report will be run for the Cornwall West store for January 1-30th, 2016 using the following parameters:
- StoreID value
36
from Step 2 - StartDate value
01/01/2016
for January 1st, 2016 - EndDate value
01/30/2016
for January 30th, 2016
WMGCMSSL12
will be used in the following steps.
(Optional) Step 4 - Get Inventory Information
Example Request
POST https://vmirc.iqmetrix.net/VMIClientService.asmx/?op=GetReceivingInfo
Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<GetReceivingInfo xmlns="http://www.iqmetrix.com">
<client>
<ClientID>9DC6AA95-856B-42C9-8AAF-392A2A02AC77</ClientID>
<Username>sampleusername</Username>
<Password>samplepassword</Password>
<StoreID>36</StoreID>
</client>
<StartDate>01/01/2016</StartDate>
<EndDate>01/30/2016</EndDate>
</GetReceivingInfo>
</soap:Body>
</soap:Envelope>
Code Example Request
CmiServiceSoapClient cmiService = new CMIServiceSoapClient();
ClientIdentity client = new ClientIdentity();
client.ClientID = new GUID("9DC6AA95-856B-42C9-8AAF-392A2A02AC77");
client.Username = "sampleusername";
client.Password = "samplepassword";
ReceivingInfo[] received = cmiService.GetReceivingInfo(client, "01/01/2016", "01/30/2016");
Example Response
HTTP 200 Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<GetReceivingInfoResponse xmlns="http://www.iqmetrix.com">
<GetReceivingInfoResult>
<ReceivingInfo>
<ProductItemID>12644</ProductItemID>
<ProductName>96164 gift card</ProductName>
<ShipToStoreID>1</ShipToStoreID>
<ShipToStoreName>Cornwall Centre</ShipToStoreName>
<RQPurchaseOrderNumber>CORNWPO3573</RQPurchaseOrderNumber>
<VendorName>Apple</VendorName>
<VendorSKU />
<SerialNumber />
<Quantity>100</Quantity>
<DateReceived>7/22/2016 3:29:22 PM</DateReceived>
<ProductCost>0</ProductCost>
<RQReceivingNumber>CORNWRE6058</RQReceivingNumber>
</ReceivingInfo>
</GetReceivingInfoResult>
</GetReceivingInfoResponse>
</soap:Body>
</soap:Envelope>
If the report did not provide enough information to decide which products to replenish, the CMI API provides the request Getting Receiving Info to get a list of products received in a given date range.
Step 5 - Create a Purchase Order
Example Request
POST https://vmidemo.iqmetrix.net/VMIClientService.asmx/?op=CreatePurchaseOrderShipmentNotice
Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<CreatePurchaseOrder xmlns="http://www.iqmetrix.com">
<client>
<ClientID>9DC6AA95-856B-42C9-8AAF-392A2A02AC77</ClientID>
<Username>sampleusername</Username>
<Password>samplepassword</Password>
<StoreID>36</StoreID>
</client>
<vendorId>96D20A50-65BB-42EE-B6D2-001CFBE8F848</vendorId>
<PurchaseOrder>
<PurchaseOrderData>
<BillToStoreID>36</BillToStoreID>
<EstimatedArrivalDate>01/01/2017</EstimatedArrivalDate>
<ShipToStoreID>36</ShipToStoreID>
<VendorInvoiceNumber>11412512</VendorInvoiceNumber>
</PurchaseOrderData>
<ProductsOrdered>
<ProductInformation>
<VendorSKU>WMGCMSSL12</VendorSKU>
<QuantityOrdered>1</QuantityOrdered>
</ProductInformation>
</ProductsOrdered>
</PurchaseOrder>
</CreatePurchaseOrder>
</soap:Body>
</soap:Envelope>
Code Example Request
CmiServiceSoapClient cmiService = new CMIServiceSoapClient();
ClientIdentity client = new ClientIdentity();
client.ClientID = new GUID("9DC6AA95-856B-42C9-8AAF-392A2A02AC77");
client.Username = "sampleusername";
client.Password = "samplepassword";
client.StoreID = 36;
DateTime ead1 = DateTime.Today.AddDays(14);
string eta = String.Format("{0:D2}/{1:D2}/{2:D4}", ead1.Month, ead1.Day, ead1.Year);
PurchaseOrder po = new PurchaseOrder();
po.PurchaseOrderID = new Guid();
po.PurchaseOrderData = new PurchaseOrderData();
po.PurchaseOrderData.BillToStoreID = 36;
po.PurchaseOrderData.ShipToStoreID = 36;
po.PurchaseOrderData.VendorInvoiceNumber = "11412512";
po.PurchaseOrderData.EstimatedArrivalDate = eta;
po.ProductsOrdered = new ProductInformation[1];
po.ProductsOrdered[0] = new ProductInformation();
po.ProductsOrdered[0].VendorSKU = "WMGCMSSL12";
po.ProductsOrdered[0].QuantityOrdered = 1;
PurchaseOrder poCreated = cmiService.CreatePurchaseOrder(vendor, po);
Example Response
HTTP 200 Content-Type: text/xml
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<CreatePurchaseOrderResponse xmlns="http://www.iqmetrix.com">
<CreatePurchaseOrderResult>
<PurchaseOrderID>28890f70-6fc9-4a9b-9458-410a8d08502d</PurchaseOrderID>
<PurchaseOrderData>
<PurchaseOrderID>28890f70-6fc9-4a9b-9458-410a8d08502d</PurchaseOrderID>
<RetailiQPurchaseOrderID>22140</RetailiQPurchaseOrderID>
<RetailiQPurchaseOrderNumber>ANLOCPO6</RetailiQPurchaseOrderNumber>
<ShipToStoreID>36</ShipToStoreID>
<ShipToVendorAccountNumber />
<BillToStoreID>36</BillToStoreID>
<BillToVendorAccountNumber />
<OrderTotal>-1</OrderTotal>
<ShippingTotal>-1</ShippingTotal>
<VendorInvoiceNumber>11412512</VendorInvoiceNumber>
<EstimatedArrivalDate>01/01/2017</EstimatedArrivalDate>
<ShipToStoreName />
<BillToStoreName />
<VendorName />
<CreatedByVMI>true</CreatedByVMI>
<CreatedDate>10/14/2016 09:39:05</CreatedDate>
<IsDeleted>false</IsDeleted>
</PurchaseOrderData>
<ProductsOrdered>
<ProductInformation>
<ProductID>00000000-0000-0000-0000-000000000000</ProductID>
<VendorSKU>WMGCMSSL12</VendorSKU>
<ProductItemID>0</ProductItemID>
<MaximumLevel>-1</MaximumLevel>
<MinimumLevel>-1</MinimumLevel>
<ProductCost>90.01</ProductCost>
<QuantityInStock>-1</QuantityInStock>
<QuantityOnOrder>-1</QuantityOnOrder>
<QuantityOnUncommittedOrder>-1</QuantityOnUncommittedOrder>
<QuantityOnBackOrder>-1</QuantityOnBackOrder>
<QuantityInTransfer>-1</QuantityInTransfer>
<QuantityTransferIn>-1</QuantityTransferIn>
<QuantityTransferOut>-1</QuantityTransferOut>
<QuantityOnRMA>-1</QuantityOnRMA>
<QuantityOnLoan>-1</QuantityOnLoan>
<QuantityCommittedOnOrderEntry>-1</QuantityCommittedOnOrderEntry>
<QuantitySuggestedByVendor>-1</QuantitySuggestedByVendor>
<QuantitySold>-1</QuantitySold>
<GrossQuantitySold>-1</GrossQuantitySold>
<GrossQuantityReturned>-1</GrossQuantityReturned>
<QuantityOrdered>4</QuantityOrdered>
<QuantityReceived>-1</QuantityReceived>
<ProductReceived>false</ProductReceived>
<Enabled>false</Enabled>
<MinMaxLocked>false</MinMaxLocked>
<DoNotOrder>false</DoNotOrder>
<DateEOL xsi:nil="true" />
<RetailPrice>0</RetailPrice>
<SalePrice xsi:nil="true" />
<SaleBegin xsi:nil="true" />
<SaleEnd xsi:nil="true" />
</ProductInformation>
</ProductsOrdered>
</CreatePurchaseOrderResult>
</CreatePurchaseOrderResponse>
</soap:Body>
</soap:Envelope>
The request Creating a Purchase Order allows you to create a purchase order for a particular store and a set of products.
For this example the Purchase Order will have the following properties:
- BillToStoreID and ShipToStoreID value
36
from Step 2 - VendorSKU value
WMGCMSSL12
from Step 3 - Unique VendorInvoiceNumber value
11412512
When created, the Purchase Order will appear in the Inventory section of RQ.
Figure 1: Purchase Order in RQ
28890f70-6fc9-4a9b-9458-410a8d08502d
will be used in the following steps.
(Optional) Step 6 - Create a Purchase Order Shipment Notice
Example Request
POST https://vmidemo.iqmetrix.net/VMIClientService.asmx/?op=CreatePurchaseOrderShipmentNotice
Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<CreatePurchaseOrderShipmentNotice xmlns="http://www.iqmetrix.com">
<client>
<ClientID>9DC6AA95-856B-42C9-8AAF-392A2A02AC77</ClientID>
<Username>sampleusername</Username>
<Password>samplepassword</Password>
<StoreID>36</StoreID>
</client>
<notice>
<PurchaseOrderShipmentNotice>
<PurchaseOrderID>a8a6b722-a04e-46bc-953b-ff16e5f6eb5e</PurchaseOrderID>
<Quantity>1</Quantity>
<VendorSKU>WMGCMSSL12</VendorSKU>
<SerialNumbers>
<string>97000012</string>
</SerialNumbers>
</PurchaseOrderShipmentNotice>
</notice>
</CreatePurchaseOrderShipmentNotice>
</soap:Body>
</soap:Envelope>
Code Example Request
CmiServiceSoapClient cmiService = new CMIServiceSoapClient();
ClientIdentity client = new ClientIdentity();
client.ClientID = new GUID("9DC6AA95-856B-42C9-8AAF-392A2A02AC77");
client.Username = "sampleusername";
client.Password = "samplepassword";
client.StoreID = 36;
PurchaseOrderShipmentNotice shipmentNotice = new PurchaseOrderShipmentNotice();
shipmentNotice.PurchaseOrderID = new GUID();
shipmentNotice.Quantity = 1;
shipmentNotice.VendorSKU = "WMGCMSSL12";
shipmentNotice.SerialNumber = {"97000012"};
PurchaseOrderShipmentNotice snReturn = cmiService.CreatePurchaseOrderShipmentNotice(client, new[] { shipmentNotice });
Example Response
HTTP 200 Content-Type: text/xml
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<CreatePurchaseOrderShipmentNoticeResponse xmlns="http://www.iqmetrix.com">
<CreatePurchaseOrderShipmentNoticeResult>
<PurchaseOrderShipmentNotice>
<ShipmentNumber>JUMHO22073-10</ShipmentNumber>
<PurchaseOrderID>00000000-0000-0000-0000-000000000000</PurchaseOrderID>
<RQPurchaseOrderID>22073</RQPurchaseOrderID>
<ProductItemID>11142</ProductItemID>
<Quantity>1</Quantity>
<SerialNumbers>
<string>97000012</string>
</SerialNumbers>
</PurchaseOrderShipmentNotice>
</CreatePurchaseOrderShipmentNoticeResult>
</CreatePurchaseOrderShipmentNoticeResponse>
</soap:Body>
</soap:Envelope>
The request Creating a Purchase Order Shipment Notice allows you to create a shipment notice for an existing purchase order with serial numbers.
For this example the Purchase Order Shipment Notice will have the following properties:
- StoreID value
36
from Step 2 - PurchaseOrderID value
28890f70-6fc9-4a9b-9458-410a8d08502d
from Step 5 - VendorSKU value
WMGCMSSL12
from Step 3 - SerialNumber value
97000012
Next Steps
Now that you have created a Purchase Order and/or Purchase Order Shipment Notice, you may be interested in:
- Updating the Location for a Purchase Order
- Updating Comments for a Purchase Order
- Creating an Uncommitted Purchase Order
- Getting Purchase Orders By Status
- Getting Purchase Orders By Reference Number
- Getting Client Purchase Orders By Business Key
Troubleshooting
If you encouter any errors while following this guide,
See Errors


[1]
not much to like; need to be an astronaut to operate it
[2]
Easy to use, great size, great picture quality; None so far


|
| #define | BOOST_PP_ENUM_TRAILING BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, BOOST_PP_AUTO_REC(BOOST_PP_REPEAT_P, 4)) |
| |
| #define | BOOST_PP_ENUM_TRAILING_1(c, m, d) BOOST_PP_ENUM_TRAILING_1_I(c, m, d) |
| |
| #define | BOOST_PP_ENUM_TRAILING_2(c, m, d) BOOST_PP_ENUM_TRAILING_2_I(c, m, d) |
| |
| #define | BOOST_PP_ENUM_TRAILING_3(c, m, d) BOOST_PP_ENUM_TRAILING_3_I(c, m, d) |
| |
| #define | BOOST_PP_ENUM_TRAILING_1_I(c, m, d) BOOST_PP_REPEAT_1(c, BOOST_PP_ENUM_TRAILING_M_1, (m, d)) |
| |
| #define | BOOST_PP_ENUM_TRAILING_2_I(c, m, d) BOOST_PP_REPEAT_2(c, BOOST_PP_ENUM_TRAILING_M_2, (m, d)) |
| |
| #define | BOOST_PP_ENUM_TRAILING_3_I(c, m, d) BOOST_PP_REPEAT_3(c, BOOST_PP_ENUM_TRAILING_M_3, (m, d)) |
| |
| #define | BOOST_PP_ENUM_TRAILING_4(c, m, d) BOOST_PP_ERROR(0x0003) |
| |
| #define | BOOST_PP_ENUM_TRAILING_M_1(z, n, md) BOOST_PP_ENUM_TRAILING_M_1_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, md), BOOST_PP_TUPLE_ELEM(2, 1, md)) |
| |
| #define | BOOST_PP_ENUM_TRAILING_M_2(z, n, md) BOOST_PP_ENUM_TRAILING_M_2_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, md), BOOST_PP_TUPLE_ELEM(2, 1, md)) |
| |
| #define | BOOST_PP_ENUM_TRAILING_M_3(z, n, md) BOOST_PP_ENUM_TRAILING_M_3_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, md), BOOST_PP_TUPLE_ELEM(2, 1, md)) |
| |
| #define | BOOST_PP_ENUM_TRAILING_M_1_I(z, n, m, d) , m(z, n, d) |
| |
| #define | BOOST_PP_ENUM_TRAILING_M_2_I(z, n, m, d) , m(z, n, d) |
| |
| #define | BOOST_PP_ENUM_TRAILING_M_3_I(z, n, m, d) , m(z, n, d) |
| |


Python API¶
The server initiates calls to python scripts, while the python script is a responder to the server’s requests.
Python API Helpers
Use the helper function: readJsonRequestData() to read the json-formatted data from the file and convert the json to a python dict.
Use the helper function: writeJsonResponseData() to convert the python data to json, write it to a file, and pass the filename back to the caller via stdout.
This file is checked into the repository as server/pythonApiHelpers.py.
Requests
Requests and responses have only one parameter: a file name containing the data in JSON format. Use the helper function: readJsonRequestData() to read the json-formatted data from the file and convert the json to a python dict. The data are described in the individual python APIs listed at the bottom of this page.
Example:
python placeNewNodes.py /tmp/x.txt
Response success
The response from the python script is returned in stdout, so that just a print statement is required to pass the temporary filename. This means the only print statements you may have in your scripts include the one to return the filename containing the response data, and errors as described in Response errors.
Use the helper function: writeJsonResponseData() to convert the python data to json, write it to a file, and pass the filename back to the caller via stdout. The data are described in the individual python APIs listed at the bottom of this page.
Response errors
In place of the temporary file name used for success, use stdout to return error and warning messages. Use one of these forms for your message so the UI can echo it. Return a zero after printing the message so the caller will know this is a captured error/warning, and not an unknown exception.
Warning: <some warning, not a failure, but no data>
Error: <some real error that prevented something from happening>
Example:
print 'Warning: some minor issue occurred'
return 0
print 'Error: that just blew everything up'
return 0
Python API JSON data:


404 - Not Found The content you are looking for does not exist anymore or it has been moved somewhere else.


Aseem Behl
2010-12-23
I am trying to run the following sample program to try out Tess4J, but I am getting Unable to load library 'tessdll': exception.
I have checked tessdll.dll is in my path.
I am using 64-bit Windows7. Please help in resolving this issue.
public class TesseractExample { public static void main(String[] args) { File imageFile = new File("C:\\personal\\sc.tiff"); Tesseract instance = Tesseract.getInstance(); // JNA Interface Mapping try { String result = instance.doOCR(imageFile); System.out.println(result); } catch (TesseractException e) { System.err.println(e.getMessage()); } } } Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'tessdll': The specified module could not be found. at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:163) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:236) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:199) at com.sun.jna.Native.register(Native.java:1018) at net.sourceforge.tess4j.TessDllAPI1.<clinit>(Unknown Source) at TesseractExample.main(TesseractExample.java:13)
Quan Nguyen
2011-01-21
That exception is very common for Java programs using native libraries. And the cause is most likely due to the library (.dll) not in the program's path.
If you properly configure JDK and Ant, you can run the program's unit tests by executing the command "ant test" after making Tess4J the current directory.
Anonymous
2012-02-25
Hi,
I have some problem to run tess.
I installed ant and Sdk but the error "Unable to load library 'tessdll'" remain.
I run the script inside the Tess4j dir just downloaded!
Then I would to run Tess4j in a web app on tomcat.
But when i submit a file to the server and perform the text recognition i have this error:
java.util.NoSuchElementException
at javax.imageio.spi.FilterIterator.next(Unknown Source)
at javax.imageio.ImageIO$ImageWriterIterator.next(Unknown Source)
at javax.imageio.ImageIO$ImageWriterIterator.next(Unknown Source)
at net.sourceforge.vietocr.ImageIOHelper.getImageByteBuffer(ImageIOHelper.java:189)
I tried tu put the in [tomcat}/lib but the same error.
Help me!
Thanks
Anonymous
2012-02-25
Probably is because I'm on a win 64bit platform?
any idea?
Thanks
Quan Nguyen
2013-04-06
For java.util.NoSuchElementException, try to call ImageIO.scanForPlugins() before doOCR().
Frithjof Schulte
2013-10-28
Hi,
I try to run the example project under windows with eclipse, but I get the error
Exception in thread "main" java.lang.UnsatisfiedLinkError: The specified module could not be found
In the classpath of the project I have the tess4j.jar and the 4 jar files from the lib folder. The "libtesseract302.dll" is in a "lib" folder in the project folder together with the "liblept168.dll" and the "testdata" folder. This "lib" folder is added to the "java.library.path" of the java-vm (Java 6 Update 45 x32). The tess4j.jar is also added in the build path -> libraries with the "lib" folder with the dll defined as native library location.
When I try to add the dll to the java.library.path via java code in the main function
System.setProperty("java.library.path", System.getProperty("user.dir") + "\\lib"); System.loadLibrary("libtesseract302");
I get the following error.
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\eclipse Workspace\Tess4JDemo\lib\libtesseract302.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1732) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1028) at demo.SimpleExample.main(SimpleExample.java:10)
I hope you can help me.
Thanks!
apollox
EDIT:
Problem solve.
I have move the dll and the testdata to the top of the projectstructure (working directory of the project) and not it works. I do not know why, because at the beginning I had already test this at this position of the structure and it did not work and this time work it.
Elijah K
2013-10-30
Hi Frithjof
Am having the same problem on Netbeans, keeps alternating between
java.lang.UnsatisfiedLinkError: Unable to load library 'libtesseract302'
And
java.lang.NoClassDefFoundError: Could not initialize class net.sourceforge.tess4j.TessAPI
Am stuck on this for the last 3 days #frustrated Can you aide by telling me the procesess you took to eliminate your error?
Quan Nguyen
2013-10-31
Elijah,
Tess4J is itself a NetBeans project. You can simply execute the unit tests in the Test Packages inside the IDE. NB has some issues on Windows 8, however, if you happen to be using it; in that case, execute "ant test" from the command line.
Quan


Coding Quiz Challenge
Try to answer the following code-related questions within the time limit.
Keep in mind that incorrect answers will penalize your score/time by ten seconds!
What is my favorite color?
All Done!!
Your final score is:Enter initials:


Bandwidth Graph
The graph displays throughout test results for forward (src-dst) and reverse(dst-src) directions.
X-value and Y-value labels:
When you mouse over the graph, exact value on the graph is highlighted and the corresponding X axis and Y axis values are displayed near the top-right corner of the graph.
Zoom In:
The graphs support two types of zoom:
- Vertical Zoom(Y axis): Place your mouse-pointer inside the graph and drag the mouse over the range of Y values you want to zoom in.
- Horizontal zoom (X axis): Place your mouse-pointer inside the graph and drag the mouse over the range of X values you want to zoom in.
Zoom out:
To zoom out, double-click inside the graph.
Sharing Graph URL with others:
You can get the URL of the current graph by clicking on the Show/Hide Link located near the Statistics table. Click on the link and copy/paste the URL that appears in the box.
Visualizing other time ranges:
There are two links provided near the graph that allows you to step through specific time periods(1 month). If you want to visualize arbitrary time periods, copy the URL and change the start_time and end_time accordingly.
Delay Graph
The graph displays one way delay test results for a particular source and destination. The graphs has two Y axis. The left axis plots delay values and the right axis is for loss values.
The default view has minimum delay and loss turned on.
Viewing reverse direction:
To view the plot for the reverse direction, check the "Show reverse direction" box located on top of the graph.
Viewing maximum delay, median and quartiles:
Use the options on the left to toggle the maximum delay, median, first quartile and third quartile plots. If you have reverse direction option checked, the options to control the reverse direction plots appear on the right side.
Zoom In:
The graphs support two types of zoom:
- Vertical Zoom(Y axis): Place your mouse-pointer inside the graph and drag the mouse over the range of Y values you want to zoom in.
- Horizontal zoom (X axis): Place your mouse-pointer inside the graph and drag the mouse over the range of X values you want to zoom in.
Zoom out:
To zoom out, double-click inside the graph.
Sharing Graph URL with others:
You can get the URL of the current graph by clicking on the Show/Hide Link located near the Statistics table. Click on the link and copy/paste the URL that appears in the box.
Visualizing other time ranges:
There are two links provided near the graph that allows you to step through specific time periods(1 month). If you want to visualize arbitrary time periods, copy the URL and change the start_time and end_time accordingly.