Skip to main content

Its my first SOAP ingestion.

The XML looks like this 

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ListPublishedFilesResponse xmlns="http://something-something.com">
<ListPublishedFilesResult>
<idbdata xmlns="">
<originator>
<company name="ABC Corp" url="http://www.abc.corp" />
<contact name="ABC Corp" email="post@abc.corp" />
</originator>
<generation date="2024-12-09 10:43:09" dateutc="2024-12-09 09:43:09" />
<contract origin="tendsign.com" tendsigncontractid="2649113" name="Protocol" referencename="1 (ABC-01)" startdate="2018-07-01 00:00:00" startdateutc="2018-06-30 22:00:00" enddate="2025-06-30 00:00:00" enddateutc="2025-06-29 22:00:00" objecttypeid="3">
<attachments>
<file id="15">
<name>ABC123 - Contract</name>
<filename>ABC123-Contract.pdf</filename>
<fileurl>https://contract.abc.com/abc.pdf</fileurl>
<description>Contract</description>
<updated>2024-02-15 14:32:02</updated>
<updatedutc>2024-02-15 13:32:02</updatedutc>
<size>970058</size>
</file>
<file id="15">
<name>ABC123 - Man hours</name>
<filename>Manhours.pdf</filename>
<fileurl>https://contract.abc.com/manhours.pdf</fileurl>
<description>Manhours</description>
<updated>2024-02-15 14:32:14</updated>
<updatedutc>2024-02-15 13:32:14</updatedutc>
<size>505295</size>
</file>
</attachments>
</contract>
</idbdata>
</ListPublishedFilesResult>
</ListPublishedFilesResponse>
</soap:Body>
</soap:Envelope>

I am trying to ingest whats between <attachments></attachments>
For this i have looked at this post: 

I came up with this:

<api:script xmlns:api="http://apiscript.com/ns?v1" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- See Column Definitions to specify column behavior and use XPaths to extract column values from XML. -->
<api:info title="2" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1">
<!-- You can modify the name, type, and column size here. -->
<attr name="name" xs:type="string" readonly="false" other:xPath="/attachments/file/name" />
<attr name="filename" xs:type="string" readonly="false" other:xPath="/attachments/file/filename" />
<attr name="fileurl" xs:type="string" readonly="false" other:xPath="/attachments/file/fileurl" />
</api:info>

<api:set attr="DataModel" value="DOCUMENT" />
<api:set attr="PushAttributes" value="true" />
<api:set attr="EnablePaging" value="true" />

<api:set attr="Header:Name#" value="SOAPAction"/>
<api:set attr="URI" value="https://your.soap.endpoint.com/getData.asmx" />

<api:set attr="XPath" value="/attachments" />
<api:set attr="method" value="POST"/>
<api:set attr="Header:Name" value="Content-Type" />
<api:set attr="Header:Value" value="text/xml" />

<api:set attr="data">
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:uen="uen:esws">
<soapenv:Header/>
<soapenv:Body>
<uen:Esws.ListPublihedFiles soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<pub:SystemUserID>123456</pub:SystemUserID>
<pub:ProjectID>121212</pub:ProjectID>
</uen:Esws.ListPublihedFiles>
</soapenv:Body>
</soapenv:Envelope>
</api:set>
<api:set attr="XPath" value="/Envelope/Body/" />

<!-- The GET method corresponds to SELECT. Here you can override the default processing of the SELECT statement. The results of processing are pushed to the schema's output. See SELECT Execution for more information. -->
<api:script method="GET">
<api:set attr="method" value="GET"/>
<api:call op="xmlproviderGet">
<api:push/>
</api:call>
</api:script>
</api:script>

When i try to view table, i get his error

This is how Connection and, JSON and XML setting looks like 

 

I have managed to narrow down where the error is comming from.

It this code: 

  <api:set attr="Header:Name#" value="SOAPAction"/>
<api:set attr="URI" value="https://your.soap.endpoint.com/getData.asmx" />

TX is expecting XML but is getting ASMX


Edit: that getData.asmx should be the URI of the WDSL I believe.


@RLB 
This is what i am doing in POSTMAN to get XML

 


What if you use POST instead of GET? Looks like you are using POST in Postman.


moving futher

I have changed this: 

<api:set attr="URI" value="https://your.soap.endpoint.com/getData.asmx" />

to

<api:set attr="URI" value="https://your.soap.endpoint.com/getData.asmx?WDSL" />

which returns an XML.

Now, i dont get the error above. 
TX now shows an empty table 

 


This is what i use in POSTMAN to get a response 

I have refined the code in RSD-file to this 

<api:script xmlns:api="http://apiscript.com/ns?v1" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<!-- See Column Definitions to specify column behavior and use XPaths to extract column values from XML. -->
<api:info title="contract" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1">
<attr name="_id" xs:type="string" readonly="false" key="true" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/_id" />
<attr name="description" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/description" />
<attr name="filename" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/filename" />
<attr name="fileurl" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/fileurl" />
<attr name="name" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/name" />
<attr name="size" xs:type="integer" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/size" />
<attr name="updated" xs:type="datetime" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/updated" />
<attr name="updatedutc" xs:type="datetime" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/updatedutc" />
</api:info>

