Showing posts with label consume. Show all posts
Showing posts with label consume. Show all posts

Sunday, February 19, 2012

Consuming Web Services from the SQL CLR

Hi there,

I've been following Vineets and David's procedures to consume web

services using SQL CLR to the t. I created my web service in C#.NET

2005, and generated my proxy using this command:


wsdl /par:oldwsdlconfig.xml /o:ExactMobileService.cs /n:Project360.SmsService http://www.exactmobile.co.za/interactive/interactivewebservice.asmx

I added both files to the project, set Generate Serialization Assembly to on and compiled it.
I then generated a strong name key for the assembly and signed my assembly with that key.
Inside my post-build event I added the following script:


"E:\Development\Microsoft

Visual Studio 8\SDK\v2.0\Bin\sgen.exe" /force

/compiler:/keyfile:SmsServiceKey.snk /t:StoredProcedures

$(TargetDir)$(TargetName).dll


This compiled into my assembly, the XmlSerializer assembly and then added strong name key to both.


In SQL Server 2005, I enabled CLR, made my DB trustworthy, created my

first assembly with permissions EXTERNAL ACCESS and then the

XmlSerializer assembly with permissions SAFE. I created my stored

procedure and ran it. When I did I got this error which I assumed the

XmlSerializer was supposed to solve for me:

System.InvalidOperationException:

Cannot load dynamically generated serialization assembly. In some

hosting environments assembly load functionality is restricted,

consider using pre-generated serializer. Please see inner exception for

more information. > System.IO.FileLoadException: LoadFrom(),

LoadFile(), Load(byte[]) and LoadModule() have been disabled by the

host.

I have seen alot of posts about this error, but none of them has been able to solve my problem.

Please can you help me?

O'Connor

Hi O'Connor,

As you have experienced, there are a few cases where sgen does not solve the problem of dynamically loading the XmlSerializer assembly.There is usually always a possible workaround, but it can vary depending on exactly what your code is doing.I was intending on writing some more blog posts about solutions to these dynamic assembly loading problems, but haven't had the time to finish them yet.

The problem you're most likely hitting is that the code doing the XmlSerialization uses an XmlSerializer constructor that does not check for the pre-generated (sgened) assemblies.This could be either directly in your code, or in other .NET Framework code that does this, such as in a strongly typed ADO.NET Dataset.This is covered in the msdn documentation for XmlSerializer if you look at the "Dynamically Generated Assemblies" section http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx

If this is indeed the problem, then the easiest way to fix this is to modify your code to instead use one of the constructors that does check for a pre-generated XmlSerializer assembly.This might be more difficult if it is not your code that is directly calling the XmlSerializer constructor.If you can include the full callstack of the error message you shared below and a snippet of the code where the XmlSerialization is happening, I should be able to help you fix it.

Steven

|||Hi Steven,

Thanks for getting back to me in such a short time.
I was playing with it last night and finally got it working.
My types aren't complex, I only use strings within my assembly (as it is a sms service)
What I did eventually do to fix it was to remove the post build script and set the "Generate Serialization Assembly" on the build tab of the project properties to ON.
It seems that using the sgen tool, the serialization assembly wasn't generated exactly the way that the CLR required it.

I found this website to be very useful in the end:
http://www.u2u.be/Article.aspx?ART=WebServicesinSQL05

Regards,
O'Connor

|||

Hello Steven,

I am currently facing exactly the same strange problem as the initiator of this thread. I want to call a simple webservice from a stored procedure in SQL 2005. I've already tried the different ways of getting the serializer assemblies (using sgen and the build option in VS 2005). I also registered both assemblies one after another in in my SQL 2005 database. The db is trustworthy, assemblies are both marked with "external_access".

But I keep getting the Dynamic Load exception. In your previous post you said you could help if you have the full callstack; here it is...

Msg 6522, Level 16, State 1, Procedure CreateNotification, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'CreateNotification':
System.InvalidOperationException: Cannot load dynamically generated serialization assembly. In some hosting environments assembly load functionality is restricted, consider using pre-generated serializer. Please see inner exception for more information. > System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host.

