Showing posts with label integrated. Show all posts
Showing posts with label integrated. Show all posts

Monday, March 26, 2012

MSRS Java Client

We tried to develop a MSRS Java Client to communicate with the MSRS server
via web services. Because of integrated windows authentication, we
encountered an access denial error. Has anyone encountered this problem and
know how to embed windows security in the Java client. By the way, I used
Apache Axis to create client stub classes from a WSDL file. I obtained the
WSDL file from the MSRS server directly.
Thanks,
JamesJames, I am trying to do exactly what you are describing and have run into
the same problem. Did you ever discover a solution?
Thanks!
"James" wrote:
> We tried to develop a MSRS Java Client to communicate with the MSRS server
> via web services. Because of integrated windows authentication, we
> encountered an access denial error. Has anyone encountered this problem and
> know how to embed windows security in the Java client. By the way, I used
> Apache Axis to create client stub classes from a WSDL file. I obtained the
> WSDL file from the MSRS server directly.
> Thanks,
> James|||Josh, James, I'm having this problem as well. Was there a solution?
"Josh Hensley" wrote:
> James, I am trying to do exactly what you are describing and have run into
> the same problem. Did you ever discover a solution?
> Thanks!
> "James" wrote:
> > We tried to develop a MSRS Java Client to communicate with the MSRS server
> > via web services. Because of integrated windows authentication, we
> > encountered an access denial error. Has anyone encountered this problem and
> > know how to embed windows security in the Java client. By the way, I used
> > Apache Axis to create client stub classes from a WSDL file. I obtained the
> > WSDL file from the MSRS server directly.
> >
> > Thanks,
> >
> > James|||Hey LT,
I did find a solution, but forgot to come back and mention it here.
The problem comes from the fact that we need to call the Render method
without specifying some optional parameters (like historyID). When you call
a Web Service API method from Java and leave out an optional parameter, the
SOAP message that is generated by AXIS can either exclude the tag for that
missing parameter or include the tag with a special attribute saying it's not
being used (xsi:nil="true"). The default for behavior for AXIS is to send
the tag with the special attribute but apparently Microsoft Reporting
Services doesn't want the tag sent at all. So you have to modify AXIS to
satisfy Reporting Services and stop sending tags for arguments that aren't
specified.
A much more detailed explanation is in this article written by a fella from
France. (You will have to register on their site to read the article)
http://www.sqlreportingservices.net/Tools/1996.aspx
Good luck!
"LT" wrote:
> Josh, James, I'm having this problem as well. Was there a solution?
> "Josh Hensley" wrote:
> > James, I am trying to do exactly what you are describing and have run into
> > the same problem. Did you ever discover a solution?
> >
> > Thanks!
> >
> > "James" wrote:
> >
> > > We tried to develop a MSRS Java Client to communicate with the MSRS server
> > > via web services. Because of integrated windows authentication, we
> > > encountered an access denial error. Has anyone encountered this problem and
> > > know how to embed windows security in the Java client. By the way, I used
> > > Apache Axis to create client stub classes from a WSDL file. I obtained the
> > > WSDL file from the MSRS server directly.
> > >
> > > Thanks,
> > >
> > > Jamessql

Monday, March 19, 2012

Msg 6573 - method in assembly is not static - how do I make it static ?

I'm using Delphi 2006 to create a DLL which will be integrated into SQL 2005. It's been a long road and I've made a lot of headway, however I am currently having the following problem creating the stored procedure:

My dll name is 'Crystal_Reports_Test_01'
In the DLL, my class is named 'Class01'.
In the DLL, my procedure is named 'TestMe'

I've managed to integrate the DLL into SQL using the following statement:

CREATE ASSEMBLY TEST_ERIC_01
AUTHORIZATION dbo
FROM 'c:\mssql\assemblies\crystalreports.dll'
WITH PERMISSION_SET = UNSAFE


I am attempting to create the stored procedure which points to the 'TestMe' method inside of the DLL. FYI: 'CrystalReports' is the namespace above my class that I had to add in order to get it to locate the class. The following code is used to create the stored procedure:

create procedure dbo.Crystal_Reports_Test_01(
@.Parm1 nvarchar(255)
)
as external name TEST_ERIC_01.[CrystalReports.Class01].TestMe


But I get the following error:

Msg 6573, Level 16, State 1, Procedure Crystal_Reports_Test_01, Line 1
Method, property or field 'TestMe' of class 'CrystalReports.Class01' in assembly 'CrystalReports' is not static.


I'm not sure what this means exactly. I think it means the method (the procedure) is not using Static method binding but should be. I have no idea what this really means or how to accomplish this in the DLL - or if I'm even going about this in the right way.

Any help would be appreciated ! I'll post the Delphi code (DLL) below.

Thanks,

Eric Gooden

library CrystalReports;
uses
System.Reflection,
System.Runtime.InteropServices;
...................
type
Class01 = class
public
procedure TestMe([MarshalAs(UnmanagedType.LPWStr)] var sVarString: wideString); export;
end;

procedure Class01.TestMe([MarshalAs(UnmanagedType.LPWStr)] var sVarString: wideString); export;
begin
sVarString:= 'Lets change the value and see if the stored proc. gets the change.';
end;

end.

I've not actually used Delphi.NET, but after a quick look it seems like to make a static method you have to declare your function like so:

class procedure TestMe([MarshalAs(UnmanagedType.LPWStr)] var sVarString: wideString); export; static;

Hope this works.

|||Yeah, I tried to add the static at the end of the declaration before and the Delphi compiler didn't like it (said "STATIC can only be used on non-virtual class methods"). Which confuses the heck out of me because the Delphi help on Static Methods says that Methods are static by default. And from what I gather, you'd have to add the keyword virtual to specify a non static method.

I may also post in a Delphi forum to see what I come up with. I would have done this originally, but I wasn't sure if it was a problem in my Delphi code or maybe a setting on SQL Server that I might have to tweak.

Thanks,

Eric Gooden
|||Steven, I have to admit that once first viewing I did not notice the keyword Class prefixing the procedure declaration. Adding this prior to the procedure declaration did the trick. After that, Delphi would allow me to define it as static. Thank you very much for your help !

Eric Gooden