<api:set attr="DataModel" value="RELATIONAL" />
<api:set attr="PushAttributes" value="true" />
<api:set attr="EnablePaging" value="true" />
<api:set attr="Header:Name#" value="SOAPAction"/>
<api:set attr="URI" value="https://your.soap.endpoint.com?wsdl" />
<api:set attr="XPath" value="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file" />
<api:set attr="method" value="POST"/>
<api:set attr="Header:Name" value="Content-Type" />
<api:set attr="Header:Value" value="text/xml" />

<api:set attr="data">
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://publicprocurement.com">
<soap:Header/>
<soap:Body>
<pub:ListPublishedFiles soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
<pub:SystemUserID>123456</pub:SystemUserID>
<pub:ProjectID>66666666</pub:ProjectID>
</pub:ListPublishedFiles>
</soap:Body>
</soap:Envelope>
</api:set>
<api:set attr="XPath" value="/Envelope/Body/" />

<!-- The GET method corresponds to SELECT. Here you can override the default processing of the SELECT statement. The results of processing are pushed to the schema's output. See SELECT Execution for more information. -->
<api:script method="GET">
<api:set attr="method" value="GET"/>
<api:call op="xmlproviderGet">
<api:push/>
</api:call>
</api:script>
</api:script>

I dont get any error in TX but when i preview the table its empty.

In WSDL, ListPublishedFiles that i am trying to reterive is this:

<s:element name="ListPublishedFiles">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="SystemUserID" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="ProjectID" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>

The only differnece i see now is that in the guide the code that replicates what i have in POSTMAN Body is this

<uen:Esws.getUsers soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<p_companyID xsi:type="xsd:string">t_connection.Password]</p_companyID>
<p_page xsi:type="xsd:string"></p_page>
<p_locationID xsi:type="xsd:string">3</p_locationID>
<p_user_id xsi:type="xsd:string"></p_user_id>
</uen:Esws.getUsers>
</soapenv:Body>
</soapenv:Envelope>

While i have copy-.pasted it as it from POSTMAN

<pub:ListPublishedFiles>
<pub:SystemUserID>123456</pub:SystemUserID>
<pub:ProjectID>666666</pub:ProjectID>
</pub:ListPublishedFiles>
</soap:Body>

Whats the difference ?


Hi ​@aftabp 

You run the parts in a sort of wrong order.

Did you see this

I would think it should be structured like this.

<api:script xmlns:api="http://apiscript.com/ns?v1" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<!-- See Column Definitions to specify column behavior and use XPaths to extract column values from XML. -->
<api:info title="contract" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1">
<attr name="_id" xs:type="string" readonly="false" key="true" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/_id" />
<attr name="description" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/description" />
<attr name="filename" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/filename" />
<attr name="fileurl" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/fileurl" />
<attr name="name" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/name" />
<attr name="size" xs:type="integer" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/size" />
<attr name="updated" xs:type="datetime" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/updated" />
<attr name="updatedutc" xs:type="datetime" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/updatedutc" />
</api:info>

<api:set attr="DataModel" value="RELATIONAL" />
<api:set attr="PushAttributes" value="true" />
<api:set attr="EnablePaging" value="true" />
<api:set attr="Header:Name#" value="SOAPAction"/>
<api:set attr="URI" value="https://your.soap.endpoint.com?wsdl" />
<api:set attr="XPath" value="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file" />
<api:set attr="Header:Name" value="Content-Type" />
<api:set attr="Header:Value" value="text/xml" />



<!-- The GET method corresponds to SELECT. Here you can override the default processing of the SELECT statement. The results of processing are pushed to the schema's output. See SELECT Execution for more information. -->
<api:script method="GET">
<api:set attr="method" value="POST"/>
<api:set attr="data">
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://publicprocurement.com">
<soap:Header/>
<soap:Body>
<pub:ListPublishedFiles soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/>
<pub:SystemUserID>123456</pub:SystemUserID>
<pub:ProjectID>66666666</pub:ProjectID>
</pub:ListPublishedFiles>
</soap:Body>
</soap:Envelope>
</api:set>
<api:call op="xmlproviderGet">
<api:push/>
</api:call>
</api:script>
</api:script>

 


@Thomas Lind 
Now i am getting this: 
 

 


 


Hi ​@aftabp 

<api:script xmlns:api="http://apiscript.com/ns?v1" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<!-- See Column Definitions to specify column behavior and use XPaths to extract column values from XML. -->
<api:info title="contract" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1">
<attr name="_id" xs:type="string" readonly="false" key="true" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/_id" />
<attr name="description" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/description" />
<attr name="filename" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/filename" />
<attr name="fileurl" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/fileurl" />
<attr name="name" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/name" />
<attr name="size" xs:type="integer" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/size" />
<attr name="updated" xs:type="datetime" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/updated" />
<attr name="updatedutc" xs:type="datetime" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/updatedutc" />
</api:info>

