Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
elkhounds
Creator
Creator

Is it possible to load data (> 10,000 rows) to Host Analytics using their SOAP API?

Greetings,

 

My use case is to create a Talend job that calls Host Analytics' SOAP API to load data from a Oracle table (> 100,000 rows) into a hosted table. I was successful (with help from rhall_2_0) in creating a job that uses the tREST component to call Host Analytics' SOAP API to clear the data from the hosted table. It appears possible to load a few rows of data using tREST, but would like to know what the optimum approach is (and which components to use) for loading many rows (full refresh).  And will it be necessary to use a different Talend product, such as API Designer,Cloud or ESB?

 

Let me know if you need more information.

Thanks

Labels (2)
19 Replies
Anonymous
Not applicable

This depends entirely on Host Analytic's API to be honest. You shouldn't need a different product. What you need to find out is if you can supply more than one record per API call. My assumption is that you probably can. You then need to find out how many records you can supply in one API call. Once you have that information we can help.

elkhounds
Creator
Creator
Author

Great to hear from you.

 

Records you can supply in one API call: 400K records.

 

Here is documentation from HA for the load_data operation:

Syntax

OperationResult = api.Load_Data(String RuleCode, String ObjectArray(), String Delimiter)

Usage

Use the Load_Data call to load COA Segment / GL data to staging tables in Host Analytics. When a Client application invokes the Load_Data call, it passes in the rule code and collection of strings with custom delimiter (like “,”,”;”,”|_|” etc). Each string in the collection represents a data row of the COA segment / GLData that is to be loaded into Host Analytics.

Upon invocation, the Web Service parses the string collection and (based on the rule code) transfers the COA segment / GL Data to the staging table in the database and returns an operation result object, which contains the status and status message of the operation. The Client application can then use methods for the operation result objects and retrieve information.

The Client application must be logged in with sufficient access rights to load COA segment / GL data.

Arguments List

The following table provides a list of arguments that are required for Load_Data method call:

Name Type Description
RuleCode String The name of the rule that is configured in the ETL of the Host Analytics application.
ObjectArray String The collection of strings. Each string item in the collection represents a data row of the COA segment / GL data that is to be loaded to the Host application.
Delimiter String The column separator in each row of the source file. Examples are; Comma (,), Tab (VBTab), | (Pipe), ; (Semicolon)

Response

OperationResult

The Load_Data method call returns an OperationResult object, which contains the status and the status message of the Load_Data method call.

Sample Code

0683p000009MI6o.png

 

The following are samples of SOAP API request and response for the load_data (BulkStringLoadWithLogin):

POST /HostAPI/HostAPI_StateFree.asmx HTTP/1.1
Host: epm10.hostanalytics.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.HostAnalytics.com/API/SOAP/StateFree/Common/2009/03/19/BulkStringLoadWithLogin"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <BulkStringLoadWithLogin xmlns="http://www.HostAnalytics.com/API/SOAP/StateFree/Common/2009/03/19">
      <LoginName>string</LoginName>
      <Password>string</Password>
      <TenantCode>string</TenantCode>
      <Rule>string</Rule>
      <Data>
        <string>string</string>
        <string>string</string>
      </Data>
      <strDelimiter>string</strDelimiter>
    </BulkStringLoadWithLogin>
  </soap:Body>
</soap:Envelope>

 

 


<ns1:Envelope xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
  <ns1:Body>
    <ns2:BulkStringLoadWithLogin xmlns:ns2="http://www.HostAnalytics.com/API/SOAP/StateFree/Common/2009/03/19">
      <ns2:LoginName>**********</ns2:LoginName>
      <ns20683p000009MAB6.pngassword>**********</ns20683p000009MAB6.pngassword>
      <ns2:TenantCode>*********</ns2:TenantCode>
      <ns2:Rule>WS_Actual_Transaction_Detail_Load</ns2:Rule>
      <ns20683p000009MACJ.pngata>
        <ns2:string>2@@720.000@@Wholesale@@QW-000172-BLK/SMK@@C001476@@Default@@139@@2019@@6@@-35.74</ns2:string>

<ns2:string>2@@720.000@@Wholesale@@QW-000172-BLK/SMK@@C001476@@Default@@139@@2019@@6@@-35.74</ns2:string>

<ns2:string>2@@720.000@@Wholesale@@QW-000172-BLK/SMK@@C001476@@Default@@139@@2019@@6@@-35.74</ns2:string>

.

.

.

.

      </ns20683p000009MACJ.pngata>
      <ns2:strDelimiter>@@</ns2:strDelimiter>
    </ns2:BulkStringLoadWithLogin>
  </ns1:Body>
</ns1:Envelope>

 

Thanks

Anonymous
Not applicable

I thought your question had been answered. You say that your API call can take 400K records. It is therefore possible to load 10,000 rows of data. I am surprised that one call can take 400K records if I'm honest. However, what you need to do is build your SOAP message with varying numbers of records and test it out.

elkhounds
Creator
Creator
Author

Thanks for getting back.

 

I was thinking, once I got the answer (API call can take 400K records), I would get some help designing the SOAP message.  This is all new to me.

 

Could you direct me to an example of a design that uses the tSOAP component (or an alternative component) and processes multiple records? Or at least, which components are required?

 

Thanks for all you help

 

 

Anonymous
Not applicable

OK, since this is a simple example, I will show you how I would do this. I assume that you can hardcode the main body of the SOAP message and all you need to write dynamically is this bit.....

 