System.IO.FileLoadException:
at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection)
at System.Reflection.Assembly.Load(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence securityEvidence)
at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)
at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources)
at System.CodeDom.Compiler.Code
...
System.InvalidOperationException:
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, CompilerParameters parameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, compilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
at MAN.Applications.HFIF.Database.ClrExtensions.WebServiceSoapClient..ctor(String ...

How can I change the behaviour of my soap client class to use a particular XmlSerializer constructor that checks for pre-generated assemblies? Could you please give me a hint?

Thanks very much for your help. Frank

Consuming Web Services from the SQL CLR

Hi there,

I've been following Vineets and David's procedures to consume web

services using SQL CLR to the t. I created my web service in C#.NET

2005, and generated my proxy using this command:


wsdl /par:oldwsdlconfig.xml /o:ExactMobileService.cs /n:Project360.SmsService http://www.exactmobile.co.za/interactive/interactivewebservice.asmx

I added both files to the project, set Generate Serialization Assembly to on and compiled it.
I then generated a strong name key for the assembly and signed my assembly with that key.
Inside my post-build event I added the following script:


"E:\Development\Microsoft

Visual Studio 8\SDK\v2.0\Bin\sgen.exe" /force

/compiler:/keyfile:SmsServiceKey.snk /t:StoredProcedures

$(TargetDir)$(TargetName).dll


This compiled into my assembly, the XmlSerializer assembly and then added strong name key to both.


In SQL Server 2005, I enabled CLR, made my DB trustworthy, created my

first assembly with permissions EXTERNAL ACCESS and then the

XmlSerializer assembly with permissions SAFE. I created my stored

procedure and ran it. When I did I got this error which I assumed the

XmlSerializer was supposed to solve for me:

System.InvalidOperationException:

Cannot load dynamically generated serialization assembly. In some

hosting environments assembly load functionality is restricted,

consider using pre-generated serializer. Please see inner exception for

more information. > System.IO.FileLoadException: LoadFrom(),

LoadFile(), Load(byte[]) and LoadModule() have been disabled by the

host.

I have seen alot of posts about this error, but none of them has been able to solve my problem.

Please can you help me?

O'Connor

Hi O'Connor,

As you have experienced, there are a few cases where sgen does not solve the problem of dynamically loading the XmlSerializer assembly.There is usually always a possible workaround, but it can vary depending on exactly what your code is doing.I was intending on writing some more blog posts about solutions to these dynamic assembly loading problems, but haven't had the time to finish them yet.

The problem you're most likely hitting is that the code doing the XmlSerialization uses an XmlSerializer constructor that does not check for the pre-generated (sgened) assemblies.This could be either directly in your code, or in other .NET Framework code that does this, such as in a strongly typed ADO.NET Dataset.This is covered in the msdn documentation for XmlSerializer if you look at the "Dynamically Generated Assemblies" section http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx

If this is indeed the problem, then the easiest way to fix this is to modify your code to instead use one of the constructors that does check for a pre-generated XmlSerializer assembly.This might be more difficult if it is not your code that is directly calling the XmlSerializer constructor.If you can include the full callstack of the error message you shared below and a snippet of the code where the XmlSerialization is happening, I should be able to help you fix it.

Steven

|||Hi Steven,

Thanks for getting back to me in such a short time.
I was playing with it last night and finally got it working.
My types aren't complex, I only use strings within my assembly (as it is a sms service)
What I did eventually do to fix it was to remove the post build script and set the "Generate Serialization Assembly" on the build tab of the project properties to ON.
It seems that using the sgen tool, the serialization assembly wasn't generated exactly the way that the CLR required it.

I found this website to be very useful in the end:
http://www.u2u.be/Article.aspx?ART=WebServicesinSQL05

Regards,
O'Connor

|||

Hello Steven,

I am currently facing exactly the same strange problem as the initiator of this thread. I want to call a simple webservice from a stored procedure in SQL 2005. I've already tried the different ways of getting the serializer assemblies (using sgen and the build option in VS 2005). I also registered both assemblies one after another in in my SQL 2005 database. The db is trustworthy, assemblies are both marked with "external_access".

But I keep getting the Dynamic Load exception. In your previous post you said you could help if you have the full callstack; here it is...

Msg 6522, Level 16, State 1, Procedure CreateNotification, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'CreateNotification':
System.InvalidOperationException: Cannot load dynamically generated serialization assembly. In some hosting environments assembly load functionality is restricted, consider using pre-generated serializer. Please see inner exception for more information. > System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host.

System.IO.FileLoadException:
at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection)
at System.Reflection.Assembly.Load(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence securityEvidence)
at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)
at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources)
at System.CodeDom.Compiler.Code
...
System.InvalidOperationException:
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, CompilerParameters parameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, compilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
at MAN.Applications.HFIF.Database.ClrExtensions.WebServiceSoapClient..ctor(String ...

How can I change the behaviour of my soap client class to use a particular XmlSerializer constructor that checks for pre-generated assemblies? Could you please give me a hint?

Thanks very much for your help. Frank

consuming sqlserver 2005 webservice from asp.net 1.1

Is it possible to consume the sql 2005 web service from 1.1? When I try and do so I receive the following error:

Type 'http://schemas.microsoft.com/sqlserver/2004/sqltypes:varchar' is not declared or not a simple type. An error occurred at , (1, 2452).

Thanks,

Olja

Yes, but if you are using the WSDL to generate stub class code, then you will need to retrieve the simple WSDL (ie. http://server/url?wsdlsimple). For additional information regarding simple WSDL please refer to MSDN article http://msdn2.microsoft.com/en-us/library/ms175476.aspx

If you are using a .Net Frameworks 1.1 DataSet object to serialize the result from a SELECT statement, please note that .Net Frameworks 1.1 DataSet XML serialization is not fully compatible with SQL Server 2005 Native Web Services. Please use VS 2005/.Net Frameworks 2.0.

Jimmy

consuming sqlserver 2005 webservice from asp.net 1.1

Is it possible to consume the sql 2005 web service from 1.1? When I try and do so I receive the following error:

Type 'http://schemas.microsoft.com/sqlserver/2004/sqltypes:varchar' is not declared or not a simple type. An error occurred at , (1, 2452).

Thanks,

Olja

Yes, but if you are using the WSDL to generate stub class code, then you will need to retrieve the simple WSDL (ie. http://server/url?wsdlsimple). For additional information regarding simple WSDL please refer to MSDN article http://msdn2.microsoft.com/en-us/library/ms175476.aspx

If you are using a .Net Frameworks 1.1 DataSet object to serialize the result from a SELECT statement, please note that .Net Frameworks 1.1 DataSet XML serialization is not fully compatible with SQL Server 2005 Native Web Services. Please use VS 2005/.Net Frameworks 2.0.

Jimmy

Consuming secured webservice in SSRS

Hi All,

We have a webservice, which we are able to consume in the SSRS report.

Due to some requirement, we need to conver this webservice in to the secured webservice using the SSL https extension.

We did this and just changed the connection string from http to https.

But when we try to run the report, we get the following error message. Copied from BIDS.

TITLE: Microsoft Report Designer

An error occurred while executing the query.
Failed to prepare web request for the specified URL.


ADDITIONAL INFORMATION:

Failed to prepare web request for the specified URL. (Microsoft.ReportingServices.DataExtensions)

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. (System)

The remote certificate is invalid according to the validation procedure. (System)


BUTTONS:

OK

Can anybody help in this.

Thanks in advance.

Virendra

Can anybody help to guide on the changes required for achieving this?

Virendra

|||

Hi ,

Has anybody used the secured webservice successfull as data source in the SSRS?

Any pointers to the above problem?

Virendra

|||

Hi All (looking at this post),

The problem is resolved. It was a trivial mistake done on my side. The "Windows Authentication" was enabled on the web service and the properties of the data source were set to No credentials in SSRS. After resolving this, it started working.

Virendra

Consuming secured webservice in SSRS

Hi All,

We have a webservice, which we are able to consume in the SSRS report.

Due to some requirement, we need to conver this webservice in to the secured webservice using the SSL https extension.

We did this and just changed the connection string from http to https.

But when we try to run the report, we get the following error message. Copied from BIDS.

TITLE: Microsoft Report Designer

An error occurred while executing the query.
Failed to prepare web request for the specified URL.


ADDITIONAL INFORMATION:

Failed to prepare web request for the specified URL. (Microsoft.ReportingServices.DataExtensions)

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. (System)

The remote certificate is invalid according to the validation procedure. (System)


BUTTONS:

OK

Can anybody help in this.

Thanks in advance.

Virendra

Can anybody help to guide on the changes required for achieving this?

Virendra

|||

Hi ,

Has anybody used the secured webservice successfull as data source in the SSRS?

Any pointers to the above problem?

Virendra

|||

Hi All (looking at this post),

The problem is resolved. It was a trivial mistake done on my side. The "Windows Authentication" was enabled on the web service and the properties of the data source were set to No credentials in SSRS. After resolving this, it started working.

Virendra

Consuming secured webservice in SSRS

Hi All,

We have a webservice, which we are able to consume in the SSRS report.

Due to some requirement, we need to conver this webservice in to the secured webservice using the SSL https extension.

We did this and just changed the connection string from http to https.

But when we try to run the report, we get the following error message. Copied from BIDS.

TITLE: Microsoft Report Designer

An error occurred while executing the query.
Failed to prepare web request for the specified URL.


ADDITIONAL INFORMATION:

Failed to prepare web request for the specified URL. (Microsoft.ReportingServices.DataExtensions)

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. (System)

The remote certificate is invalid according to the validation procedure. (System)


BUTTONS:

OK

Can anybody help in this.

Thanks in advance.

Virendra

Can anybody help to guide on the changes required for achieving this?

Virendra

|||

Hi ,

Has anybody used the secured webservice successfull as data source in the SSRS?

Any pointers to the above problem?

Virendra

|||

Hi All (looking at this post),

The problem is resolved. It was a trivial mistake done on my side. The "Windows Authentication" was enabled on the web service and the properties of the data source were set to No credentials in SSRS. After resolving this, it started working.

Virendra

Consuming from Web Service and Load data into SQL

Hi:

Can someone help me with a SSIS package that would consume from a Web Service (in fact two of them) and then load the data into SQL Server. I currently have Web Service task which connects to ForEachLoop task, and inside the loop task, I have a DFT. I am thinking, I would need to call the webservice utilizing the Web Services Task, and then store the output in a Full ResultSet variable. In my loop, I would like to loop thru the resultset, and store the data into SQL server. Inside the DFT, how would I construct this mechanism? Also, is this a good way to consume from a Web Service and then populate SQL Server? Are there any alternate ideas on this? Any documentation on this yet? Thanks.

MA,

Let me clarify. Do you want to consume data from a web service from within the data-flow?

-Jamie

|||

Well, the goal is to call a web service, and pump data into SQL server, although I thought it's less complex to hook up to a Web Services Task, and then utilize the output from the Web Services within a DFT somehow but not sure. Is there a better way to do this. Thanks.

|||

I think so, yes. It is possible to consume data from a web service from directly within the pipeline. What you are proposing would be an extra step.

To consume from a web service in the pipeline you will need a script component. Donald Farmer's book (http://www.amazon.com/Rational-Guide-Extending-Script-Guides/dp/1932577254/ref=pd_bbs_sr_1/104-7087211-5731917?ie=UTF8&s=books&qid=1181582618&sr=8-1) has a chapter explaining how to do it.

-Jamie

|||

It looks like utilizing the XML Adapter task in the DFT, would allow us to read data from a Variable, not sure how this feature works, but will provide comments, once its working for me. My goal is to avoid using the script component, and utilize existing tasks to accomplish this goal, lets see where I get with that :-)

|||

MA2005 wrote:

It looks like utilizing the XML Adapter task in the DFT, would allow us to read data from a Variable, not sure how this feature works, but will provide comments, once its working for me. My goal is to avoid using the script component, and utilize existing tasks to accomplish this goal, lets see where I get with that :-)

Fair enough. I think that's a worthy aim.

Out of interest, why do you not want to use the script component?

-Jamie

|||

No reason, just exploring an alternate solution. :-)

