http://blogs.citrix.com/2013/08/27/xendesktop-7-monitor-service-what-data-is-available/
On Wed, Aug 20, 2014 at 02:30:41PM +0300, eran meiri wrote: > Hello everyone. > I have a problem and I am seeking for help. > > I need to access Citrix Odata api and for some reason I can't. > when I try to access the URL with my browser I get a prompt to the > domain\user an password. > when I enter them I get the data I need but it doesn't work with the Perl > script. > > I have tried it with LWP: > my $url = "http://192.168.100.41/Citrix/Monitor/OData/v1/Methods/"; > my $req = HTTP::Request->new(GET => $url ); > my $ua = LWP::UserAgent->new(keep_alive=>1); > $ua->credentials("192.168.100.41:80", "<REAL-M>","lyncent.com\\Citrix" => > 'Rel0aded1'); > > my $response = $ua->request( $req ); > > if ($response->is_success) { > print $response->content; > } > else { > print $response->status_line, "\n"; > } > > and I have tried it with SOAP: > > my $api_host = " > http://192.168.100.41/Citrix/Monitor/OData/v1/Methods/Catalogs"; > my $api_user = "lyncent.com\\Citrix"; > my $api_pass = "Rel0aded1"; > my $authClient = SOAP::Lite->service($api_host ); > my $result2 = $authClient->performLogin($api_user, $api_pass); > print $result2->{result}; > > or again with soap : > my $service = SOAP::Lite > -> service(' > http://192.168.100.41/Citrix/Monitor/OData/v1/Methods/Catalogs'); > my $AuthHeader = SOAP::Header->new( > name =>'AuthenticationHeader', > attr => { xmlns => "192.168.100.41" }, > value => {username => 'lyncent.com\Citrix', password => 'Rel0aded1' }, > ); > my $result = $service->GetIt($AuthHeader); > > > all of these options give me the same result : 401 unauthorized > the domain , user and password are all correct since I can access the URL > from the browser. > > H E L P > _______________________________________________ > Perl mailing list > Perl@perl.org.il > http://mail.perl.org.il/mailman/listinfo/perl -- So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world - RI Safir 1998 http://www.mrbrklyn.com DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002 http://www.nylxs.com - Leadership Development in Free Software http://www2.mrbrklyn.com/resources - Unpublished Archive http://www.coinhangout.com - coins! http://www.brooklyn-living.com Being so tracked is for FARM ANIMALS and and extermination camps, but incompatible with living as a free human being. -RI Safir 2013 _______________________________________________ Perl mailing list Perl@perl.org.il http://mail.perl.org.il/mailman/listinfo/perl