Showing posts with label upon. Show all posts
Showing posts with label upon. Show all posts

Monday, March 19, 2012

Custom Security + Object Moved to here

I have the Custom Security model in place, and it all seems to be working. I
authenticate the user upon login.
when i try the code below, i get the follwing error:
object Move to here. The hyperlink being
http://somedomina/ReportServer/logon.aspx?ReturnUrl=Reportservice2005.asmx
Does anyone now how to get around this?
Dim rs As New ReportingService2005
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim item As CatalogItem
For Each item In rs.ListChildren("/Reports", False)
If item.Type = ItemTypeEnum.Report Then
Me.ddReports.Items.Add(New ListItem(item.Name, item.Path))
End If
NextYou have to call LogonUser from your report service proxy.
that gets you the cookie to request such operations.
"ghoff12" <ghoff12@.discussions.microsoft.com> wrote in message
news:68E2E101-9CAD-443A-8670-9EFE677D20CB@.microsoft.com...
>I have the Custom Security model in place, and it all seems to be working.
>I
> authenticate the user upon login.
> when i try the code below, i get the follwing error:
> object Move to here. The hyperlink being
> http://somedomina/ReportServer/logon.aspx?ReturnUrl=Reportservice2005.asmx
> Does anyone now how to get around this?
> Dim rs As New ReportingService2005
> rs.Credentials = System.Net.CredentialCache.DefaultCredentials
> Dim item As CatalogItem
> For Each item In rs.ListChildren("/Reports", False)
> If item.Type = ItemTypeEnum.Report Then
> Me.ddReports.Items.Add(New ListItem(item.Name,
> item.Path))
> End If
> Next|||Thanks for replying back. When i called LogonUser, i received an error. I
read that LogonUser only works with SSL enabled. Is there a way to call
LogonUser without SSL? Can you give me some example code, to make sure i did
not miss anything?
"Chris Taylor" wrote:
> You have to call LogonUser from your report service proxy.
> that gets you the cookie to request such operations.
>
> "ghoff12" <ghoff12@.discussions.microsoft.com> wrote in message
> news:68E2E101-9CAD-443A-8670-9EFE677D20CB@.microsoft.com...
> >I have the Custom Security model in place, and it all seems to be working.
> >I
> > authenticate the user upon login.
> >
> > when i try the code below, i get the follwing error:
> > object Move to here. The hyperlink being
> >
> > http://somedomina/ReportServer/logon.aspx?ReturnUrl=Reportservice2005.asmx
> >
> > Does anyone now how to get around this?
> >
> > Dim rs As New ReportingService2005
> > rs.Credentials = System.Net.CredentialCache.DefaultCredentials
> > Dim item As CatalogItem
> > For Each item In rs.ListChildren("/Reports", False)
> > If item.Type = ItemTypeEnum.Report Then
> > Me.ddReports.Items.Add(New ListItem(item.Name,
> > item.Path))
> > End If
> > Next
>
>|||No LogonUser works without SSL, it's not a "Best Practice" or anything like
that, but it works just fine.
Can you tell me about the error you received calling it?
Thanks,
Chris
"ghoff12" <ghoff12@.discussions.microsoft.com> wrote in message
news:1478ACC7-DF13-48E8-9D24-9080A3255D75@.microsoft.com...
> Thanks for replying back. When i called LogonUser, i received an error.
> I
> read that LogonUser only works with SSL enabled. Is there a way to call
> LogonUser without SSL? Can you give me some example code, to make sure i
> did
> not miss anything?
> "Chris Taylor" wrote:
>> You have to call LogonUser from your report service proxy.
>> that gets you the cookie to request such operations.
>>
>> "ghoff12" <ghoff12@.discussions.microsoft.com> wrote in message
>> news:68E2E101-9CAD-443A-8670-9EFE677D20CB@.microsoft.com...
>> >I have the Custom Security model in place, and it all seems to be
>> >working.
>> >I
>> > authenticate the user upon login.
>> >
>> > when i try the code below, i get the follwing error:
>> > object Move to here. The hyperlink being
>> >
>> > http://somedomina/ReportServer/logon.aspx?ReturnUrl=Reportservice2005.asmx
>> >
>> > Does anyone now how to get around this?
>> >
>> > Dim rs As New ReportingService2005
>> > rs.Credentials = System.Net.CredentialCache.DefaultCredentials
>> > Dim item As CatalogItem
>> > For Each item In rs.ListChildren("/Reports", False)
>> > If item.Type = ItemTypeEnum.Report Then
>> > Me.ddReports.Items.Add(New ListItem(item.Name,
>> > item.Path))
>> > End If
>> > Next
>>|||It just seems like it never does authenticate. Can you give me some sample
code to go off of?
"Chris Taylor" wrote:
> No LogonUser works without SSL, it's not a "Best Practice" or anything like
> that, but it works just fine.
> Can you tell me about the error you received calling it?
> Thanks,
> Chris
> "ghoff12" <ghoff12@.discussions.microsoft.com> wrote in message
> news:1478ACC7-DF13-48E8-9D24-9080A3255D75@.microsoft.com...
> > Thanks for replying back. When i called LogonUser, i received an error.
> > I
> > read that LogonUser only works with SSL enabled. Is there a way to call
> > LogonUser without SSL? Can you give me some example code, to make sure i
> > did
> > not miss anything?
> >
> > "Chris Taylor" wrote:
> >
> >> You have to call LogonUser from your report service proxy.
> >>
> >> that gets you the cookie to request such operations.
> >>
> >>
> >> "ghoff12" <ghoff12@.discussions.microsoft.com> wrote in message
> >> news:68E2E101-9CAD-443A-8670-9EFE677D20CB@.microsoft.com...
> >> >I have the Custom Security model in place, and it all seems to be
> >> >working.
> >> >I
> >> > authenticate the user upon login.
> >> >
> >> > when i try the code below, i get the follwing error:
> >> > object Move to here. The hyperlink being
> >> >
> >> > http://somedomina/ReportServer/logon.aspx?ReturnUrl=Reportservice2005.asmx
> >> >
> >> > Does anyone now how to get around this?
> >> >
> >> > Dim rs As New ReportingService2005
> >> > rs.Credentials = System.Net.CredentialCache.DefaultCredentials
> >> > Dim item As CatalogItem
> >> > For Each item In rs.ListChildren("/Reports", False)
> >> > If item.Type = ItemTypeEnum.Report Then
> >> > Me.ddReports.Items.Add(New ListItem(item.Name,
> >> > item.Path))
> >> > End If
> >> > Next
> >>
> >>
> >>
>
>|||I still get the Object Moved to here message. Can anyone help me?
my code looks like:
Dim rs As New wsEcho.ReportingService2005
rs.Url ="http://domainname/reportserver/reportexecution2005.asmx?wsdl"
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
rs.LogonUser("admin", "somepassword", Nothing)
Dim item As wsEcho.CatalogItem
For Each item In rs.ListChildren("/Reports", False)
If item.Type = ItemTypeEnum.Report Then
Me.ddReports.Items.Add(New ListItem(item.Name, item.Path))
End If
Next|||Let me ask you this about wsEcho.ReportingService2005. Is this a direct
reference to the web service itself?
If so, it doesn't quite work that way. In the samples that come with 2005
in the UILogon.aspx.cs file there is *another* class embedded in there
called ReportProxy. This is very very important as it overrides two
important methods
GetWebRequest,
GetWebResponse
which does all the cookie work for you in this case.
It looks like you are not doing so. Which is why you are having it redirect
you.
also, setting rs.Credentials really isn't important since you have anonymous
access probably turned on.
"ghoff12" <ghoff12@.discussions.microsoft.com> wrote in message
news:48EA1A8C-2F49-413C-BD4C-7CEAB367698C@.microsoft.com...
>I still get the Object Moved to here message. Can anyone help me?
> my code looks like:
> Dim rs As New wsEcho.ReportingService2005
> rs.Url => "http://domainname/reportserver/reportexecution2005.asmx?wsdl"
> rs.Credentials = System.Net.CredentialCache.DefaultCredentials
> rs.LogonUser("admin", "somepassword", Nothing)
> Dim item As wsEcho.CatalogItem
> For Each item In rs.ListChildren("/Reports", False)
> If item.Type = ItemTypeEnum.Report Then
> Me.ddReports.Items.Add(New ListItem(item.Name,
> item.Path))
> End If
> Next
>|||Perfect! Makes total sense now. I wasn't even thiking. I took your advice,
and now it works the way i need it. Much thanks for all your help!!!
"Chris Taylor" wrote:
> Let me ask you this about wsEcho.ReportingService2005. Is this a direct
> reference to the web service itself?
> If so, it doesn't quite work that way. In the samples that come with 2005
> in the UILogon.aspx.cs file there is *another* class embedded in there
> called ReportProxy. This is very very important as it overrides two
> important methods
> GetWebRequest,
> GetWebResponse
> which does all the cookie work for you in this case.
> It looks like you are not doing so. Which is why you are having it redirect
> you.
> also, setting rs.Credentials really isn't important since you have anonymous
> access probably turned on.
>
> "ghoff12" <ghoff12@.discussions.microsoft.com> wrote in message
> news:48EA1A8C-2F49-413C-BD4C-7CEAB367698C@.microsoft.com...
> >I still get the Object Moved to here message. Can anyone help me?
> >
> > my code looks like:
> >
> > Dim rs As New wsEcho.ReportingService2005
> > rs.Url => > "http://domainname/reportserver/reportexecution2005.asmx?wsdl"
> > rs.Credentials = System.Net.CredentialCache.DefaultCredentials
> >
> > rs.LogonUser("admin", "somepassword", Nothing)
> >
> > Dim item As wsEcho.CatalogItem
> > For Each item In rs.ListChildren("/Reports", False)
> > If item.Type = ItemTypeEnum.Report Then
> > Me.ddReports.Items.Add(New ListItem(item.Name,
> > item.Path))
> > End If
> > Next
> >
>
>|||I tried this but I am still getting the 401 error. In the 2005 Security
Extension Sample (Readme_FormsAuthenication.htm), there is the following:
**************** FROM Readme_FormsAuthenication.htm
Using the Web Service with Custom Security
You can use the Web service API with Forms Authentication just as you would
with Windows Authentication. However, you must call LogonUser in your Web
service code and pass the credentials of the current user. In addition, your
Web service client will not have the benefit of automatic cookie management,
which is provided by Internet Explorer or other Web browsers. You will have
to extend the Microsoft.ReportingServices proxy class to include cookie
management. This can be done by overriding the GetWebRequest and
GetWebResponse methods of the Web service class.
****************
I think what is holding us up now is this, because the code in
UILogon.aspx.cs that does the above, in the routines WebRequest and
WebResponse runs, but has not been modififed. Then the IIS 401 error occurs.
LogonUser apparently never gets called. I am not sure how to do this, so I
am looking for a pointer to the correct direction.
It appears some modification of these overrides is called for, but I am not
sure how to do this. Can you provide some direction?
nickpup
nickpup@.yahoo.comNONSPAM
Please let me know...
"ghoff12" wrote:
> Perfect! Makes total sense now. I wasn't even thiking. I took your advice,
> and now it works the way i need it. Much thanks for all your help!!!
> "Chris Taylor" wrote:
> > Let me ask you this about wsEcho.ReportingService2005. Is this a direct
> > reference to the web service itself?
> >
> > If so, it doesn't quite work that way. In the samples that come with 2005
> > in the UILogon.aspx.cs file there is *another* class embedded in there
> > called ReportProxy. This is very very important as it overrides two
> > important methods
> >
> > GetWebRequest,
> > GetWebResponse
> >
> > which does all the cookie work for you in this case.
> >
> > It looks like you are not doing so. Which is why you are having it redirect
> > you.
> >
> > also, setting rs.Credentials really isn't important since you have anonymous
> > access probably turned on.
> >
> >
> >
> > "ghoff12" <ghoff12@.discussions.microsoft.com> wrote in message
> > news:48EA1A8C-2F49-413C-BD4C-7CEAB367698C@.microsoft.com...
> > >I still get the Object Moved to here message. Can anyone help me?
> > >
> > > my code looks like:
> > >
> > > Dim rs As New wsEcho.ReportingService2005
> > > rs.Url => > > "http://domainname/reportserver/reportexecution2005.asmx?wsdl"
> > > rs.Credentials = System.Net.CredentialCache.DefaultCredentials
> > >
> > > rs.LogonUser("admin", "somepassword", Nothing)
> > >
> > > Dim item As wsEcho.CatalogItem
> > > For Each item In rs.ListChildren("/Reports", False)
> > > If item.Type = ItemTypeEnum.Report Then
> > > Me.ddReports.Items.Add(New ListItem(item.Name,
> > > item.Path))
> > > End If
> > > Next
> > >
> >
> >
> >