Consuming events in code

Hi,

Ive been taking a look at how to consume events from a package when executing programatically.

Ive got some code (copied below) that creates a package programatically, adds a sequence container then within that adds a script task , then executes it using the overloaded method of Package.Execute() that takes an IDtsEvents argument.

My class that implements IDtsEvents simply output a message to the console for each event type.

Weird thing is, when I execute, this is the only output I get:

Starting...
OnPreValidate: Microsoft.SqlServer.Dts.Runtime.Package
OnPreValidate: Microsoft.SqlServer.Dts.Runtime.Sequence
OnPreValidate: Microsoft.SqlServer.Dts.Runtime.TaskHost
OnPostValidate:Microsoft.SqlServer.Dts.Runtime.TaskHost
OnQueryCancel
Package ran successfully

What I find weird is that I dont get information for loads of other event types. I would at least have expected to see some OnPostExecute events.

Anyone know why i dont see all of the events?

Thanks

Jamie

Heres the code:

Code Snippet

using System;

using System.Collections.Generic;

using System.Text;

using Microsoft.SqlServer.Dts.Runtime;

using Microsoft.SqlServer.Dts.Tasks.ScriptTask;

namespace Package_API

{

class Program

{

static void Main(string[] args)

{

Console.WriteLine("Starting...");

Package p = new Package();

p.InteractiveMode = true;

p.OfflineMode = true;

// Add a Script Task to the package.

Sequence s = (Sequence)p.Executables.Add("STOCK:Sequence");

TaskHost taskH = (TaskHost)s.Executables.Add("STOCK:ScriptTask");

// Run the package.

DtsEvents events = new DtsEvents();

p.Execute(null,null,events,null,null);

//p.Execute();

if (p.ExecutionResult == DTSExecResult.Failure || p.ExecutionStatus == DTSExecStatus.Abend)

Console.WriteLine("Package failed or abended");

else

Console.WriteLine("Package ran successfully");

Console.ReadLine();

}

}

}

// Class that implements the IDTSEvents interface:

public sealed class DtsEvents : IDTSEvents