<api:set attr="DataModel" value="RELATIONAL" />
<api:set attr="PushAttributes" value="true" />
<api:set attr="EnablePaging" value="true" />
<api:set attr="Header:Name#" value="SOAPAction"/>
<api:set attr="URI" value="https://your.soap.endpoint.com?wsdl" />
<api:set attr="XPath" value="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file" />
<api:set attr="Header:Name" value="Content-Type" />
<api:set attr="Header:Value" value="text/xml" />



<!-- The GET method corresponds to SELECT. Here you can override the default processing of the SELECT statement. The results of processing are pushed to the schema's output. See SELECT Execution for more information. -->
<api:script method="GET">
<api:set attr="method" value="POST"/>
<api:set attr="data">
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://publicprocurement.com">
<soap:Header/>
<soap:Body>
<pub:ListPublishedFiles soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
<pub:SystemUserID>123456</pub:SystemUserID>
<pub:ProjectID>66666666</pub:ProjectID>
</pub:ListPublishedFiles>
</soap:Body>
</soap:Envelope>
</api:set>
<api:call op="xmlproviderGet">
<api:push/>
</api:call>
</api:script>
</api:script>

I think I found the issue. Also, turn on logging when you get errors, it will tell you more about what is going on


@Thomas Lind 
Still the same error.
I have sendt you the error log as DM


In my SOAP endpoint, ListPublishedFiles is like this.

<s:element name="ListPublishedFiles">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="SystemUserID" type="s:int"/>
<s:element minOccurs="1" maxOccurs="1" name="ProjectID" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>

In POSTMAN, i write this in HEADER

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://publicprocurement.com">
<soap:Header/>
<soap:Body>
<pub:ListPublishedFiles>
<pub:SystemUserID>123456</pub:SystemUserID>
<pub:ProjectID>666666</pub:ProjectID>
</pub:ListPublishedFiles>
</soap:Body>
</soap:Envelope>
 

 

do i need to use the tags from SOAP endpoint?


The stuff you run in postman should be the closest, but you need to encode it as xml for it to run.

I do notice a difference between what you use in Postman and what you have in the RSD file.

<pub:ListPublishedFiles> in the Postman setup is <pub:ListPublishedFiles soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/> in the RSD.

Can you make these queries exactly the same in both and see what happens?


@Thomas Lind 

The last code that you suggesed gives me an error.
Are there any tags missing?

<!-- The GET method corresponds to SELECT. Here you can override the default processing of the SELECT statement. The results of processing are pushed to the schema's output. See SELECT Execution for more information. -->
<api:script method="GET">
<api:set attr="method" value="POST"/>
<api:set attr="data">
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://publicprocurement.com">
<soap:Header/>
<soap:Body>
<pub:ListPublishedFiles">
<pub:SystemUserID>123456</pub:SystemUserID>
<pub:ProjectID>666666</pub:ProjectID>
</pub:ListPublishedFiles>
</soap:Body>
</soap:Envelope>
</api:set>
<api:call op="xmlproviderGet">
<api:push/>
</api:call>
</api:script>
</api:script>

 

However when i use the following code without the lines below, i get an empty table

	<api:script method="GET">
<api:set attr="method" value="POST"/>
<api:set attr="data">

Here is what i use

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://publicprocurement.com">
<soap:Header/>
<soap:Body>
<pub:ListPublishedFiles/>
<pub:SystemUserID>123456</pub:SystemUserID>
<pub:ProjectID>666666</pub:ProjectID>
</pub:ListPublishedFiles>
</soap:Body>
</soap:Envelope>
</api:set>
<!-- The GET method corresponds to SELECT. Here you can override the default processing of the SELECT statement. The results of processing are pushed to the schema's output. See SELECT Execution for more information. -->
<api:script method="GET">
<api:set attr="method" value="GET"/>
<api:call op="xmlproviderGet">
<api:push/>
</api:call>
</api:script>
</api:script>

 


Hi ​@aftabp 

Yes, it is not doing a post call anymore. Did you turn on logging, that will explain why it was seen as a bad request as it shows the code being executed.