Wednesday, March 7, 2012

Custom Data Mining Functions

I would like to write a custom mining function, which takes a string, queries the database, and returns an answer based upon those queries. So the basic function is then:

[MiningFunction("Performs Foo")]
public string Foo(string param)
{
// process parameters
// query database

// calculate answer from query results

// return query results
}

And is executed from the client using:

SELECT Foo("X Y Z") FROM FooModel

This arrangement is so that resource-intensive calculations are performed server-side.

My question is: what is the preferrable method for executing the database query from within the custom mining function?

Custom mining functions are not actually designed for this kind of operations. They are intended for predictive features that are related to the mining model and typically this kind of operations do not need external access (such as a database query). I assume that your function's calculation part will use some information from the mining model and apply it to the database query results.

I think you should use a stored procedure. Inside the stored procedure, you should use the server side object model (add a reference to Microsoft.AnalysisServices.AdomdServer). With the server side object model, you can perform the following operations:

- use AdomdCommand to execute calls such as CALL SystemOpenQuery(DataSource, Query), which is the recommended way of querying a relational database from analysis services

- also use AdomdCommand to execute calls such as SELECT .... FROM YourModel PREDICTION JOIN OPENQUERY(DataSource, Query)

This would allow you to get the information from the data base together with scoring for each, scoring computed as a prediction from your model ). Your code could use the results and perform aggregations or more complex computations on the result.

If, in the code of your stored procedure, you need to get extra information from your model, you can traverse the content of the mining model using the object model.

The article at http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/4264.aspx contains such a stored procedure, which requires both data and model content information, so I think it may be a good example. The data is coming directly from the model, with a drillthrough query. You can replace that query with a CALL SystemOpenQuery or prediction against an OPENQUERY statement.

Hope this helps

|||Yes, this is helpful. I'm looking at the material you referenced to see if it completely answers my question. Unfortunately, I don't seem able to progress pass the logon screen at sqlserverdatamining at the moment, so I can't get the .cs example...|||Do you have an account on sqlserverdatamining.com? Do you have problems logging in with your account? Or creating a new account