{

void IDTSEvents.OnPreExecute(Executable exec, ref bool fireAgain)

{

Console.WriteLine("OnPreExecute: " + exec.ToString());

}

void IDTSEvents.OnBreakpointHit(IDTSBreakpointSite breakpointSite, BreakpointTarget breakpointTarget)

{

Console.WriteLine("OnBreakpointHit");

}

void IDTSEvents.OnCustomEvent(TaskHost taskHost,string eventName,string eventText,ref Object[] arguments,string subComponent,ref bool fireAgain)

{

Console.WriteLine("CustomEvent");

}

void IDTSEvents.OnPreValidate(Executable exec, ref bool fireAgain)

{

Console.WriteLine("OnPreValidate: " + exec.ToString());

}

void IDTSEvents.OnPostValidate(Executable exec, ref bool fireAgain)

{

Console.WriteLine("OnPostValidate:" + exec.ToString());

}

void IDTSEvents.OnWarning(DtsObject source,int warningCode,string subComponent,string description,string helpFile,int helpContext,string idofInterfaceWithError)

{

Console.WriteLine("OnWarning");

}

void IDTSEvents.OnInformation(DtsObject source,int informationCode,string subComponent,string description,string helpFile,int helpContext,string idofInterfaceWithError,ref bool fireAgain)

{

Console.WriteLine("OnInformation");

}

void IDTSEvents.OnPostExecute(Executable exec, ref bool fireAgain)

{

Console.WriteLine("OnPostExecute");

}

bool IDTSEvents.OnError(DtsObject source,int errorCode,string subComponent,string description,string helpFile,int helpContext,string idofInterfaceWithError)

{

Console.WriteLine("OnError");

return true;

}

void IDTSEvents.OnTaskFailed(TaskHost taskHost)

{

Console.WriteLine("OnTaskFailed");

}

void IDTSEvents.OnProgress(TaskHost taskHost,string progressDescription,int percentComplete,int progressCountLow,int progressCountHigh,string subComponent,ref bool fireAgain)

{

Console.WriteLine("OnProgress");

}

bool IDTSEvents.OnQueryCancel()

{

Console.WriteLine("OnQueryCancel");

return true;

}

void IDTSEvents.OnExecutionStatusChanged(Executable exec,DTSExecStatus newStatus,ref bool fireAgain)

{

Console.WriteLine("OnExecutionStatusChanged");

}

void IDTSEvents.OnVariableValueChanged(DtsContainer DtsContainer,Variable variable,ref bool fireAgain)

{

Console.WriteLine("OnVariableValueChanged");

}

}

By returning true from OnQueryCancel, you are cancelling the package Smile

Just add Console.WriteLine(p.ExecutionResult) - it should be Cancelled.

Return false from this method, or inherit from DefaultEvents and only override methods that you actually need.

|||

Michael Entin - MSFT wrote:

By returning true from OnQueryCancel, you are cancelling the package

Just add Console.WriteLine(p.ExecutionResult) - it should be Cancelled.

Return false from this method, or inherit from DefaultEvents and only override methods that you actually need.

DOH!!!

What a dumbass. I should have realised that!


Thanks Michael!

-Jamie

|||

How odd, Jamie. According my class I can follow each event -including post and pre executing...

Dim EventsSSIS As EventosSSIS
EventsSSIS = New EventosSSIS()
sResultDts = pkg.Execute(Nothing, Nothing, EventsSSIS, Nothing, Nothing)

Public Class EventosSSIS
Implements IDTSEvents
Public proceso As Int16 = 0

Sub OnPostValidate(ByVal exec As Executable, ByRef fireAgain As Boolean) Implements IDTSEvents.OnPostValidate
End Sub
Sub OnProgress(ByVal taskHost As TaskHost, ByVal progressDescription As String, ByVal percentComplete As Integer, ByVal progressCountLow As Integer, ByVal progressCountHigh As Integer, ByVal subComponent As String, ByRef fireAgain As Boolean) Implements IDTSEvents.OnProgress
End Sub
Sub OnPreExecute(ByVal exec As Executable, ByRef fireAgain As Boolean) Implements IDTSEvents.OnPreExecute
End Sub
Sub OnPreValidate(ByVal exec As Executable, ByRef fireAgain As Boolean) Implements IDTSEvents.OnPreValidate
End Sub
Sub OnPostExecute(ByVal exec As Executable, ByRef fireAgain As Boolean) Implements IDTSEvents.OnPostExecute
End Sub
Sub OnWarning(ByVal source As DtsObject, ByVal warningCode As Integer, ByVal subComponent As String, ByVal description As String, ByVal helpFile As String, ByVal helpContext As Integer, ByVal idofInterfaceWithError As String) Implements IDTSEvents.OnWarning
End Sub
Sub OnInformation(ByVal [source] As DtsObject, ByVal informationCode As Integer, ByVal subComponent As String, ByVal description As String, ByVal helpFile As String, ByVal helpContext As Integer, ByVal idofInterfaceWithError As String, ByRef fireAgain As Boolean) Implements IDTSEvents.OnInformation
End Sub
Sub OnTaskFailed(ByVal taskHost As TaskHost) Implements IDTSEvents.OnTaskFailed
End Sub
Function OnError(ByVal source As DtsObject, ByVal errorCode As Integer, ByVal subComponent As String, ByVal description As String, ByVal helpFile As String, ByVal helpContext As Integer, ByVal idofInterfaceWithError As String) As Boolean Implements IDTSEvents.OnError
End Function
Sub OnExecutionStatusChanged(ByVal exec As Executable, ByVal newStatus As DTSExecStatus, ByRef fireAgain As Boolean) Implements IDTSEvents.OnExecutionStatusChanged
End Sub
Sub OnCustomEvent(ByVal taskHost As TaskHost, ByVal eventName As String, ByVal eventText As String, ByRef arguments() As Object, ByVal subComponent As String, ByRef fireAgain As Boolean) Implements IDTSEvents.OnCustomEvent
End Sub
Sub OnBreakpointHit(ByVal breakpointSite As IDTSBreakpointSite, ByVal breakpointTarget As BreakpointTarget) Implements IDTSEvents.OnBreakpointHit
End Sub
Sub OnVariableValueChanged(ByVal dtsContainer As DtsContainer, ByVal variable As Variable, ByRef fireAgain As Boolean) Implements IDTSEvents.OnVariableValueChanged
End Sub
Public Overloads Function OnQueryCancel() As Boolean Implements IDTSEvents.OnQueryCancel
Dim cancelar As Int32 = 0
OnQueryCancel = False
Try
Using cn As New SqlConnection(sCadenadeConexion)
cn.Open()
Using cm As SqlCommand = cn.CreateCommand
cm.CommandType = Data.CommandType.Text
cm.CommandText = "SELECT cancelar FROM sis_controlthread where idproceso= " & proceso
cancelar = cm.ExecuteScalar
If cancelar Then
OnQueryCancel = True
Else
OnQueryCancel = False
End If
cm.Dispose()
End Using
cn.Close()
End Using
Catch ex As Exception
TratamientoErrores(0, 0, 11, ex.Message, "On Query Cancel")
End Try
End Function
End Class

Consume HTTP Endpoints in Visual Studio 2005

I'm not a web developer but trying to use Sql 2005 Web Services. I tried to
create a Windows Application in Visaul Studio 2005.
In the New Project dialog box, I couldn't find Windows Application template
to add Web Reference. Anyone has an idea where to get the template.
Help.
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Forum...amming/200606/1First off, because this has to do with VS, this post would be better answere
d in
a dotnet NG.
You may find the add rreference to a WS, not in the New Project but in the
Project Explorer.
HTH
JeffP...
"Naana via webservertalk.com" <u14055@.uwe> wrote in message
news:61208a3a26ff9@.uwe...
> I'm not a web developer but trying to use Sql 2005 Web Services. I tried t
o
> create a Windows Application in Visaul Studio 2005.
> In the New Project dialog box, I couldn't find Windows Application templat
e
> to add Web Reference. Anyone has an idea where to get the template.
> Help.
> --
> Message posted via webservertalk.com
> http://www.webservertalk.com/Uwe/Forum...amming/200606/1

Consume HTTP EndPoint

Hello, I have problems consuming webservice, I was following this page.

http://codebetter.com/blogs/raymond.lewallen/archive/2005/06/23/65089.aspx

but in the intelisense the method returns an array of objects[], So I have a problem with this line.

localhost.GetEmployees sd = new localhost.GetEmployees();

sd.Credentials = System.Net.CredentialCache.DefaultCredentials;

DataSet ds = (DataSet)(sd.EmployeeList());> IT CANT CONVERT.

GridView1.DataSource = ds.Tables[0];

GridView1.DataBind();

Error 1 Cannot convert type 'object[]' to 'System.Data.DataSet' c:\inetpub\wwwroot\atlas1\Default.aspx.cs 18 22 http://localhost/atlas1/

There are 2 ways to resolve this:

The example stored procedure specified on that blog site is only returning a single resultset from a SELECT statement. You can modify the CREATE ENDPOINT statement to the following:
CREATE ENDPOINT GetEmployees
STATE = STARTED
AS HTTP
(
PATH = '/Employee',
AUTHENTICATION = (INTEGRATED),
PORTS = (CLEAR),
SITE = 'localhost'
)
FOR SOAP
(
WEBMETHOD 'EmployeeList'
(NAME='AdventureWorks.dbo.GetEmployees', FORMAT=ROWSETS_ONLY),
BATCHES = DISABLED,
WSDL = DEFAULT,
DATABASE = 'AdventureWorks',
NAMESPACE = 'http://AdventureWorks/Employee'
)
go

such that the generated method signature will be:
DataSet EmployeeList();you will not need the CAST anymore;

The other solution is to modify your client code to:
object [] o = sd.EmployeeList();
DataSet ds = (DataSet)(o[0]);

Note: You really should check each of the objects in the object[] to make sure it is of the proper type before casting the object. This will prevent other cast exceptions.

Hope that helps.
Jimmy Wu

|||

I used this script

create ENDPOINT [GetEmployees]

AUTHORIZATION [LUCHO\Administrador]

STATE=STARTED

AS HTTP (PATH=N'/Employee', PORTS = (CLEAR), AUTHENTICATION = (INTEGRATED), SITE=N'localhost', CLEAR_PORT = 85, COMPRESSION=DISABLED)

FOR SOAP (

WEBMETHOD 'EmployeeList'( NAME=N'[AdventureWorks].[dbo].[GetEmployees]'

, SCHEMA=DEFAULT

, FORMAT=ROWSETS_ONLY), BATCHES=DISABLED,

WSDL=N'[master].[sys].[sp_http_generate_wsdl_defaultcomplexorsimple]',

SESSIONS=DISABLED, SESSION_TIMEOUT=60, DATABASE=N'AdventureWorks',

NAMESPACE=N'http://AdventureWorks/Employee',

SCHEMA=STANDARD, CHARACTER_SET=XML)

Now i have an 401 Error Not Authorized? I am on windows xp not on an active directory domain, so I am the only user, and I am the administrator too.

|||

Luis,

Most likely you are hitting a WinXP issue where for "Integrated" authentication type (which supports both Kerberos and NTLM), applications running WinXP do not fall back to NTLM when Kerberos support is not available.

In your scenario, since your machine is not on a domain, it most likely is not able to contact the Kerberos SPN server.

There is 2 possible solutions:
1) Alter the endpoint to only support NTLM
eg. ALTER ENDPOINT GetEmployees
AS HTTP (
AUTHENTICATION=(NTLM)
)

2) Change your client app to only support NTLM
eg. Instead of setting the credential as sd.Credentials = System.Net.CredentialCache.DefaultCredentials;set the credentials as System.Net.CredentialCache myCreds = new System.Net.CredentialCache();
myCreds.Add(new Uri(sd.Url), "NTLM", System.Net.CredentialCache.DefaultCredentials.GetCredential(new Uri(sd.Url), "NTLM"));
sd.Credentials = myCreds;

This will force the client application to only support NTLM authentication type.

For additional information on specifying specific authentication types in the client application please refer to http://msdn2.microsoft.com/en-us/library/ms175929.aspx

Jimmy Wu

|||

