I am trying to access DNB APIs using PROC SOAP. I have been able to use SOAPUI to bring back information, but am having trouble getting PROC SOAP to work. I have established the URL: http://dnbdirect-api.dnb.com/DnBAPI-13/dnbAPI/dnbAPI.wsdl, however, I haven't been able to figure out the SOAPACTION= parameter. This particular call does require a userID and password though. The input xml layout is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns0="http://applications.dnb.com/webservice/schema/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sch="http://applications.dnb.com/webservice/schema/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<sch:API-KEY><!-- your API-KEY --></sch:API-KEY>
<sch:username><!-- your username --></sch:username>
<sch:password><!-- your password --></sch:password>
</SOAP-ENV:Header>
<ns1:Body>
<ns0:GetCompanyDetailRequest>
<ns0:uniqueId>Enter DNB number here</ns0:uniqueId>
</ns0:GetCompanyDetailRequest>
</ns1:Body>
</SOAP-ENV:Envelope>
I have looked at the following papers 013-2010 and 310-2008. While they rpovide a good deal of detail, I'm still coming up short. My knowledge of SOAP is limited.
Any help that you could provide would be most appreciated.
Thanks!
Arvid Amundson
Got it figured out with the help of SAS Tech Support. The part that was hanging me up is that the URL value was the EndPoint. I also determined that I could use WEBPASSWORD and WEBUSERNAME instead of having it in the XML. That way I could encrypt it. You will need an account with D&B in order to use it, but maybe this example will help someone.
%LET ID = 1382555 ;
**************************************************************;
**************************************************************;
FILENAME request "C:\Temp\temprq.xml" ;
FILENAME response "C:\Temp\tempre.xml" LRECL=500000 ;
DATA _NULL_ ;
FORMAT INFILE $CHAR256. ;
INPUT ;
INFILE = resolve(_INFILE_) ; * This is to resolve macro variables. *;
FILE request ;
PUT INFILE ;
DATALINES4 ;
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://applications.dnb.com/webservice/schema/">
<soapenv:Header>
<sch:API-KEY><!-- Your Key --!></sch:API-KEY>
</soapenv:Header>
<soapenv:Body>
<sch:GetCompanyDetailRequest>
<sch:uniqueId>&ID.</sch:uniqueId>
</sch:GetCompanyDetailRequest>
</soapenv:Body>
</soapenv:Envelope>
;;;;
RUN ;
proc soap
in=request
out=response
url="http://dnbdirect-api.dnb.com/DnBAPI-13"
webpassword = "-- Your Password --"
webusername = "-- Your Username --"
;
run;
Got it figured out with the help of SAS Tech Support. The part that was hanging me up is that the URL value was the EndPoint. I also determined that I could use WEBPASSWORD and WEBUSERNAME instead of having it in the XML. That way I could encrypt it. You will need an account with D&B in order to use it, but maybe this example will help someone.
%LET ID = 1382555 ;
**************************************************************;
**************************************************************;
FILENAME request "C:\Temp\temprq.xml" ;
FILENAME response "C:\Temp\tempre.xml" LRECL=500000 ;
DATA _NULL_ ;
FORMAT INFILE $CHAR256. ;
INPUT ;
INFILE = resolve(_INFILE_) ; * This is to resolve macro variables. *;
FILE request ;
PUT INFILE ;
DATALINES4 ;
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://applications.dnb.com/webservice/schema/">
<soapenv:Header>
<sch:API-KEY><!-- Your Key --!></sch:API-KEY>
</soapenv:Header>
<soapenv:Body>
<sch:GetCompanyDetailRequest>
<sch:uniqueId>&ID.</sch:uniqueId>
</sch:GetCompanyDetailRequest>
</soapenv:Body>
</soapenv:Envelope>
;;;;
RUN ;
proc soap
in=request
out=response
url="http://dnbdirect-api.dnb.com/DnBAPI-13"
webpassword = "-- Your Password --"
webusername = "-- Your Username --"
;
run;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: