Webservices client as datasource

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Vrisha
Premium Member
Premium Member
Posts: 60
Joined: Sat Jul 15, 2017 9:32 pm
Location: Texas,USA

Webservices client as datasource

Post by Vrisha »

Scenario- Pull the data from url and load into sequential file

Job Design- WebServices Client---->Sequential File

steps
1) Got the WSDL file 'https://dart.service-now.com/incident.do?WSDL' and imported the table definition . Table definitions ---> WebServices ---> able to see the getRecords_IN, getRecords_MSGIN, getRecords_MSGOUT etc.

2) Now using Webservices Client stage --> Webservice operation ---> WebService Metadata Imported ---> gave the link of url 'https://dart.service-now.com/api/now/ta ... _value=all' and saved the data to my local drive and opened from local drive.

Metadata structure - example- column name - Active
But in file - Example - Column name - Active have Display value and value.

I am unable to drag the data out of the website to 'Webservices Explorer' .

Imported the metadata structure but stuck with importing the data relevant to metadata.

Please let me know what I should do .Thanks.
Suja
Vrisha
Premium Member
Premium Member
Posts: 60
Joined: Sat Jul 15, 2017 9:32 pm
Location: Texas,USA

Post by Vrisha »

I have a quick question. When we are getting the WSDL file, it should have both the metadata structure and the data inside it. Am I correct?

Because when I checked for WSDL file example, it is mentioned it should have all the elements like definitions, type, message, porttype, Binding , ports and service.

At present, I am getting a wsdl file only with metadata structure and another url link which has only the data. Checking with you if my understanding is correct. Thanks.


WSDL file with metadata structure-


<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://www.service-now.com/incident" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.service-now.com/incident" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<wsdl:types>
<xsd:schema elementFormDefault="unqualified" targetNamespace="http://www.service-now.com/incident">
<xsd:element name="getKeys">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="active" type="xsd:boolean"/>
<xsd:element maxOccurs="1" minOccurs="0" name="activity_due" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="additional_assignee_list" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="approval" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="approval_history" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="approval_set" [/u]

url with Data alone[/u]
{"result":[{"parent":"","made_sla":"true","caused_by":"","watch_list":"","upon_reject":"cancel","sys_updated_on":"2017-06-26 21:37:51","child_incidents":"0","approval_history":"","number":"INC0014775","resolved_by":{"link":"https://dart.service-now.com/api/now/ta ... 2016-07-29 21:16:00","sys_domain":{"link":"https://dart.service-now.com/api/now/ta ... 2016-07-31 00:00:00",
Suja
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Vrisha wrote:I have a quick question. When we are getting the WSDL file, it should have both the metadata structure and the data inside it. Am I correct?
No, as you've found they are separate. The WSDL is the "xsd" and just the metadata. And the data is the data.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Vrisha
Premium Member
Premium Member
Posts: 60
Joined: Sat Jul 15, 2017 9:32 pm
Location: Texas,USA

Post by Vrisha »

Thanks for your prompt response, craig.

1) I have the metadata structure appearing in web services explorer and also in Table definition. Just I ran the job with metadata structure file, it ran fine without any error and it showed 1 processed row with all the fields populated with null values as we don't have data in that wsdl file (only metadata).

2)When I gave the Url link 'https://dart.service-now.com/api/now/table/incident?' in the metadata importer to access the data out and got it stored to my local drive and access using 'C:\Users\sujal\Documents\incident.json' in the address. Below the address bar, in left pane the data is displayed like this

{"result":[{"parent":"","made_sla":"true","caused_by":"","watch_list":"","upon_reject":"cancel","sys_updated_on":"2017-06-26 21:37:51","child_incidents":"0","approval_history":"","number":"INC0014775","resolved_by":{"link":"https://dart.service-now.com/api/now/ta ... ink"...etc

But nothing is showing in the web services explorer.

I don't know how to link the metadata structure with the data . What should I do? Where I am making a mistake? Please let me know.
Suja
Vrisha
Premium Member
Premium Member
Posts: 60
Joined: Sat Jul 15, 2017 9:32 pm
Location: Texas,USA

Now changed to Hiearchical datastage

Post by Vrisha »

Since I am unable to figure out using WebServices client stage , now I changed to Hieararchical datastage.

I followed the steps in this url 'http://informationintegrationblog.blogs ... -from.html'. But I am getting only zero rows.

When I tried to test using 'Test Assembly' feature in Assembly editor of Hiearchical stage, the error I am getting is

'java.lang.NoSuchMethodError: org/apache/http/conn/ssl/SSLSocketFactory.<init>(Ljava/lang/String;Ljava/security/KeyStore;Ljava/lang/String;Ljava/security/KeyStore;Ljava/security/SecureRandom;Lorg/apache/http/conn/ssl/TrustStrategy;Lorg/apache/http/conn/ssl/X509HostnameVerifier;)V
Test completed


Please let me know what I need to do. Thank you.
Suja
Vrisha
Premium Member
Premium Member
Posts: 60
Joined: Sat Jul 15, 2017 9:32 pm
Location: Texas,USA

Post by Vrisha »

I resolved this problem using Hierarchical stage. Though the above java error is coming, I am able to pull the data from URL after I made changes in the 'Edit Assembly' option

1) Used the web services client stage--> web services option ---> download the datafile ( json) file to my desktop and created a metadata structure using the downloaded file in Schema library manager

2) In Hierarchical stage, Edit Assembly-->REST step -->'Security'tab-->changed the 'Authentication' to 'Basic'----> gave username & password

3)'Request' tab -->Changed the content type to 'application/json' to match with the 'Response' tab.

Now I am able to pull the data from the url
Suja
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Excellent. Glad you got it working. Most all vendors are moving away from SOAP --- nice and formal and structured, but far more complex than REST with JSON/XML. If you have an option to use SOAP or REST, choose REST.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Vrisha
Premium Member
Premium Member
Posts: 60
Joined: Sat Jul 15, 2017 9:32 pm
Location: Texas,USA

Post by Vrisha »

Thank you, Ernie.
Suja
Post Reply