I have had similiar issues as the above users. And have used the same solutions to only receive the following error:

System.Xml.Schema.XmlSchemaException: Type 'http://schemas.microsoft.com/sqlserver/2004/sqltypes:int' is not declared. An error occurred at , (1, 1989).

SQL Code:

CREATE ENDPOINT GetStores

STATE = STARTED

AS HTTP

(

PATH = '/Store',

AUTHENTICATION = (INTEGRATED),

PORTS = (CLEAR),

SITE = 'localhost',

CLEAR_PORT = 81

)

FOR SOAP

(

WEBMETHOD 'StoreList'

(

NAME='AdventureWorks.dbo.SalesStoreProc',

FORMAT = ROWSETS_ONLY

),

BATCHES = DISABLED,

WSDL = DEFAULT,

DATABASE = 'AdventureWorks',

NAMESPACE = 'http://AdventureWorks/Store'

)

GO

GRANT CONNECT ON ENDPOINT::[GetStores] TO PUBLIC

VB.NET Code

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'Create an instance of the Proxy class

Dim ws As New StoreList.localhost.GetStores

ws.Credentials = System.Net.CredentialCache.DefaultCredentials

'Bind the results of GetStores to dgStoreList

Me.dgStoreList.DataSource = ws.StoreList()

Me.dgStoreList.DataBind()

End Sub

Versions:

VS2003

SQL 2K5 sp1

WINXP sp2

|||

You mentioned that you are using Visual Studio 2003. Unfortunately, VS2003's DataSet object is not fully supported by SQL 2005 Native Web Services. For the richest programming experience, it is recommended to use Visual Studio 2005 when programming against SQL 2005 Native Web Services.

When using Visual Studio 2003 to design and implement a client application against SQL 2005 Native Web Services, the recommendation is to make the "Web Reference" against the Simple WSDL instead of the Default WSDL document. Retrieval of the Simple WSDL document is done by specifying "?wsdlsimple" as the suffix of the URL.

ie. http://myserver/myendpoint?wsdlsimple

Since you have already created the client application, it is also possible to just compile your client application with the .Net Frameworks 2.0 compiler that is installed as part of SQL 2005, or part of .Net Frameworks 2.0 (download available at http://msdn.microsoft.com/netframework/downloads/updates/default.aspx)

Jimmy Wu

|||i've been trying to make an easy mobile application(mobile5.0) using vs2005, that consume http endpoint from sql server, but each time the application try to make a connection to the endpoint, it asks for a username and password. i thought, i'll be able to solve this by granting an sql login user, using this..

USE master
GRANT CONNECT ON ENDPOINT::SQLEP_VerlagDB TO [sqlLoginUser]

.. but it didnt do much help. the endpoint also asks for user and password, if i try to open the wsdl site using browsers like firefox. where can i get this user/pass value?

and one more thing, i've tried to consume this endpoint by creating windows-app and web-app. it works! any idea how i can consume this endpoint in a mobile-app?

thanks in advance..

|||

I'm not familiar with the differences between .Net Compact Frameworks and Mobile 5.0, if there's any. SQL 2005 Native Web Services require all requests to be authenticated, this includes retrieving the WSDL document as well as SOAP requests.

If you are using .Net Compact Frameworks 2.0, you should be able to effectively re-compile your working windows-app or web-app with .Net Compact Frameworks 2.0 and everything should work.

Since you said that you have a working windows-app, I am assuming that your working app already contains code to specify the user credentials, such as:

SqlWebReference.SQLEP_VerlagDB wReq = new SQLEP_VerlagDB();
CredentialCache myCache = new CredentialCache();
myCache.Add(new Uri(wReq.Url),"NTLM",new NetworkCredential(UserName,SecurelyStoredPassword));
wReq.Credentials = myCache;

or

wReq.Credentials = System.Net.CredentialCache.DefaultCredentials;

This should continue to work, if not it is working, then it is likely to be an issue with the .Net Compact Frameworks.

If you are using SQL user login credentials to connect to the endpoint, please refer to http://msdn2.microsoft.com/en-us/library/ms180919.aspx for additional information.

If your scenario allows you to use a hard coded local machine user, alternatively, you can use Basic authentication over SSL. In this case, your application will look like:

SqlWebReference.SQLEP_VerlagDB wReq = new SQLEP_VerlagDB();
CredentialCache myCache = new CredentialCache();
myCache.Add(new Uri(wReq.Url),"Basic",new NetworkCredential(UserName,Password));
wReq.Credentials = myCache;

HTH,
Jimmy Wu

Consume HTTP EndPoint

Hello, I have problems consuming webservice, I was following this page.

http://codebetter.com/blogs/raymond.lewallen/archive/2005/06/23/65089.aspx

but in the intelisense the method returns an array of objects[], So I have a problem with this line.

localhost.GetEmployees sd = new localhost.GetEmployees();

sd.Credentials = System.Net.CredentialCache.DefaultCredentials;

DataSet ds = (DataSet)(sd.EmployeeList());> IT CANT CONVERT.

GridView1.DataSource = ds.Tables[0];

GridView1.DataBind();

Error 1 Cannot convert type 'object[]' to 'System.Data.DataSet' c:\inetpub\wwwroot\atlas1\Default.aspx.cs 18 22 http://localhost/atlas1/

There are 2 ways to resolve this:

The example stored procedure specified on that blog site is only returning a single resultset from a SELECT statement. You can modify the CREATE ENDPOINT statement to the following:
CREATE ENDPOINT GetEmployees
STATE = STARTED
AS HTTP
(
PATH = '/Employee',
AUTHENTICATION = (INTEGRATED),
PORTS = (CLEAR),
SITE = 'localhost'
)
FOR SOAP
(
WEBMETHOD 'EmployeeList'
(NAME='AdventureWorks.dbo.GetEmployees', FORMAT=ROWSETS_ONLY),
BATCHES = DISABLED,
WSDL = DEFAULT,
DATABASE = 'AdventureWorks',
NAMESPACE = 'http://AdventureWorks/Employee'
)
go

such that the generated method signature will be:
DataSet EmployeeList();you will not need the CAST anymore;

The other solution is to modify your client code to:
object [] o = sd.EmployeeList();
DataSet ds = (DataSet)(o[0]);

Note: You really should check each of the objects in the object[] to make sure it is of the proper type before casting the object. This will prevent other cast exceptions.

Hope that helps.
Jimmy Wu

|||

I used this script

create ENDPOINT [GetEmployees]

AUTHORIZATION [LUCHO\Administrador]

STATE=STARTED

AS HTTP (PATH=N'/Employee', PORTS = (CLEAR), AUTHENTICATION = (INTEGRATED), SITE=N'localhost', CLEAR_PORT = 85, COMPRESSION=DISABLED)

FOR SOAP (

WEBMETHOD 'EmployeeList'( NAME=N'[AdventureWorks].[dbo].[GetEmployees]'

, SCHEMA=DEFAULT

, FORMAT=ROWSETS_ONLY), BATCHES=DISABLED,

WSDL=N'[master].[sys].[sp_http_generate_wsdl_defaultcomplexorsimple]',

SESSIONS=DISABLED, SESSION_TIMEOUT=60, DATABASE=N'AdventureWorks',

NAMESPACE=N'http://AdventureWorks/Employee',

SCHEMA=STANDARD, CHARACTER_SET=XML)

Now i have an 401 Error Not Authorized? I am on windows xp not on an active directory domain, so I am the only user, and I am the administrator too.

|||

Luis,

Most likely you are hitting a WinXP issue where for "Integrated" authentication type (which supports both Kerberos and NTLM), applications running WinXP do not fall back to NTLM when Kerberos support is not available.

In your scenario, since your machine is not on a domain, it most likely is not able to contact the Kerberos SPN server.

There is 2 possible solutions:
1) Alter the endpoint to only support NTLM
eg. ALTER ENDPOINT GetEmployees
AS HTTP (
AUTHENTICATION=(NTLM)
)

