Pages: [1]
  Print  
Author Topic: Is the webservice available without logging in?  (Read 1423 times)
ivo
Newbie
*
Posts: 2


« on: February 18, 2011, 04:13:06 PM »

Hi All!

Is there a way of accessing a correctly deployed RA webservice without logging into to RA from a script?

I mean if I login to the RA and type in the URL of the webservice into the browser everything works fine and I see the desired output of the webservice. However if I log out RA and access the webservice from the browser again, I see the login page and no output. Is this a feature? Is there a way of making public webservices?

If deploying a public webservices is impossible, is there a native method of logging in that i can code into an application or script (beside try hacking around with cURL)?

Thanks for all the replies in advance!

Ivo
Logged
Ingo Mierswa
Administrator
Hero Member
*****
Posts: 1196



WWW
« Reply #1 on: February 19, 2011, 12:03:19 PM »

Hi Ivo,

yes, making a web service publicly accessible is indeed possible. As far as I remember you will have to allow the user "Anonymous" the access. After that you can access the web service (and other resources) via the known URL but you will have to replace "resources" by "public_resources" and "processes" by "public_processes". I am not completely sure about the details but Simon is certainly able to help.

This is fine if you can make the services publicly available. If your services have to be used under a user management, the best and simplest way is to use Single-Sign-On (SSO). However, SSO support is only part of the Enterprise Edition of RapidAnalytics.

Hope that helps. If not, please ask again since I am not completely sure about the paths stated above and we would have to ask Simon in that case.

Cheers,
Ingo

Logged

Did you try our new Marketplace? Upload or download new Extensions, add comments, and organize your operators. Have a look at  http://marketplace.rapid-i.com
ivo
Newbie
*
Posts: 2


« Reply #2 on: February 21, 2011, 02:10:22 PM »

Thanks for the fast reply!

It is great to hear that the public access is possible, however I could not setup an Anonymous user role in the RA for the given process/webservice. I see two config parameters with a possible connection to the public access in the System Information > System Settings tab.
These are:
com.rapidanalytics.web.anonymous_resources
com.rapidanalytics.web.anonymous_services
Should these be altered in some way to enable public access? Furthermore if these should be modified, where could i preform the modification procedure? Is there a config file available?

Thanks for the help!

Ivo
Logged
Simon Fischer
Administrator
Sr. Member
*****
Posts: 422



WWW
« Reply #3 on: February 21, 2011, 06:53:13 PM »

Hi,,

yes, both properties must be set to true, AND you must create an "anonymous" user (lower case).

That should do the job. The URL context path is public_process (singular).

Best,
Simon
Logged

Simon Fischer
Rapid-I

Want to meet others from the RapidMiner community and share your research and results? Visit http://www.rcomm2011.org
inzenjer.mostar
Newbie
*
Posts: 6


« Reply #4 on: May 18, 2011, 11:29:49 AM »

Can somebody please explain to me where and how i can change the parameters

com.rapidanalytics.web.annonymous_resources
com.rapidanalytics.web.annonymous_services

Thanks
Logged
inzenjer.mostar
Newbie
*
Posts: 6


« Reply #5 on: May 18, 2011, 03:13:02 PM »

Please i need the exact procedure what i have to do to allow anonymous access to a web service. I allerady have a web service that i can acces through the browser (when i previously logged in as admin). But i want to acces the web service through a windows forms application without login. Can you please explain me the details. How to set the parameters. How to create annoymous user. What do you mean with "The URL context path is public_process (singular)."

Thanks in advance!
Logged
inzenjer.mostar
Newbie
*
Posts: 6


« Reply #6 on: May 18, 2011, 09:25:26 PM »

I found it out by myself how to call web services without login

First add to the Administration->System Settings two parameters both with value true:

com.rapidanalytics.web.anonymous_resources         true
com.rapidanalytics.web.anonymous_services            true

and then when calling the web service in external aplication you use the same URL with a small change:
just replace the part ".../process/..." with "../public_process/..."
Logged
Simon Fischer
Administrator
Sr. Member
*****
Posts: 422



