Help using Base SAS procedures

PROC SOAP Accessing DNB Information

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

PROC SOAP Accessing DNB Information

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/" xmlnsSmiley FrustratedOAP-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>

<schSmiley Tongueassword><!-- your password --></schSmiley Tongueassword>

</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


Accepted Solutions
Solution
‎04-29-2013 02:49 PM
New Contributor
Posts: 2

Re: PROC SOAP Accessing DNB Information

Posted in reply to ArvAmundson

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


All Replies
Solution
‎04-29-2013 02:49 PM
New Contributor
Posts: 2

Re: PROC SOAP Accessing DNB Information

Posted in reply to ArvAmundson

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;


🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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