2) Change your client app to only support NTLM
eg. Instead of setting the credential as sd.Credentials = System.Net.CredentialCache.DefaultCredentials;set the credentials as System.Net.CredentialCache myCreds = new System.Net.CredentialCache();
myCreds.Add(new Uri(sd.Url), "NTLM", System.Net.CredentialCache.DefaultCredentials.GetCredential(new Uri(sd.Url), "NTLM"));
sd.Credentials = myCreds;

This will force the client application to only support NTLM authentication type.

For additional information on specifying specific authentication types in the client application please refer to http://msdn2.microsoft.com/en-us/library/ms175929.aspx

Jimmy Wu

|||

I have had similiar issues as the above users. And have used the same solutions to only receive the following error:

System.Xml.Schema.XmlSchemaException: Type 'http://schemas.microsoft.com/sqlserver/2004/sqltypes:int' is not declared. An error occurred at , (1, 1989).

SQL Code:

CREATE ENDPOINT GetStores

STATE = STARTED

AS HTTP

(

PATH = '/Store',

AUTHENTICATION = (INTEGRATED),

PORTS = (CLEAR),

SITE = 'localhost',

CLEAR_PORT = 81

)

FOR SOAP

(

WEBMETHOD 'StoreList'

(

NAME='AdventureWorks.dbo.SalesStoreProc',

FORMAT = ROWSETS_ONLY

),

BATCHES = DISABLED,

WSDL = DEFAULT,

DATABASE = 'AdventureWorks',

NAMESPACE = 'http://AdventureWorks/Store'

)

GO

GRANT CONNECT ON ENDPOINT::[GetStores] TO PUBLIC

VB.NET Code

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'Create an instance of the Proxy class

Dim ws As New StoreList.localhost.GetStores

ws.Credentials = System.Net.CredentialCache.DefaultCredentials

'Bind the results of GetStores to dgStoreList

Me.dgStoreList.DataSource = ws.StoreList()

Me.dgStoreList.DataBind()

End Sub

Versions:

VS2003

SQL 2K5 sp1

WINXP sp2

|||

You mentioned that you are using Visual Studio 2003. Unfortunately, VS2003's DataSet object is not fully supported by SQL 2005 Native Web Services. For the richest programming experience, it is recommended to use Visual Studio 2005 when programming against SQL 2005 Native Web Services.

When using Visual Studio 2003 to design and implement a client application against SQL 2005 Native Web Services, the recommendation is to make the "Web Reference" against the Simple WSDL instead of the Default WSDL document. Retrieval of the Simple WSDL document is done by specifying "?wsdlsimple" as the suffix of the URL.

ie. http://myserver/myendpoint?wsdlsimple