WWW
« Reply #7 on: May 19, 2011, 08:17:49 AM »

Hi,

yes, that's the right way to do it.

Best,
Simon
Logged

Simon Fischer
Rapid-I

Want to meet others from the RapidMiner community and share your research and results? Visit http://www.rcomm2011.org
adaman
Newbie
*
Posts: 17


« Reply #8 on: June 17, 2011, 12:42:58 PM »

Hey,

i did everything as it is explained above but if i trie to call the webservice from php i get the following error.

Quote
Warning: file_get_contents(http://myIP/RA/public_process/Use_Modells_NaiveBayes?) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /myPath/index.php on line 9
Array (
  • => HTTP/1.1 403 Forbidden [1] => Server: Apache-Coyote/1.1 [2] => Set-Cookie: JSESSIONID=0136055020702B60B2D87BA002376E50; Path=/RA [3] => Content-Type: text/html;charset=utf-8 [4] => Content-Length: 1124 [5] => Date: Fri, 17 Jun 2011 13:45:34 GMT [6] => Connection: close ) Ungueltiger Aufruf des Web Services.
If i call it directly from the browser no problems the service returns an html table.

If i call it without
Quote
/public_process/
i get a response 200 OK but if i trie to show the result i get the rapidanalytics screen to enter username and password. If i do so, i get an error

Quote
Not Found The requested URL /my/path/j_security_check was not found on this server.

_________________________
The way i call the service from php is as follow

Code:
      $webservice =  'http://myIP/RA/public_process/Update_Modells_NaiveBayes?';

        // WebService aufrufen
        $xml = file_get_contents($webservice);

        // HTTP Status auslesen
        if(isset($http_response_header[0])) {
                list($version,$status_code,$msg) = explode(' ',$http_response_header[0], 3);
        }

        print_r($http_response_header);

        // HTTP Status ueberpruefen
        if($status_code != 200) {
                die('Ungueltiger Aufruf des Web Services.');
        }

Please could someone help me :-) as i need to call the service from PHP

Greetings
Logged
adaman
Newbie
*
Posts: 17


« Reply #9 on: June 22, 2011, 09:08:08 AM »

Ok my fault, after i copied the process to the folder of the anonymous user and again published the process as web service, i was able to call it through the above PHP code
Logged
michaelhecht
Jr. Member
**
Posts: 84


« Reply #10 on: December 15, 2011, 04:26:56 PM »

Hmmm .. I did the same but now I get the message: "Access to my_workflow_directory not allowed for user anonymous"
I granted permission to all repository directories for anonymous but this didn't help.
Logged
michaelhecht
Jr. Member
**
Posts: 84


« Reply #11 on: December 16, 2011, 03:40:54 PM »

Finally I allowed the users to access the repository directories and now anonymous can also
execute the workflows.
Logged
Uwe
Newbie
*
Posts: 23


WWW
« Reply #12 on: March 09, 2012, 08:57:54 AM »

Hi

it looks like, that you are writing an programm that use the webservice.

I know you can use most of HTTPRequest classes (independent which programming-language you are use) with authorizing.

One possibilty i hope I remeber the right things is : http://username:password@url .
The other way is authorizing by the used class. In Windows .NET there are Credentials you have to set.
Read the documentation for the class that you use.

This way may faster, better and more secure ... This is depending on the security of system. It did'nt work e.g. in the Joomla CMS Authorisation.
Uwe
Logged
Simon Fischer
Administrator
Sr. Member
*****
Posts: 422



WWW
« Reply #13 on: March 23, 2012, 05:53:50 PM »

Hi,

the http://username:password@url won't help. It may be interpreted by browsers or FTP client, but it won't help you in connecting to a Web service from an application. One reason is the fact that the "username:password" does not at all tell you what the authentication mechanism is. But I can: You can simply use plain basic HTTP authentication to do it. That should be easily possible from most programming languages.

Best,
Simon
Logged

Simon Fischer
Rapid-I

Want to meet others from the RapidMiner community and share your research and results? Visit http://www.rcomm2011.org
Pages: [1]
  Print  
 
Jump to: