is this service well defined?

Dec 15, 2007 at 12:31 PM
Edited Dec 15, 2007 at 6:11 PM
i'm having problems with the client to connect to my new service web to add records in the table SGW_MisServicios of the server. My doubt is, is this well defined?

i created one file in folder IwebCore and called it IWebMisServicios.vb

Namespace DotNetNuke.Modules.IWeb
Public Class IWebMisServicios
Public Shared Function AddMisServicios(ByVal objMisServicios As DotNetNuke.Modules.IWeb.IWEBMisServiciosInfo) As Boolean
SGW.Modules.MisServicios.DataProvider.Instance().AddMisServicios(objMisServicios.PortalID, objMisServicios.MisSerUsuarioID, objMisServicios.MisSerDescripServicio, objMisServicios.MisSerDescripComentarios, objMisServicios.MisSerFecProxFact, objMisServicios.MisSerImpProxFact, objMisServicios.MisSerFormaPago, objMisServicios.MisSer_Periodicidad)
End Function
End Class
End Namespace

Here i'm obtaining one error in my compiler that says Name 'SGW' not declared


In folder InfoClasses i created another file called IwebMisServiciosInfo.vb. is this necessary?

Imports Microsoft.VisualBasic
Namespace DotNetNuke.Modules.IWeb
Public Class IWEBMisServiciosInfo
' local property declarations
Private _PortalID As Integer
Private MisSerID As Int32
Private MisSerUsuarioID As Int32
Private MisSerDescripServicio As String
Private MisSerDescripComentarios As String
Private MisSerFecProxFact As DateTime
Private MisSerImpProxFact As Single
Private MisSerFormaPago As String
Private MisSerPeriodicidad As String
' initialization
Public Sub New()
End Sub
' public properties
Public Property PortalID() As Integer
Return _PortalID
End Get
Set(ByVal Value As Integer)
_PortalID = Value
End Set
End Property
Public Property MisSer_ID() As Int32
Return MisSerID
End Get
Set(ByVal Value As Int32)
MisSerID = Value
End Set
End Property
Public Property MisSer_UsuarioID() As Int32
Return MisSerUsuarioID
End Get
Set(ByVal Value As Int32)
MisSerUsuarioID = Value
End Set
End Property

....and more

End Class
End Namespace

And in the folder IWebMethods i added my metod to update the table MisServicios

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Namespace DotNetNuke.Modules.IWeb

Partial Public Class WebService

<WebMethod(Description:=" AddMisServicios DotNetNuke |IWEB Core| #IWEB Misc# !Portal! "), SoapHeader("IWebCredentials")> _
Public Function AddMisServicios(ByVal PortalID As Integer, ByVal MisSerUsuarioID As Int32, ByVal MisSerDescripServicio As String, ByVal MisSerDescripComentarios As String, ByVal MisSerFecProxFact As DateTime, ByVal MisSerImpProxFact As Single, ByVal MisSerFormaPago As String, ByVal MisSer_Periodicidad As String) As String

Dim objResponse As String = "Error: Unknown Error"

Dim objIWebAuthendication As New IWebAuthendication(IWebCredentials)
If Not objIWebAuthendication.ValidAndAuthorized() Then
Return "Not Authorized"
End If

Dim oMisServicios As New DotNetNuke.Modules.IWeb.IWEBMisServiciosInfo
oMisServicios.PortalID = IWebCredentials.PortalID
oMisServicios.MisSerUsuarioID = MisSerUsuarioID
oMisServicios.MisSerDescripServicio = MisSerDescripServicio
oMisServicios.MisSerDescripComentarios = MisSerDescripComentarios
oMisServicios.MisSerFecProxFact = MisSerFecProxFact
oMisServicios.MisSerImpProxFact = MisSerImpProxFact
oMisServicios.MisSerFormaPago = MisSerFormaPago
oMisServicios.MisSerPeriodicidad = MisSerPeriodicidad
objResponse = "OK"

Catch ex As Exception
objResponse = ex.Message
End Try
' Return objResponse
Return objResponse
End Function
End Class
End Namespace

Since here its correct? i'm having problems with the client to connect to my service web. My doubt is, is this well defined?

i think that all this code can be in only one file it's correct?

Many thanks in advance for your time...

Dec 22, 2007 at 2:38 PM
How is the class that contains this method defined?


The class you indicate in your example is in the
"DotNetNuke.Modules.IWeb" namespace.

What namespace is your "MisServicios" in. Perhaps that is the problem?
Dec 22, 2007 at 6:40 PM
Finally i solved my problem putting the code to insert in database directly in Public Shared Function AddMisServicios in namespace DotNetNuke.Modules.IWeb in file IWebMisServicios.vb