Focal Point
[Solved]WF 8 REStful Service

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3207029436

November 27, 2013, 01:48 PM
MattC
[Solved]WF 8 REStful Service
Anyone using REStful calls in Webfocus 8002M? I have it working in my DEV environment logging in and making a Report Caster call, but now I have moved on to test in my TEST environment where I have SiteMinder. I am using the Alternate Zone to bypass SiteMinder so I am coming in from an allowed IP address, but when I make the call I get ReturnCode=99. It’s basically telling me that I am not authenticated.

Our JAVA developers created a little app to execute that basically calls the REStful calls from a batch file that I can execute on my server. The strange thing is that if I am on my server, I can make the calls from a browser just fine, but when I run the app, I get the ReturnCode=99.

I don’t know if there are a lot of folks out there using this right now in V8, but I thought I would ask. I could ask the Java developers to incorporate the SMSession for SiteMinder, but I thought I could bypass that using the Alternate Zone.

I’m a rookie at these REStful calls so I am just learning all this myself.

Thanks in advance for any help.

Matt

Happy Thanksgiving to all of you that celebrate that holiday.

This message has been edited. Last edited by: MattC,


WebFOCUS 8.1.05
December 02, 2013, 03:48 PM
Efrem
Have you run the signOn action?
What call are you making when you receive ReturnCode=99

When you say you can run the REST commands from the browser, have you run the REST signOn action from the browser or do you have a Window that is already logged onto WebFOCUS?
December 02, 2013, 04:31 PM
MattC
I think it relates to how the Web Server is interpreting the URL. In my Dev environment I am going against Apache which works, but in my Test environment, I am bypassing Apache and going directly against the Weblogic Server.

It converts the question mark after “ibfs to a “%3F” which I have a sneaking suspicion that Weblogic doesn’t like. The ReturnCode=99 can be blindly leading. I worked with a few IBI folks last week and you can get the error code if the URL is not correct.

GET http://localhost:11131/ibi_app...=xxxx&IBIRS_password


I am asking my JAVA developer if he can somehow code for the ? to always make it a question mark in a sense.

I will let you know how it shakes out.


WebFOCUS 8.1.05
December 17, 2013, 02:37 PM
dchurch
Matt,

I was researching how our area could use RESTful services to kick off a Caster schedule (trying to replace our use of DSTRUN) and came across your post as well as one that may provide your answer.

Do you have the license code setup in your test environment as mentioned in https://techsupport.informatio...m/sps/92462511.html?

David


David

WebFOCUS 8.1.05M (dev, test & prod); all output types
December 18, 2013, 07:17 AM
MattC
Yes, a license key is required to enable the security option.


WebFOCUS 8.1.05
January 02, 2014, 12:09 PM
MattC
The JAVA developer parsed out the URL's a bit to make this work correctly. I do think it relates to how Apache and Weblogic accepted the URL.


WebFOCUS 8.1.05
December 22, 2014, 03:18 PM
URL419
Hi MattC or any one who solved this issue,

Can you please post your solution to the restfull service invocation issue which you faced early this year. I'm pacing similar problem but I'm not able find out what I'm doing wrong.


Appreciate your help!

Client Code:
*********************************************************************
HttpPost post = new HttpPost("http://XXXXXX/ibi_apps/rs/ibfs/");
String valu="IBIRS_action=signOn&IBIRS_userName=XXXXX&IBIRS_password=XXXXX";
StringEntity input = new StringEntity(valu);
post.setEntity(input);
HttpResponse response = client.execute(post);
**********************************************************************

Response
********************************************************************

**********************************************************************

I just started on this WF migration part just don't know where to go from here.

Thanks
December 22, 2014, 03:36 PM
Efrem
Most likely, there's something not right in the REST request.
Trace the signOn request in something like Fiddler.
And then Post the request in this thread.
Of course, put XXXXXX for the userName and Password
December 22, 2014, 03:51 PM
URL419
quote:
Originally posted by Efrem:
Most likely, there's something not right in the REST request.
Trace the signOn request in something like Fiddler.
And then Post the request in this thread.
Of course, put XXXXXX for the userName and Password


Elfrem,

can you please share me the sample Rest request that I can refer to..

Yes I'm very amature at this since this is my first assignment for WF.

Thanks
December 22, 2014, 04:03 PM
Efrem
URL419,
I think I found your issue.

Change:
quote:
HttpPost post = new HttpPost("http://XXXXXX/ibi_apps/rs/ibfs/");


To:
quote:
HttpPost post = new HttpPost("http://XXXXXX/ibi_apps/rs/ibfs");


Basically, get rid of the forward slash after ibfs.
December 22, 2014, 04:05 PM
Efrem
There are a few Sample REST Requests in the WebFOCUS RESTful Web Services Developers Guide.
December 22, 2014, 04:15 PM
URL419
still same...

returncode="99" returndesc="org.springframework.security.authentication.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext" subreturncode="0" subsystem="SSYS" type="simple"


WebFOCUS 8
Unix,html
December 22, 2014, 04:26 PM
Efrem
What's your development environment.

Having a Fiddler trace of the request would pinpoint the issue.