2024-12-12T12:53:29.052+01:00	1	[4|Q-Id]	[INFO|Connec] Opened REST connection. Version: 23.0.8685.0. Edition: [ADO.NET Provider .NET 4.0].
2024-12-12T12:53:29.052+01:00 1 [4|Q-Id] [INFO|Connec] Connection String: accesskey=*****;apikey=*****;authkey=*****;authscheme=None;authtoken=*****;autocache=False;awsaccesskey=*****;awscredentialsfile='';awscredentialsfileprofile=default;awsexternalid='';awsprincipalarn='';awsregion=NORTHERNVIRGINIA;awsrolearn='';awssecretkey=*****;awssessiontoken=*****;azureaccesskey=*****;azureenvironment=GLOBAL;azuresharedaccesssignature=*****;azurestorageaccount='';azuretenant='';backwardscompatibilitymode=False;batchsize=0;browsableschemas='';cacheconnection='';cachelocation="%APPDATA%\CData\REST Data Provider";cachemetadata=False;cacheprovider='';cachetolerance=600;callbackurl='';catalog=CData;charset=UTF-8;clientculture='';connectionlifetime=0;connectiontype=Auto;credentialslocation="%APPDATA%\CData\REST Data Provider\CredentialsFile.txt";culture='';customheaders='';customurlparams='';datamodel=Relational;datasource='';directoryretrievaldepth=-1;excludefiles='';firewallpassword=*****;firewallport=0;firewallserver='';firewalltype=NONE;firewalluser='';flattenarrays='';flattenobjects=False;fmt=CsvDelimited;folderid='';format=XML;generateschemafiles=Never;includecolumnheaders=True;includedropboxteamresources=False;includefiles='';includeitemsfromalldrives=False;initiateoauth=OFF;jsonformat=JSON;kerberoskdc='';kerberoskeytabfile='';kerberosrealm='';kerberosservicekdc='';kerberosservicerealm='';kerberosspn='';kerberosticketcache='';location="X:\Datavarehus TX\API strukturer\Mercell\CData";logfile="X:\Datavarehus TX\API strukturer\Mercell\Logs\log.txt";logmodules='';maxlogfilecount=-1;maxlogfilesize=100MB;maxrows=-1;metadatadiscoveryuri='';mfaserialnumber='';mfatoken=*****;oauthaccesstoken=*****;oauthaccesstokensecret=*****;oauthaccesstokenurl='';oauthauthorizationurl='';oauthclientid='';oauthclientsecret=*****;oauthexpiresin='';oauthgranttype=CODE;oauthincludecallbackurl=True;oauthjwtaudience='';oauthjwtcert=*****;oauthjwtcertpassword=*****;oauthjwtcertsubject=*;oauthjwtcerttype=USER;oauthjwtencryption=RS256;oauthjwtheaders='';oauthjwtissuer='';oauthjwtsubject='';oauthjwtvaliditytime=3600;oauthparams='';oauthpasswordgrantmode=Post;oauthrefreshtoken=*****;oauthrefreshtokenurl='';oauthrequesttokenurl='';oauthsettingslocation="%APPDATA%\CData\REST Data Provider\OAuthSettings.txt";oauthtokentimestamp='';oauthverifier=*****;oauthversion=2.0;offline=False;oraclenamespace='';other='';pagesize=1000;pkceverifier=*****;poolidletimeout=60;poolmaxsize=100;poolminsize=1;poolwaittime=60;projectid='';proxyauthscheme=BASIC;proxyautodetect=True;proxyexceptions='';proxypassword=*****;proxyport=80;proxyserver='';proxyssltype=AUTO;proxyuser='';pseudocolumns='';qualifycolumns=none;readonly=False;region='';rowscandepth=100;schema=REST;scope='';secretkey=*****;serversideencryption=OFF;sharepointedition=SharePointOnline;simpleuploadlimit='';sshauthmode=Password;sshclientcert=*****;sshclientcertpassword=*****;sshclientcertsubject=*;sshclientcerttype=PEMKEY_FILE;sshpassword=*****;sshuser='';sslclientcert=*****;sslclientcertpassword=*****;sslclientcertsubject=*;sslclientcerttype=USER;sslmode=AUTOMATIC;sslservercert=*****;ssoexchangeurl='';ssologinurl='';ssoproperties='';storagebaseurl='';tables='';temporarytokenduration=3600;timeout=60;typedetectionscheme=RowScan;uri='';uriseparator=,;useconnectionpooling=False;uselakeformation=False;userdefinedviews='';usevirtualhosting=True;verbosity=3;views='';xmlformat=XML;xpath=''
2024-12-12T12:53:29.052+01:00 2 [4|Q-Id] [EXEC|Parsed] Executing query: [select top 100 [_id], [name], [filename], [fileurl], [description], [updated], [updatedutc], [size] from [rest].[ListPublishedFiles]]
2024-12-12T12:53:29.057+01:00 3 [4|Q-Id] [EXEC|Normlz] Executing query: [SELECT [ListPublishedFiles].[_id], [ListPublishedFiles].[name], [ListPublishedFiles].[filename], [ListPublishedFiles].[fileurl], [ListPublishedFiles].[description], [ListPublishedFiles].[updated], [ListPublishedFiles].[updatedutc], [ListPublishedFiles].[size] FROM [rest].[ListPublishedFiles] AS [ListPublishedFiles] LIMIT 100]
2024-12-12T12:53:29.057+01:00 3 [4|Q-Id] [META|MemSto] Retrieved cached tables for '..', results count: 2.
2024-12-12T12:53:29.057+01:00 2 [4|Q-Id] [META|Schema] Retrieved table schema from MetaCache: Table: [<NULL>] TableType: [table] Success: 2 results
2024-12-12T12:53:29.057+01:00 3 [4|Q-Id] [META|MemSto] Retrieved cached tables for '..', results count: 2.
2024-12-12T12:53:29.057+01:00 2 [4|Q-Id] [META|Schema] Retrieved table schema from MetaCache: Table: [<NULL>] TableType: [view] Success: 2 results
2024-12-12T12:53:29.057+01:00 3 [4|Q-Id] [META|MemSto] Retrieved cached tables for 'CData.REST.ListPublishedFiles', results count: 0.
2024-12-12T12:53:29.057+01:00 2 [4|Q-Id] [META|Schema] Retrieved table schema from MetaCache: Table: [ListPublishedFiles] TableType: [table] Success: 0 results
2024-12-12T12:53:29.057+01:00 3 [4|Q-Id] [META|MemSto] Retrieved cached tables for 'CData.REST.ListPublishedFiles', results count: 1.
2024-12-12T12:53:29.057+01:00 2 [4|Q-Id] [META|Schema] Retrieved table schema from MetaCache: Table: [ListPublishedFiles] TableType: [view] Success: 1 results
2024-12-12T12:53:29.057+01:00 3 [4|Q-Id] [META|MemSto] Retrieved cached columns for '.REST.ListPublishedFiles', result count: 8.
2024-12-12T12:53:29.057+01:00 2 [4|Q-Id] [META|Schema] Retrieved column schema from MetaCache: [ListPublishedFiles] Success: 8 results
2024-12-12T12:53:29.212+01:00 2 [4|Q-Id] [HTTP|Req: 1] POST https://services.tendsign.com/customerservices.asmx?WSDL
2024-12-12T12:53:29.212+01:00 3 [4|Q-Id] [HTTP|Req: 1] [New]
[HTTP Headers]
HTTP Auth Scheme: 3
User:
Password:
POST /customerservices.asmx?WSDL HTTP/1.1
Host: your.soap.endpoint.com
Accept-Encoding: gzip, deflate
User-Agent: CData Data Provider Engine - www.cdata.com - gzip
Content-Type: application/x-www-form-urlencoded
Content-Length: 717
Content-Type: text/xml