<Data>
<string>string</string>
<string>string</string>
</Data>

You can do this using a tMap component and a tAggregateRow component. My example job looks like this.....

0683p000009M6Mr.png

Pass your data into the tMap and create a tMap variable as shown below...

0683p000009M6NG.png
The code I used for the tMap Variable is below....

Var.data_merged!=null ? Var.data_merged+"<string>"+row1.data+"</string>" : "<string>"+row1.data+"</string>" 

What this does is concatenate the values you get from your input and wraps them in <string> elements.

 

Then in the output I do the following.....

0683p000009M6NH.png
The code in the output looks like this....

"<Data>"+Var.data_merged +"</Data>" 

The above wraps the variable value in a <Data> element.

 

The next component is important. It is the tAggregateRow component. We set this to only return the last row. By this point, every row will be concatenated together in the format you need. For example....

 

0683p000009M66Y.png
The output of this in my test job looks like this (keep in mind I am just generating random data)...

<Data><string>Jh28bY</string><string>mSbdiR</string><string>l3Eo0J</string><string>g0GUhi</string><string>Xhlkxj</string><string>Mvc8dT</string><string>twWFp8</string><string>YIwo4H</string><string>Q5tgpD</string><string>YlGwAJ</string><string>t7ImxJ</string><string>tH6rbE</string><string>J7eS49</string><string>Gjecrg</string><string>yOnSwn</string><string>ec0ZE1</string><string>x8Q01A</string><string>qTlckn</string><string>TkuImB</string><string>4u6P0n</string><string>OGoejI</string><string>UBipjU</string><string>zM1lew</string><string>CEGn2o</string><string>tbgmFg</string><string>oRVAke</string><string>V4J6hl</string><string>AgNWPs</string><string>cB5hJu</string><string>ntA3JO</string><string>lLi6So</string><string>CxWxYk</string><string>3023xc</string><string>qldN93</string><string>azTpaZ</string><string>4kGuLj</string><string>Q0OShH</string><string>rh61h6</string><string>jwWhOn</string><string>5msIQK</string><string>llkEXI</string><string>EckhcA</string><string>iotjIj</string><string>YyLpVS</string><string>XkP6pT</string><string>ok2SJf</string><string>Mg5jE4</string><string>6ei38l</string><string>wXdUSI</string><string>OYBadn</string><string>oI5zOR</string><string>ShAkFB</string><string>zP6tmJ</string><string>LACcwW</string><string>dsWEHT</string><string>LK8Jiq</string><string>urTtNa</string><string>4dyGDI</string><string>KzukJS</string><string>h8poUl</string><string>uMhyzV</string><string>3HuP12</string><string>B2WVPv</string><string>vUqLG2</string><string>DQOBcc</string><string>XgxEF1</string><string>9KcUPO</string><string>3xJWNc</string><string>EC9ViV</string><string>ZFnhcL</string><string>i3P9g5</string><string>y4Os4G</string><string>8Qdqha</string><string>hEKZBT</string><string>4VoRGW</string><string>xBV42L</string><string>RJjGhc</string><string>IBU0R4</string><string>o1Lm91</string><string>ku8reQ</string><string>KUd0pX</string><string>pLjwQf</string><string>E3zedZ</string><string>7DJ0G7</string><string>F5lzFW</string><string>qF52uy</string><string>7H1sOP</string><string>0ZQvRc</string><string>PwVd5w</string><string>q0rG6c</string><string>1mGfZu</string><string>ZPD4Vc</string><string>m6Sj4l</string><string>Oq7Bc8</string><string>ZK2ElA</string><string>ky9IYt</string><string>KRdV07</string><string>CkmnWK</string><string>iV0AvA</string><string>n4AXTT</string></Data>


Have a play with this and see where you get

elkhounds
Creator
Creator
Author

Greetings,

 

I have some good new and bad news. First, I worked with Host support and was able to finally properly configure the tSOAP component. I inserted hard-coded values into the SOAP message and called the load_data operation which  successfully loaded several rows into the Host Target table. Second, I used your example and created a data_merged variable in tMap that concatenates the 24 column values for each row.

 

But when I run the job, I receive a Fault message: <soap:Fault xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>soap0683p000009M9p6.pngerver</faultcode><faultstring>Souce data has less number of columns than configured for the rule in Host CPM ETL</faultstring><faultactor>https://epm10.hostanalytics.com/HostAPI/HostAPI_StateFree.asmx</faultactor><detail /></soap:Fault>.

 

The Source data set has 24 columns and the Target data set has 24 columns, so the error does not make sense.

Further, when I capture the data_merged variable (using the components from your example) and insert it into only the tSOAP and tLogRow, the row is successfully loaded into the Target table on Host.

 

I have spend a lot of time plugging a way trying to find the solution and I must be close.

 

Could you please review the attached snips (total of 9) and indicate if the tMap mapping/data_merged variable looks correct, if the tSOAP message looks good, etc. Let me know if need any other information

 

Thanks

Anonymous
Not applicable

If the data is loading and you get this weird error, you need to speak to the entity providing the service. This is not a problem with Talend

elkhounds
Creator
Creator
Author

Right, the data is only loading when I hard-code the data into the SOAP message.

 

But when I run the Talend job as I described it, the error occurs.

 

So, I agree for the most part regarding the service provider (and I am working with their support as well),

but since I am a beginner with SOAP/web services, etc. I would appreciate it if you could review what I provided and hopefully see something incorrect.

 

Thanks so much

 

Ray