BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ArvAmundson
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
ArvAmundson
Calcite | Level 5

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;


View solution in original post

1 REPLY 1
ArvAmundson
Calcite | Level 5

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;


sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1146 views
  • 0 likes
  • 1 in conversation