2024-12-12T12:53:29.222+01:00 3 [4|Q-Id] [HTTP|Req: 1] %3c%3fxml%20version%3d%221.0%22%20encoding%3d%22utf-8%22%3f%3e%0d%0a%09%09%09%0d%0a%09%09%09%3csoap%3aEnvelope%20xmlns%3asoap%3d%22http%3a%2f%2fwww.w3.org%2f2003%2f05%2fsoap-envelope%22%20xmlns%3apub%3d%22http%3a%2f%2fpublicprocurement.com%22%3e%0d%0a%09%09%09%3csoap%3aHeader%2f%3e%0d%0a%09%09%09%3csoap%3aBody%3e%0d%0a%09%09%09%3cpub%3aListPublishedFiles%20soapenv%3aencodingStyle%3d%22http%3a%2f%2fschemas.xmlsoap.org%2fsoap%2fencoding%22%2f%3e%0d%0a%09%09%09%3cpub%3aSystemUserID%3e123456%3c%2fpub%3aSystemUserID%3e%0d%0a%09%09%09%09%09%3cpub%3aProjectID%3e666666%3c%2fpub%3aProjectID%3e%0d%0a%09%09%09%3c%2fpub%3aListPublishedFiles%3e%0d%0a%09%09%09%3c%2fsoap%3aBody%3e%0d%0a%09%09%09%3c%2fsoap%3aEnvelope%3e
2024-12-12T12:53:29.301+01:00 3 [4|Q-Id] [HTTP|Res: 1]
[HTTP Headers]
HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Thu, 12 Dec 2024 11:53:28 GMT
Connection: close
Content-Length: 339
2024-12-12T12:53:29.303+01:00 3 Current buffer data:

2024-12-12T12:53:29.304+01:00 3 3C 21 44 4F 43 54 59 50 45 20 48 54 4D 4C 20 50
55 42 4C 49 43 20 22 2D 2F 2F 57 33 43 2F 2F 44
54 44 20 48 54 4D 4C 20 34 2E 30 31 2F 2F 45 4E
22 22 68 74 74 70 3A 2F 2F 77 77 77 2E 77 33 2E
6F 72 67 2F 54 52 2F 68 74 6D 6C 34 2F 73 74 72
69 63 74 2E 64 74 64 22 3E 0D 0A 3C 48 54 4D 4C
3E 3C 48 45 41 44 3E 3C 54 49 54 4C 45 3E 42 61
64 20 52 65 71 75 65 73 74 3C 2F 54 49 54 4C 45
3E 0D 0A 3C 4D 45 54 41 20 48 54 54 50 2D 45 51
55 49 56 3D 22 43 6F 6E 74 65 6E 74 2D 54 79 70
65 22 20 43 6F 6E 74 65 6E 74 3D 22 74 65 78 74
2F 68 74 6D 6C 3B 20 63 68 61 72 73 65 74 3D 75
73 2D 61 73 63 69 69 22 3E 3C 2F 48 45 41 44 3E
0D 0A 3C 42 4F 44 59 3E 3C 68 32 3E 42 61 64 20
52 65 71 75 65 73 74 20 2D 20 49 6E 76 61 6C 69
64 20 48 65 61 64 65 72 3C 2F 68 32 3E 0D 0A 3C
68 72 3E 3C 70 3E 48 54 54 50 20 45 72 72 6F 72
20 34 30 30 2E 20 54 68 65 20 72 65 71 75 65 73
74 20 68 61 73 20 61 6E 20 69 6E 76 61 6C 69 64
20 68 65 61 64 65 72 20 6E 61 6D 65 2E 3C 2F 70
3E 0D 0A 3C 2F 42 4F 44 59 3E 3C 2F 48 54 4D 4C
3E 0D 0A
2024-12-12T12:53:29.311+01:00 3 [4|Q-Id] [HTTP|Res: 1] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid Header</h2>
<hr><p>HTTP Error 400. The request has an invalid header name.</p>
</BODY></HTML>

