January 14, 2009 at 2:39 am
I am trying to calling a web service in using script component but getting Error 30002: Type 'Microsoft.Vsa.VsaModule' is not defined when compiling
here is my code:
in Script Main Class:
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Public Class ScriptMain
Public Sub Main()
Dim rs As New Microsoft.SqlServer.ReportingServices2005.Service
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
rs.TrackingNumber()
End Sub
End Class
'And following is code on proxy class
Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization
Namespace Microsoft.SqlServer.ReportingServices2005
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42"), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Web.Services.WebServiceBindingAttribute(Name:="ServiceSoap", [Namespace]:="http://tempuri.org/")> _
Partial Public Class Service
Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
Public TrackingNumberOperationCompleted As System.Threading.SendOrPostCallback
Public Sub New()
MyBase.New()
envName = "LOCALDEV"
Select Case envName
Case Is = "Dev"
Me.Url = "http://m1waca0021/Reports$ODRDEV/ReportService2005.asmx"
Case Is = "QA"
Me.Url = "http://localhost/webNew/service.asmx"
Case Is = "PROD"
Me.Url = "http://msilsa0161/ReportsODR/ReportService2005.asmx"
Case Is = "LOCALDEV"
Me.Url = "http://localhost/webNew/service.asmx"
Case Is = Nothing
Me.Url = Nothing
End Select
End Sub
'''
Public Event TrackingNumberCompleted As TrackingNumberCompletedEventHandler
'''
_
Public Function TrackingNumber() As String
Dim results() As Object = Me.Invoke("TrackingNumber", New Object(-1) {})
Return CType(results(0), String)
End Function
'''
Public Function BeginTrackingNumber(ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult
Return Me.BeginInvoke("TrackingNumber", New Object(-1) {}, callback, asyncState)
End Function
'''
Public Function EndTrackingNumber(ByVal asyncResult As System.IAsyncResult) As String
Dim results() As Object = Me.EndInvoke(asyncResult)
Return CType(results(0), String)
End Function
'''
Public Overloads Sub TrackingNumberAsync()
Me.TrackingNumberAsync(Nothing)
End Sub
'''
Public Overloads Sub TrackingNumberAsync(ByVal userState As Object)
If (Me.TrackingNumberOperationCompleted Is Nothing) Then
Me.TrackingNumberOperationCompleted = AddressOf Me.OnTrackingNumberOperationCompleted
End If
Me.InvokeAsync("TrackingNumber", New Object(-1) {}, Me.TrackingNumberOperationCompleted, userState)
End Sub
Private Sub OnTrackingNumberOperationCompleted(ByVal arg As Object)
If (Not (Me.TrackingNumberCompletedEvent) Is Nothing) Then
Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg, System.Web.Services.Protocols.InvokeCompletedEventArgs)
RaiseEvent TrackingNumberCompleted(Me, New TrackingNumberCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))
End If
End Sub
'''
Public Shadows Sub CancelAsync(ByVal userState As Object)
MyBase.CancelAsync(userState)
End Sub
End Class
'''
_
Public Delegate Sub TrackingNumberCompletedEventHandler(ByVal sender As Object, ByVal e As TrackingNumberCompletedEventArgs)
'''
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42"), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code")> _
Partial Public Class TrackingNumberCompletedEventArgs
Inherits System.ComponentModel.AsyncCompletedEventArgs
Private results() As Object
Friend Sub New(ByVal results() As Object, ByVal exception As System.Exception, ByVal cancelled As Boolean, ByVal userState As Object)
MyBase.New(exception, cancelled, userState)
Me.results = results
End Sub
Public ReadOnly Property Result() As String
Get
Me.RaiseExceptionIfNecessary()
Return CType(Me.results(0), String)
End Get
End Property
End Class
End Namespace
''''''''''''''''
my proxy class file name is Service.vb
please help anyone
Thanks
Anoop
February 15, 2010 at 9:36 am
Did you ever get an answer to this? I am facing the same issue.
February 15, 2010 at 10:31 am
Brian Daul (2/15/2010)
Did you ever get an answer to this? I am facing the same issue.
What do you mean you are having same problem? there are at least three things wrong with that code so post your relevant code.
Kind regards,
Gift Peddie
February 15, 2010 at 10:44 am
In the original post the person was having trouble calling a web service from a Script Component. I am also having the same trouble. I have created a proxy for the web service and added its a module in the Script Component. When I try to run it it blows up with a multitude of problems. If I could get some insight as to how to properly call a web service through a script component I would be grateful.
February 15, 2010 at 10:50 am
Brian Daul (2/15/2010)
In the original post the person was having trouble calling a web service from a Script Component. I am also having the same trouble. I have created a proxy for the web service and added its a module in the Script Component. When I try to run it it blows up with a multitude of problems. If I could get some insight as to how to properly call a web service through a script component I would be grateful.
Web service is XML so your script component must be passing XML which means you may need to use IXMLSerializable which lets you decide how the XML is serialized.
Kind regards,
Gift Peddie
February 15, 2010 at 11:05 am
Brian Daul (2/15/2010)
In the original post the person was having trouble calling a web service from a Script Component. I am also having the same trouble. I have created a proxy for the web service and added its a module in the Script Component. When I try to run it it blows up with a multitude of problems. If I could get some insight as to how to properly call a web service through a script component I would be grateful.
Here is an article here with the mechanics of how to call web service from a script component.
http://www.sqlservercentral.com/articles/Integration+Services+%28SSIS%29/61360/
Kind regards,
Gift Peddie
February 15, 2010 at 11:39 am
Thank you. I will give it a try.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply