BookmarkSubscribeRSS Feed
ozgegroove
SAS Employee

Hi all,

I am new to call REST web services from SAS. I have written below code to call it using some papers. I aim to get session_id however it gives me following log and cannot get session id. Can you help me to call it successfully? It is okay to put result into SAS dataset so that I can use session_id for other requests. Also added REST request used in SOAPUI. Thanks!

-----------------------------BEGIN REQUEST CODE----------------------

*** FILENAME and URL will call REST;

%let user=sasdemo;

%let password=SASpwd1;

filename price url 'http://kkbcsd00:8080/SASWIPClientAccess/rest/sessions?userid=&user.&password=&password.' debug;

data price;

  infile price length=len;

  input record $varying200. len;

run;

-----------------------------END REQUEST CODE----------------------

---------------------------LOG---------------------------------

NOTE: >>> GET /SASWIPClientAccess/rest/sessions?userid=sasdemo&password=SASpwd1 HTTP/1.0

NOTE: >>> Host: kkbcsd00:8080

NOTE: >>> Accept: */*.

NOTE: >>> Accept-Language: en

NOTE: >>> Accept-Charset: iso-8859-1,*,utf-8

NOTE: >>> User-Agent: SAS/URL

NOTE: >>>

NOTE: <<< HTTP/1.1 405 Method Not Allowed

NOTE: <<< Server: Apache-Coyote/1.1

NOTE: <<< X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1

NOTE: <<< Set-Cookie: JSESSIONID.SASServer1=59EA70C2F4EA3D813AD13A41079DAB95; Path=/

NOTE: <<< Allow: POST

NOTE: <<< Content-Type: text/html;charset=utf-8

NOTE: <<< Content-Length: 1098

NOTE: <<< Date: Wed, 12 Aug 2015 13:32:28 GMT

NOTE: <<< Connection: close

NOTE: <<<

ERROR: Invalid reply received from the HTTP server. Use the debug option for more info.

NOTE: The SAS System stopped processing this step because of errors.

WARNING: The data set WORK.PRICE may be incomplete.  When this step was stopped there were 0 observations and 1 variables.

WARNING: Data set WORK.PRICE was not replaced because this step was stopped.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.01 seconds

---------------------REQUEST FROM SOAPUI-----------

<?xml version="1.0" encoding="UTF-8"?>

<credentials>

<userid>sasdemo</userid>

<password>SASpwd1</password>

</credentials>

4 REPLIES 4
Ksharp
Super User

Not sure if it could work out .

1) check proc http

2) check  DS2 package of HTTP

ozgegroove
SAS Employee

Hi Xia,

I have tried with proc http, however it did not work as well. but i didn't understand what you mean by your second advice?

Ksharp
Super User

OH, There is a  PROC DS2  . It is added from SAS9.4 . And In it there is a http package also can do PROC HTTP work.

Chack its documentation.Not sure if it could work.

Xia Keshan

ozgegroove
SAS Employee

Xia, the environment is SAS9.3 unfortunately Smiley Sad

Do you have any idea about the error I get in the code?

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
  • 4 replies
  • 1658 views
  • 0 likes
  • 2 in conversation