2024-12-12T12:53:29.311+01:00 2 [4|Q-Id] [HTTP|Res: 1] HTTP/1.1 400 Bad Request, 339 Bytes Transferred
2024-12-12T12:53:29.311+01:00 2 [4|Q-Id] [HTTP|Res: 1] Error: HTTP protocol error. 400 Bad Request. Stack: at dwo230y.w.DF(String )
at dwo230y.BM.Qi(String )
2024-12-12T12:53:29.312+01:00 2 [4|Q-Id] [EXEC|Messag] Executed query: [SELECT [ListPublishedFiles].[_id], [ListPublishedFiles].[name], [ListPublishedFiles].[filename], [ListPublishedFiles].[fileurl], [ListPublishedFiles].[description], [ListPublishedFiles].[updated], [ListPublishedFiles].[updatedutc], [ListPublishedFiles].[size] FROM [rest].[ListPublishedFiles] AS [ListPublishedFiles] LIMIT 100] Success: 0 results (255 ms)
2024-12-12T12:53:29.312+01:00 1 [4|Q-Id] [SQL |Messag] Query Failed: [select top 100 [_id], [name], [filename], [fileurl], [description], [updated], [updatedutc], [size] from [rest].[ListPublishedFiles]]. Error: 400 -- HTTP protocol error. 400 Bad Request.
2024-12-12T12:53:29.312+01:00 2 [ |Q-Id] 400 -- HTTP protocol error. 400 Bad Request.
RSSBus.RSBException
at dwo230y.BM.QH(Exception )
at dwo230y.BM.Qi(String )
at dwo230y.BM.QQ(String )
at dwo230y.QlB.J(String , String )
at dwo230y.QgB.A(QAS , QFA , QFV )
at dwo230y.QFe.P(QFV )
at dwo230y.Qog.CQ(QFV )
at dwo230y.Qle.tb(Object , Object[] )
at dwo230y.QlF.CQ(QFV )
at dwo230y.Qdh.s(RSBContext , String )
at dwo230y.QRB.Exec(RSBContext )
at dwo230y.tgx.T(RSBOperation , tlS )
at dwo230y.tgx.e(RSBOperation , tgo )
at dwo230y.tgo.T(toM , tFQ , BJd , tFQ , tFQ , String )
at dwo230y.tgo.L(RSBOperation , tFQ , BJd , tFQ , tFQ )
at dwo230y.tlS.k(String , RSBOperation , RSBItem , RSBCallback )
at dwo230y.tlS.Call(RSBOperation , RSBItem , RSBCallback )
at dwo230y.QhI.V(RSBContext , tey`1 , QhV , RSBItem , RSBCallback , Boolean )
at dwo230y.Qhp.J(RSBContext )
at dwo230y.Qhp.Exec(RSBContext )
at dwo230y.tgx.T(RSBOperation , tlS )
at dwo230y.tgx.e(RSBOperation , tgo )
at dwo230y.toy.k(toy , tgo )
at dwo230y.toy.Rw(tgo )
at dwo230y.tkh.x(tgo )
at dwo230y.tkh.F(tkh , tgo )
at dwo230y.tkh.Rw(tgo )
at dwo230y.tkh.x(tgo )
at dwo230y.tkh.F(tkh , tgo )
at dwo230y.tkh.Rw(tgo )
at dwo230y.tkh.Rw(tgo )
at dwo230y.tFN.RC(tgo )
at dwo230y.tkI.Kv(tgo , Boolean )
at dwo230y.tgo.T(toM , tFQ , BJd , tFQ , tFQ , String )
at dwo230y.tgo.P(String , tFQ , BJd , tFQ , tFQ )
at dwo230y.tlS.Call(String )
at dwo230y.dM.n(RSBContext , dA )
at dwo230y.BVl.Km()
at dwo230y.BVM.Km()
at dwo230y.BJN.r(ep , BBt )
at dwo230y.BJx.bo()
at dwo230y.BJN.KR()
at dwo230y.dR.I(SQLQuery , Int32 , BBo )
at dwo230y.dR.b(IDataStatement , SQLQuery , QueryParameterCollection , Int32 , String , teZ )
at dwo230y.BVN.ExecuteQuery(IDataStatement , QueryParameterCollection , Int32 )
at dwo230y.xJ.ExecuteQuery(IDataStatement , QueryParameterCollection , Int32 )
at dwo230y.tpS.T(SqlTable , ttu , Int32 )
at dwo230y.tpS.h(ttu , SqlTable , ColumnInfo[] , ttQ , Int32 )
at dwo230y.tpp`1.U(Boolean , ttQ )
at dwo230y.tpp`1.pG(ttu , Int32 , ColumnInfo[] )
at dwo230y.tVM.A(twd`1 )
at dwo230y.tVM.mZ(twd`1 , tCV )
at dwo230y.tVC`2.d(twd`1 , tVw )
at dwo230y.tVC`2.mv(tJp`1 , tVw )
at dwo230y.tJC`1.iZ[g](tCk`2 )
at dwo230y.twg.T(tCV )
at dwo230y.twg.A(tJA , Int32 , tSN )
at dwo230y.tJV.P(tJA , Int32 , tSN , String )
at dwo230y.tJV.ExecuteQuery(IDataStatement , QueryParameterCollection , Int32 )
at dwo230y.BIS.ExecuteQuery(IDataStatement , QueryParameterCollection , Int32 )
at dwo230y.Rh.ExecuteQuery(IDataStatement , QueryParameterCollection , Int32 )
at dwo230y.BwB.bv()
at dwo230y.BwI.mb()
at dwo230y.uQ.fb(QueryParameterCollection )

 


Finally managed to get a response.

Here is the code

<api:script xmlns:api="http://apiscript.com/ns?v1" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<!-- See Column Definitions to specify column behavior and use XPaths to extract column values from XML. -->
<api:info title="contract" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1">
<attr name="_id" xs:type="string" readonly="false" key="true" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/_id" />
<attr name="description" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/description" />
<attr name="filename" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/filename" />
<attr name="fileurl" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/fileurl" />
<attr name="name" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/name" />
<attr name="size" xs:type="integer" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/size" />
<attr name="updated" xs:type="datetime" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/updated" />
<attr name="updatedutc" xs:type="datetime" readonly="false" other:xPath="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file/updatedutc" />
</api:info>

<api:set attr="DataModel" value="RELATIONAL" />
<api:set attr="URI" value="https://your.soap.endpoint.com/getData.asmx?wsdl" />
<api:set attr="PushAttributes" value="true" />
<api:set attr="EnablePaging" value="true" />
<api:set attr="Header:Name#" value="SOAPAction"/>
<api:set attr="Header:Value#" value="http://public.com/endPoint"/>
<api:set attr="XPath" value="/Envelope/Body/ListPublishedFilesResponse/ListPublishedFilesResult/idbdata/contract/attachments/file" />

<!-- The GET method corresponds to SELECT. Here you can override the default processing of the SELECT statement. The results of processing are pushed to the schema's output. See SELECT Execution for more information. -->
<api:script method="GET">
<api:set attr="method" value="POST"/>
<api:set attr="ContentType" value="text/xml"/>
<api:set attr="AcceptCharset" value="utf-8" />
<api:set attr="data">
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://public.com">
<soap:Header/>
<soap:Body>
<pub:ListPublishedFiles>
<pub:SystemUserID>123456</pub:SystemUserID>
<pub:ProjectID>666666</pub:ProjectID>
</pub:ListPublishedFiles>
</soap:Body>
</soap:Envelope>
</api:set>
<api:call op="xmlproviderGet">
<api:push/>
</api:call>
</api:script>
</api:script>

 


Your Postman example uses Content-Type raw, your call from the CData provider uses both application/x-www-form-urlencoded and text/xml. Something to look into I guess.


Hi ​@aftabp 

You were missing a content type header. I think that is one of those things that are easy to miss, but that is where logging really helps.

I checked if we had this in the other community post about soap and there we applied it like so

<api:set attr="Header:Name" value="Content-Type" />
<api:set attr="Header:Value" value="text/xml" />

Your method is equally fine and I also find that for CData, this option needs to be stated without the dash so it is contenttype in one word.


He had that exact same content type header in his first example though.


One more question.
How do i ingest the data which is between <>

<contracts>
<contract origin="myserviceprovider.com" tid="123456" referencename="123456" statusID="0">
<details>
<name>Project1</name>
</details>
</contract>
< <contract origin="myserviceprovider.com" tid="123456" referencename="123456" statusID="0">
<details>
<name>Project2</name>
</details>
</contract>
< <contract origin="myserviceprovider.com" tid="123456" referencename="123456" statusID="0">
<details>
<name>Project3</name>
</details>
</contract>

I have manged to get the project details but struggling with:

  • origin
  • tid
  • referencenumber

Here is what i am trying

<api:info title="contracts/contract" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1">
<attr name="name" xs:type="string" readonly="false" key="true" other:xPath="/Envelope/Body/ListShortContractsPublishedForExportXMLBusinessIntelligenceResponse/ListShortContractsPublishedForExportXMLBusinessIntelligenceResult/idbdata/contracts/contract/details/name" />
<attr name="tendsigncontractid" xs:type="string" readonly="false" other:xPath="/Envelope/Body/ListShortContractsPublishedForExportXMLBusinessIntelligenceResponse/ListShortContractsPublishedForExportXMLBusinessIntelligenceResult/idbdata/contracts/contract/referencename[0]" />

</api:info>

<api:set attr="DataModel" value="RELATIONAL" />
<api:set attr="URI" value="https://my.soap.provider.com/endpoint.asmx?WSDL" />
<api:set attr="PushAttributes" value="true" />
<api:set attr="EnablePaging" value="true" />
<api:set attr="Header:Name#" value="SOAPAction"/>
<api:set attr="Header:Value#" value="http://publicprocurement.com/ListShortContractsPublishedForExportXMLBusinessIntelligence"/>
<api:set attr="XPath" value="/Envelope/Body/ListShortContractsPublishedForExportXMLBusinessIntelligenceResponse/ListShortContractsPublishedForExportXMLBusinessIntelligenceResult/idbdata/contracts/contract" />

<!-- The GET method corresponds to SELECT. Here you can override the default processing of the SELECT statement. The results of processing are pushed to the schema's output. See SELECT Execution for more information. -->
<api:script method="GET">
<api:set attr="method" value="POST"/>
<api:set attr="ContentType" value="text/xml"/>
<api:set attr="AcceptCharset" value="utf-8" />
<api:set attr="data">
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://publicprocurement.com">
<soap:Header/>
<soap:Body>
<pub:ListShortContractsPublishedForExportXMLBusinessIntelligence>
<pub:SystemUserID>123456</pub:SystemUserID>
<pub:LanguageID>1</pub:LanguageID>
<pub:LastChangedDate>1900-01-01</pub:LastChangedDate>
</pub:ListShortContractsPublishedForExportXMLBusinessIntelligence>
</soap:Body>
</soap:Envelope>
</api:set>
<api:call op="xmlproviderGet">
<api:push/>
</api:call>
</api:script>
</api:script>

 


Something like:

other:xPath="/Envelope/Body/ListShortContractsPublishedForExportXMLBusinessIntelligenceResponse/ListShortContractsPublishedForExportXMLBusinessIntelligenceResult/idbdata/contracts/contract@origin

 


Hi ​@RLB 

He had that exact same content type header in his first example though.

It most likely did not work due to the dash between Content-Type, but would have if it didn’t have it. I do prefer the way used in the last method as it only takes up one row in the file.

 

Hi ​@aftabp 

You may need multiple XPaths and the DataModel set to FLATTENDOCUMENT

Here is a RSD file based on a currency file.

<api:script xmlns:api="http://apiscript.com/ns?v1" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<!-- See Column Definitions to specify column behavior and use XPaths to extract column values from XML. -->
<api:info title="Cube" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1">
<!-- You can modify the name, type, and column size here. -->
<attr name="time" xs:type="string" readonly="false" other:xPath="/Envelope/Cube/Cube@time" />
<attr name="currency" xs:type="string" readonly="false" other:xPath="/Envelope/Cube/Cube/Cube@currency" />
<attr name="rate" xs:type="double" readonly="false" other:xPath="/Envelope/Cube/Cube/Cube@rate" />
</api:info>

<api:set attr="DataModel" value="FLATTENDOCUMENT" />
<api:set attr="PushAttributes" value="true" />
<api:set attr="URI" value="https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml" />

<api:set attr="XPath" value="/Envelope/Cube/Cube;/Envelope/Cube/Cube/Cube" />

<!-- The GET method corresponds to SELECT. Here you can override the default processing of the SELECT statement. The results of processing are pushed to the schema's output. See SELECT Execution for more information. -->
<api:script method="GET">
<api:set attr="method" value="GET"/>
<api:call op="xmlproviderGet">
<api:push/>
</api:call>
</api:script>

</api:script>

I use multiple XPaths to get both date and the values.

I do not use @ signs in the XPath, but there is in the connection to the value in the <info> area.


Reply