Since you have already created the client application, it is also possible to just compile your client application with the .Net Frameworks 2.0 compiler that is installed as part of SQL 2005, or part of .Net Frameworks 2.0 (download available at http://msdn.microsoft.com/netframework/downloads/updates/default.aspx)

Jimmy Wu

|||i've been trying to make an easy mobile application(mobile5.0) using vs2005, that consume http endpoint from sql server, but each time the application try to make a connection to the endpoint, it asks for a username and password. i thought, i'll be able to solve this by granting an sql login user, using this..

USE master
GRANT CONNECT ON ENDPOINT::SQLEP_VerlagDB TO [sqlLoginUser]

.. but it didnt do much help. the endpoint also asks for user and password, if i try to open the wsdl site using browsers like firefox. where can i get this user/pass value?

and one more thing, i've tried to consume this endpoint by creating windows-app and web-app. it works! any idea how i can consume this endpoint in a mobile-app?

thanks in advance..

|||

I'm not familiar with the differences between .Net Compact Frameworks and Mobile 5.0, if there's any. SQL 2005 Native Web Services require all requests to be authenticated, this includes retrieving the WSDL document as well as SOAP requests.

If you are using .Net Compact Frameworks 2.0, you should be able to effectively re-compile your working windows-app or web-app with .Net Compact Frameworks 2.0 and everything should work.

Since you said that you have a working windows-app, I am assuming that your working app already contains code to specify the user credentials, such as:

SqlWebReference.SQLEP_VerlagDB wReq = new SQLEP_VerlagDB();
CredentialCache myCache = new CredentialCache();
myCache.Add(new Uri(wReq.Url),"NTLM",new NetworkCredential(UserName,SecurelyStoredPassword));
wReq.Credentials = myCache;

or

wReq.Credentials = System.Net.CredentialCache.DefaultCredentials;

This should continue to work, if not it is working, then it is likely to be an issue with the .Net Compact Frameworks.

If you are using SQL user login credentials to connect to the endpoint, please refer to http://msdn2.microsoft.com/en-us/library/ms180919.aspx for additional information.

If your scenario allows you to use a hard coded local machine user, alternatively, you can use Basic authentication over SSL. In this case, your application will look like:

SqlWebReference.SQLEP_VerlagDB wReq = new SQLEP_VerlagDB();
CredentialCache myCache = new CredentialCache();
myCache.Add(new Uri(wReq.Url),"Basic",new NetworkCredential(UserName,Password));
wReq.Credentials = myCache;

HTH,
Jimmy Wu

Consume DataReaderDest from asp.net page?

I have seen the other posts about how to use Microsoft.SqlServer.Dts.DtsClient to run a package and get back the DataReader results. But this fails when run from a client mahcine that does not have SSIS installed. I want to have this page on a web server run the package on a remote Sql Server machine and get back the results but have so far failed. Any one got this working?


protected void Page_Load(object sender, EventArgs e)
{
string path = @."C:\Documents and Settings\Brandon\My Documents\Visual Studio 2005\Projects\Integration Services Project5\Integration Services Project5\FuzzyLookup.dtsx";

DtsConnection connection = new DtsConnection();
connection.ConnectionString = string.Format(@."-f ""{0}""", path);
connection.Open();

DtsCommand command = new DtsCommand(connection);
command.CommandText = "DataReaderDest";

IDataReader reader = command.ExecuteReader(CommandBehavior.Default);

DataSet set = new DataSet();
set.Load(reader, LoadOption.OverwriteChanges, reader.GetSchemaTable().TableName);

_grid.DataSource = set;
_grid.DataBind();

connection.Close();

}

You have to install the SSIS components on the machine where you are executing the SSIS package (which does require a license of SQL Server).

Consume DataReaderDest from asp.net page?

I have seen the other posts about how to use Microsoft.SqlServer.Dts.DtsClient to run a package and get back the DataReader results. But this fails when run from a client mahcine that does not have SSIS installed. I want to have this page on a web server run the package on a remote Sql Server machine and get back the results but have so far failed. Any one got this working?


protected void Page_Load(object sender, EventArgs e)
{
string path = @."C:\Documents and Settings\Brandon\My Documents\Visual Studio 2005\Projects\Integration Services Project5\Integration Services Project5\FuzzyLookup.dtsx";

DtsConnection connection = new DtsConnection();
connection.ConnectionString = string.Format(@."-f ""{0}""", path);
connection.Open();

DtsCommand command = new DtsCommand(connection);
command.CommandText = "DataReaderDest";

IDataReader reader = command.ExecuteReader(CommandBehavior.Default);

DataSet set = new DataSet();
set.Load(reader, LoadOption.OverwriteChanges, reader.GetSchemaTable().TableName);

_grid.DataSource = set;
_grid.DataBind();

connection.Close();

}

You have to install the SSIS components on the machine where you are executing the SSIS package (which does require a license of SQL Server).

Consume Connection from Report Explorer Web Part

Hello!
I am writing a custom report viewer that I would like to work with the
Report Explorer web part in SP2.
I created my consumer web part and it is connected to the Report Explorer
but it does not seem to ever receive any data from the Report Explorer. Is
the Report Viewer web part the only web part that can consume the information
provided by the Report Explorer?
TIA!
BrianHi Brian,
Welcome to use MSDN Managed Newsgroup!
From your description, my understanding of this issue is: you want to write
the consumer web part to connect to the Report Explorer Web part. If I
misunderstood your concern, please feel free to point it out.
Based on my knowledge, the Report Explorer Web Part and the Report Viewer
Web Part use the technical "Connectable Web Part to handle the connections
between them. So if you want to customize your web part to connect to the
Report Explorer, you need to implement the ICellConsumer interface.
Here is a article talk about the technical "Connectable Web Part" and there
is the sample code for how to implement the interface.
Creating a Connectable Web Part
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spptsdk/htm
l/CreateConnectableWP_SV01003714.asp
Using Reporting Services SharePoint Web Parts in SQL Server 2000 Reporting
Services Service Pack 2
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/webrssp2.mspx
#EIAA
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi Michael.
Thanks for the post.
Let me be a bit more specific. I already wrote a test web part implementing
the ICellConsumer interface.
When I connect it to the Report Explorer, the Cell that I get is an empty
string.
Actually, the CellReady method only seems to be called when the page loads.
Clicking on folders and reports in the Report Explorer does not seem to pass
any information to my web part. It passes something to the Report Viewer when
it is on the same page since instead of opening a new window to display a
report, the Report Viewer displays the report.
--
Take care,
Brian
"Michael Cheng [MSFT]" wrote:
> Hi Brian,
> Welcome to use MSDN Managed Newsgroup!
> From your description, my understanding of this issue is: you want to write
> the consumer web part to connect to the Report Explorer Web part. If I
> misunderstood your concern, please feel free to point it out.
> Based on my knowledge, the Report Explorer Web Part and the Report Viewer
> Web Part use the technical "Connectable Web Part to handle the connections
> between them. So if you want to customize your web part to connect to the
> Report Explorer, you need to implement the ICellConsumer interface.
> Here is a article talk about the technical "Connectable Web Part" and there
> is the sample code for how to implement the interface.
> Creating a Connectable Web Part
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spptsdk/htm
> l/CreateConnectableWP_SV01003714.asp
> Using Reporting Services SharePoint Web Parts in SQL Server 2000 Reporting
> Services Service Pack 2
> http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/webrssp2.mspx
> #EIAA
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> =====================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Hi Brain,
In the Report Explorer Web part, it pass the ReportUrl in the cell variable
in the cellReadyArgs passed in the CellReady EventHandler. And the Report
Viewer get it in the CellReady event. This event fire handled all by Web
Part architecture, and in you scenario, it seems the Report Explorer and
your own Web Part do not connected correctly, you may try to debug the SPS
session to see what these 2 Web Part really does.
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.