473,554 Members | 3,230 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VS 2005 Com Interop Exception in Web Service

Hi,

I have a service, that runs perfectly when executed outside of the web
service environment. When called as a web service I get the exception
listed below sporadically. A call to the web method may succeed one time and
not another. I cannot find any reason why it would work one time and not
another. The exception occurs every two or three calls to the web method.

The service utilizes a COM component provided by PeopleSoft called a
Component Interface. That COM object then makes calls into a Java library.
Layers to the max I know but it is all I can work with right now till we
upgrade PSoft to a more recent version that has ws-i compliant web services.

To attempt to resolve the issue, I tried opening and closing the connection
to PeopleSoft with each invocation of the web method but that did not resolve
the issue or change the behavior of the problem in any way. I also tried
using ReleaseCOMObjec t but no luck there either. Nothing in the dispose call
has changed the behavior of the problem.

Since I am working with a third party COM object, I do not know much about
the internals of the COM object such as the threading model.

Beyond this specific problem, any general comments regarding my code/usage
are welcomed.

Thank you in advance for your help.
Rich
The exception is:

System.Web.Serv ices.Protocols. SoapException was unhandled
Actor=""
Lang=""
Message="System .Web.Services.P rotocols.SoapEx ception: Server was unable to
process request. ---> System.Runtime. InteropServices .COMException
(0x80010105): The server threw an exception. (Exception from HRESULT:
0x80010105 (RPC_E_SERVERFA ULT))
at System.RuntimeT ype.ForwardCall ToInvokeMember( String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at PeopleSoft_Peop leSoft.CUSTOMER .set_GetHistory Items(Boolean )
at com.hsb.peoples oftservices.Cus tomerDAO..ctor( Session
oComponentInter faceSession) in C:\Documents and Settings\rcolle t\My
Documents\Visua l Studio
2005\Projects\P eopleSoftCompon entInterface\Pe opleSoftCompone ntInterface\Cus tomerDAO.vb:lin e 23
at
com.hsb.peoples oftservices.Cus tomerService.Cr eateOrUpdateCus tomers(SessionC ontext
context, CustomerDTO[] customers) in C:\Documents and Settings\rcolle t\My
Documents\Visua l Studio
2005\Projects\P eopleSoftCompon entInterface\Pe opleSoftCompone ntInterface\Cus tomerService.vb :line 48
--- End of inner exception stack trace ---"
Node=""
Role=""
Source="System. Web.Services"
StackTrace:
at
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.ReadRes ponse(SoapClien tMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.Invoke( String
methodName, Object[] parameters)
at
com.hsb.PeopleS oftCustomerWebs erviceTest.Peop leSoftCustomerS ervice.PeopleSo ftCustomerServi ce.CreateOrUpda teCustomers(Ses sionContext
SessionContext, CustomerDTO[] Customers) in C:\Documents and
Settings\rcolle t\My Documents\Visua l Studio
2005\Projects\P eopleSoftServic e\PeopleSoftCus tomerWebservice Test\Web
References\Peop leSoftCustomerS ervice\Referenc e.vb:line 82
at com.hsb.PeopleS oftCustomerWebs erviceTest.Modu le1.Main() in
C:\Documents and Settings\rcolle t\My Documents\Visua l Studio
2005\Projects\P eopleSoftServic e\PeopleSoftCus tomerWebservice Test\Module1.vb :line 79
at System.AppDomai n.nExecuteAssem bly(Assembly assembly, String[] args)
at System.AppDomai n.ExecuteAssemb ly(String assemblyFile, Evidence
assemblySecurit y, String[] args)
at Microsoft.Visua lStudio.Hosting Process.HostPro c.RunUsersAssem bly()
at System.Threadin g.ThreadHelper. ThreadStart_Con text(Object state)
at System.Threadin g.ExecutionCont ext.Run(Executi onContext
executionContex t, ContextCallback callback, Object state)
at System.Threadin g.ThreadHelper. ThreadStart()

-------------------------------------------------------------
The code calling the web service is below. The Web Service can be easily
replaced with the native service by swapping the imports statements and
changing the type in the "using service as ....." statement. The web
service and the native service share the same service interface which is also
included below.

Imports com.hsb.PeopleS oftCustomerWebs erviceTest.Peop leSoftCustomerS ervice
'Imports com.hsb.peoples oftservices
Imports System.Collecti ons.Generic

Module Module1
Sub Main()
Dim customers As New List(Of CustomerDTO)
Dim addresses As New List(Of CustomerAddress DTO)
Dim customer As New CustomerDTO
Dim address As New CustomerAddress DTO
Dim context As New SessionContext
Dim szCustomerNumbe r As String = ""
With context
.UserName = "username"
.Password = "password"
.Server = "//APPSRVD:9070"
.ThrowException s = True
End With
With address
.Address1 = "Ad 1"
.Address2 = "Ad 2"
.Address3 = "Ad 3"
.Address4 = "Ad 4"
.AlternateName = "Alt Name"
.City = "Waterbury"
.State = "CT"
.PostalCode = "06708"
.CountryCode3 = "USA"
.Description = "Descriptio n"
.IsTypeBilling = True
.IsTypeLegal = True
.IsTypeShipTo = True
.IsTypeSoldTo = True
.IsTypeCorrespo ndence = True
.IsTypePrimaryB illing = True
.IsTypePrimaryL egal = True
.IsTypePrimaryS hipTo = True
.IsTypePrimaryS oldTo = True
.IsModified = False
End With
addresses.Add(a ddress)
Dim address2 As CustomerAddress DTO = CType(address.C lone(),
CustomerAddress DTO)
address2.Addres s1 = "second address"
With address2
.IsTypePrimaryB illing = False
.IsTypePrimaryL egal = False
.IsTypePrimaryS hipTo = False
.IsTypePrimaryS oldTo = False
.IsModified = False
End With
addresses.Add(a ddress2)
With customer
.Name = "RC Test " + System.DateTime .Now.ToString
.SetID = "SHARE"
.Addresses = addresses.ToArr ay
'Web Service Proxy Data Contracts do not expose public
constants. The actual value must be used.
'.TypeCode = CustomerDTO.TYP ECODE_FRONTEND
.TypeCode = "5"
.IsModified = False
End With
customers.Add(c ustomer)
Dim customer2 As CustomerDTO
customer2 = CType(customer. Clone(), CustomerDTO)
customer2.Name = "RC Test2 " + System.DateTime .Now.ToString
With customer2.Addre sses(0)
.SequenceNumber = 0
.IsModified = False
End With
With customer2.Addre sses(1)
.SequenceNumber = 0
.IsModified = False
End With
customer2.IsMod ified = False
customers.Add(c ustomer2)
'The service is disposable due to usage of COM Interop so use a
using block so that resources
'are properly disposed of (disconnected in this case).
Using service As PeopleSoftCusto merService.Peop leSoftCustomerS ervice
= My.WebServices. PeopleSoftCusto merService
Dim match As New System.Predicat e(Of CustomerDTO)(Ad dressOf
hasError)
Dim updatedCustomer s() As CustomerDTO =
service.CreateO rUpdateCustomer s(context, customers.ToArr ay)
If (updatedCustome rs.Length > 0) Then
If (Array.FindAll( Of CustomerDTO)(up datedCustomers,
match).Length > 0) Then Stop
szCustomerNumbe r = updatedCustomer s(0).Number
With updatedCustomer s(0)
.Name = "Changed Name"
.IsModified = False
.Addresses(0).A ddress1 = "ad1b"
.Addresses(0).I sModified = False
.Addresses(1).A ddress1 = "ad1b"
.Addresses(1).I sModified = False
End With
End If
updatedCustomer s = service.CreateO rUpdateCustomer s(context,
updatedCustomer s)
If (Array.FindAll( Of CustomerDTO)(up datedCustomers,
match).Length > 0) Then Stop
address = CType(address.C lone, CustomerAddress DTO)
With address
.SequenceNumber = 0
.Address1 = "third address "
.IsModified = False
End With
addresses = New List(Of CustomerAddress DTO)
addresses.Add(a ddress)
customer = New CustomerDTO()
With customer
.Number = szCustomerNumbe r
.SetID = "SHARE"
.IsModified = False
.IsDirty = False
.Addresses = addresses.ToArr ay
End With
customers = New List(Of CustomerDTO)
customers.Add(c ustomer)
updatedCustomer s = service.CreateO rUpdateCustomer s(context,
customers.ToArr ay)
End Using
End Sub

Private Function hasError(ByVal value As CustomerDTO) As Boolean
If Not value.DTOExcept ion Is Nothing Then
hasError = True
End If
End Function
End Module
-------------------------------------------------------
Service Interface

Imports System.Web.Serv ices
Imports System.Web.Serv ices.Protocols
Imports System.Web.Serv ices.WsiProfile s
Imports System.Xml.Seri alization

<WebServiceBind ing(name:="Cust omerService",
namespace:="htt p://hsb.com/peoplesoft", ConformsTo:=Bas icProfile1_1)> _
Public Interface ICustomerServic e
<WebMethod(Desc ription:="Creat es or updates customers and their
addresses in PeopleSoft. New Customers and Addresses are returned so that
their key values (CustomerID or Sequence Number) can be retrieved. The
instance guid of the DTO's can be used to create an identifier for matching
up returned customers/addresses with the new customers or addresses that were
submitted.")> _
Function CreateOrUpdateC ustomers(ByVal SessionContext As SessionContext,
ByVal Customers() As CustomerDTO) As CustomerDTO()
Function CreateOrUpdateC ustomers(ByVal SessionContext As
ISessionContext , ByVal Customers() As ICustomerDTO) As ICustomerDTO()
Function CreateOrUpdateC ustomers(ByVal SessionContext As
ISessionContext , ByVal Customer As ICustomerDTO) As ICustomerDTO
End Interface

---------------------------------------------------------------
Service Implementation. In this particular version, I have attempted to
resolve the issue by connecting and disconnecting (through self calling of
dispose) during each invocation of the web method.

Imports System.Web.Serv ices
Imports System.Runtime. InteropServices

<WebService(nam e:="PeopleSoftC ustomerService" ,
namespace:="htt p://hsb.com/PeopleSoftCusto merService", Description:="C reates
or updates PeopleSoft Customers and their Addresses")> _
Public Class CustomerService
Implements ICustomerServic e
Implements IDisposable
Private m_oCISession As PeopleSoft_Peop leSoft.Session
Private m_isConnected As Boolean

Public Sub New()

End Sub

Public Sub dispose() Implements IDisposable.Dis pose
If (m_isConnected And Not m_oCISession Is Nothing) Then
Try
m_oCISession.Di sconnect()
Catch ex As Exception
'TODO: log this exception but otherwise there is nothing
that can be done with it at this point.
Finally
m_isConnected = False
'explicitly release the underlying COM object to improve
performance
Marshal.Release ComObject(m_oCI Session)
m_oCISession = Nothing
'Don't call finalize on this object to improve performance.
GC.SuppressFina lize(Me)
End Try
End If
End Sub

Public Function CreateOrUpdateC ustomers(ByVal context As
ISessionContext , ByVal customer As ICustomerDTO) As ICustomerDTO Implements
ICustomerServic e.CreateOrUpdat eCustomers
Call Me.CreateSessio n(context)
Dim oPSoftCustomerD AO As New CustomerDAO(Me. GetSession)
Return oPSoftCustomerD AO.CreateOrUpda teCustomer(cust omer,
context.ThrowEx ceptions)
End Function

Public Function CreateOrUpdateC ustomers(ByVal context As
ISessionContext , ByVal customers() As ICustomerDTO) As ICustomerDTO()
Implements ICustomerServic e.CreateOrUpdat eCustomers
Call Me.CreateSessio n(context)
Dim oPSoftCustomerD AO As New CustomerDAO(Me. GetSession)
Return oPSoftCustomerD AO.CreateOrUpda teCustomers(Cus tomers,
context.ThrowEx ceptions)
End Function

Public Function CreateOrUpdateC ustomers(ByVal context As SessionContext,
ByVal customers() As CustomerDTO) As CustomerDTO() Implements
ICustomerServic e.CreateOrUpdat eCustomers
Call Me.CreateSessio n(context)
Dim oPSOftCustomerD AO As New CustomerDAO(Me. GetSession)
Dim customersReturn ed() As ICustomerDTO =
oPSOftCustomerD AO.CreateOrUpda teCustomers(CTy pe(customers, ICustomerDTO()) ,
context.ThrowEx ceptions)
Me.dispose()
Dim customersToRetu rn() As CustomerDTO
customersToRetu rn =
System.Array.Cr eateInstance(Ge tType(CustomerD TO), customersReturn ed.Length)
customersReturn ed.CopyTo(custo mersToReturn, 0)
Return customersToRetu rn
End Function

Private Sub CreateSession(B yVal context As ISessionContext )
If (m_oCISession Is Nothing) Then
m_oCISession = New PeopleSoft_Peop leSoft.Session
If Not (m_oCISession.C onnect(1, context.Server,
context.UserNam e, context.Passwor d, 0)) Then
Throw New PeopleSoftServi ceException("Co uld not connect to
server " + context.Server + " with username " + context.UserNam e)
End If
m_isConnected = True
End If
End Sub

Private Function GetSession() As PeopleSoft_Peop leSoft.Session
Return m_oCISession
End Function
End Class

Jun 28 '06 #1
2 4938
Dear Customer,

Based on my understanding, the COM object works in other environment than
the web service environment.

As you said, since this is a third party COM object, we can not make sure
what is the requirement by the COM object. To troubleshoot the issue, we
need the code of COM to see what may occur inside the object when the
exception occur.
I suggest you contact the COM Object development directly for detailed
information.

So far based on my knowledge, you may have a try to put the COM Object into
COM+ which may help to resolve the problem.
Or you may try to make a simple test reproduce COM object, e.g. a simple
com object which will return just a string and call it many times from you
web service to see if the problem occur, so that we will know if there is
any problem with the Web Service.

Thanks for your understanding!
Best regards,

Peter Huang

Microsoft Online Community 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.

Jun 29 '06 #2
Hi,

I have a service, that runs perfectly when executed outside of the web
service environment. When called as a web service I get the exception
listed below sporadically. A call to the web method may succeed one time and
not another. I cannot find any reason why it would work one time and not
another. The exception occurs every two or three calls to the web method.

The service utilizes a COM component provided by PeopleSoft called a
Component Interface. That COM object then makes calls into a Java library.
Layers to the max I know but it is all I can work with right now till we
upgrade PSoft to a more recent version that has ws-i compliant web services.

To attempt to resolve the issue, I tried opening and closing the connection
to PeopleSoft with each invocation of the web method but that did not resolve
the issue or change the behavior of the problem in any way. I also tried
using ReleaseCOMObjec t but no luck there either. Nothing in the dispose call
has changed the behavior of the problem.

Since I am working with a third party COM object, I do not know much about
the internals of the COM object such as the threading model.

Beyond this specific problem, any general comments regarding my code/usage
are welcomed.

Thank you in advance for your help.
Rich
The exception is:

System.Web.Serv ices.Protocols. SoapException was unhandled
Actor=""
Lang=""
Message="System .Web.Services.P rotocols.SoapEx ception: Server was unable to
process request. ---System.Runtime. InteropServices .COMException
(0x80010105): The server threw an exception. (Exception from HRESULT:
0x80010105 (RPC_E_SERVERFA ULT))
at System.RuntimeT ype.ForwardCall ToInvokeMember( String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at PeopleSoft_Peop leSoft.CUSTOMER .set_GetHistory Items(Boolean )
at com.hsb.peoples oftservices.Cus tomerDAO..ctor( Session
oComponentInter faceSession) in C:\Documents and Settings\rcolle t\My
Documents\Visua l Studio
2005\Projects\P eopleSoftCompon entInterface\Pe opleSoftCompone ntInterface\Cus tomerDAO.vb:lin e 23
at
com.hsb.peoples oftservices.Cus tomerService.Cr eateOrUpdateCus tomers(SessionC ontext
context, CustomerDTO[] customers) in C:\Documents and Settings\rcolle t\My
Documents\Visua l Studio
2005\Projects\P eopleSoftCompon entInterface\Pe opleSoftCompone ntInterface\Cus tomerService.vb :line 48
--- End of inner exception stack trace ---"
Node=""
Role=""
Source="System. Web.Services"
StackTrace:
at
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.ReadRes ponse(SoapClien tMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.Invoke( String
methodName, Object[] parameters)
at
com.hsb.PeopleS oftCustomerWebs erviceTest.Peop leSoftCustomerS ervice.PeopleSo ftCustomerServi ce.CreateOrUpda teCustomers(Ses sionContext
SessionContext, CustomerDTO[] Customers) in C:\Documents and
Settings\rcolle t\My Documents\Visua l Studio
2005\Projects\P eopleSoftServic e\PeopleSoftCus tomerWebservice Test\Web
References\Peop leSoftCustomerS ervice\Referenc e.vb:line 82
at com.hsb.PeopleS oftCustomerWebs erviceTest.Modu le1.Main() in
C:\Documents and Settings\rcolle t\My Documents\Visua l Studio
2005\Projects\P eopleSoftServic e\PeopleSoftCus tomerWebservice Test\Module1.vb :line 79
at System.AppDomai n.nExecuteAssem bly(Assembly assembly, String[] args)
at System.AppDomai n.ExecuteAssemb ly(String assemblyFile, Evidence
assemblySecurit y, String[] args)
at Microsoft.Visua lStudio.Hosting Process.HostPro c.RunUsersAssem bly()
at System.Threadin g.ThreadHelper. ThreadStart_Con text(Object state)
at System.Threadin g.ExecutionCont ext.Run(Executi onContext
executionContex t, ContextCallback callback, Object state)
at System.Threadin g.ThreadHelper. ThreadStart()

-------------------------------------------------------------
The code calling the web service is below. The Web Service can be easily
replaced with the native service by swapping the imports statements and
changing the type in the "using service as ....." statement. The web
service and the native service share the same service interface which is also
included below.

Imports com.hsb.PeopleS oftCustomerWebs erviceTest.Peop leSoftCustomerS ervice
'Imports com.hsb.peoples oftservices
Imports System.Collecti ons.Generic

Module Module1
Sub Main()
Dim customers As New List(Of CustomerDTO)
Dim addresses As New List(Of CustomerAddress DTO)
Dim customer As New CustomerDTO
Dim address As New CustomerAddress DTO
Dim context As New SessionContext
Dim szCustomerNumbe r As String = ""
With context
.UserName = "username"
.Password = "password"
.Server = "//APPSRVD:9070"
.ThrowException s = True
End With
With address
.Address1 = "Ad 1"
.Address2 = "Ad 2"
.Address3 = "Ad 3"
.Address4 = "Ad 4"
.AlternateName = "Alt Name"
.City = "Waterbury"
.State = "CT"
.PostalCode = "06708"
.CountryCode3 = "USA"
.Description = "Descriptio n"
.IsTypeBilling = True
.IsTypeLegal = True
.IsTypeShipTo = True
.IsTypeSoldTo = True
.IsTypeCorrespo ndence = True
.IsTypePrimaryB illing = True
.IsTypePrimaryL egal = True
.IsTypePrimaryS hipTo = True
.IsTypePrimaryS oldTo = True
.IsModified = False
End With
addresses.Add(a ddress)
Dim address2 As CustomerAddress DTO = CType(address.C lone(),
CustomerAddress DTO)
address2.Addres s1 = "second address"
With address2
.IsTypePrimaryB illing = False
.IsTypePrimaryL egal = False
.IsTypePrimaryS hipTo = False
.IsTypePrimaryS oldTo = False
.IsModified = False
End With
addresses.Add(a ddress2)
With customer
.Name = "RC Test " + System.DateTime .Now.ToString
.SetID = "SHARE"
.Addresses = addresses.ToArr ay
'Web Service Proxy Data Contracts do not expose public
constants. The actual value must be used.
'.TypeCode = CustomerDTO.TYP ECODE_FRONTEND
.TypeCode = "5"
.IsModified = False
End With
customers.Add(c ustomer)
Dim customer2 As CustomerDTO
customer2 = CType(customer. Clone(), CustomerDTO)
customer2.Name = "RC Test2 " + System.DateTime .Now.ToString
With customer2.Addre sses(0)
.SequenceNumber = 0
.IsModified = False
End With
With customer2.Addre sses(1)
.SequenceNumber = 0
.IsModified = False
End With
customer2.IsMod ified = False
customers.Add(c ustomer2)
'The service is disposable due to usage of COM Interop so use a
using block so that resources
'are properly disposed of (disconnected in this case).
Using service As PeopleSoftCusto merService.Peop leSoftCustomerS ervice
= My.WebServices. PeopleSoftCusto merService
Dim match As New System.Predicat e(Of CustomerDTO)(Ad dressOf
hasError)
Dim updatedCustomer s() As CustomerDTO =
service.CreateO rUpdateCustomer s(context, customers.ToArr ay)
If (updatedCustome rs.Length 0) Then
If (Array.FindAll( Of CustomerDTO)(up datedCustomers,
match).Length 0) Then Stop
szCustomerNumbe r = updatedCustomer s(0).Number
With updatedCustomer s(0)
.Name = "Changed Name"
.IsModified = False
.Addresses(0).A ddress1 = "ad1b"
.Addresses(0).I sModified = False
.Addresses(1).A ddress1 = "ad1b"
.Addresses(1).I sModified = False
End With
End If
updatedCustomer s = service.CreateO rUpdateCustomer s(context,
updatedCustomer s)
If (Array.FindAll( Of CustomerDTO)(up datedCustomers,
match).Length 0) Then Stop
address = CType(address.C lone, CustomerAddress DTO)
With address
.SequenceNumber = 0
.Address1 = "third address "
.IsModified = False
End With
addresses = New List(Of CustomerAddress DTO)
addresses.Add(a ddress)
customer = New CustomerDTO()
With customer
.Number = szCustomerNumbe r
.SetID = "SHARE"
.IsModified = False
.IsDirty = False
.Addresses = addresses.ToArr ay
End With
customers = New List(Of CustomerDTO)
customers.Add(c ustomer)
updatedCustomer s = service.CreateO rUpdateCustomer s(context,
customers.ToArr ay)
End Using
End Sub

Private Function hasError(ByVal value As CustomerDTO) As Boolean
If Not value.DTOExcept ion Is Nothing Then
hasError = True
End If
End Function
End Module
-------------------------------------------------------
Service Interface

Imports System.Web.Serv ices
Imports System.Web.Serv ices.Protocols
Imports System.Web.Serv ices.WsiProfile s
Imports System.Xml.Seri alization

<WebServiceBind ing(name:="Cust omerService",
namespace:="htt p://hsb.com/peoplesoft", ConformsTo:=Bas icProfile1_1)_
Public Interface ICustomerServic e
<WebMethod(Desc ription:="Creat es or updates customers and their
addresses in PeopleSoft. New Customers and Addresses are returned so that
their key values (CustomerID or Sequence Number) can be retrieved. The
instance guid of the DTO's can be used to create an identifier for matching
up returned customers/addresses with the new customers or addresses that were
submitted.")_
Function CreateOrUpdateC ustomers(ByVal SessionContext As SessionContext,
ByVal Customers() As CustomerDTO) As CustomerDTO()
Function CreateOrUpdateC ustomers(ByVal SessionContext As
ISessionContext , ByVal Customers() As ICustomerDTO) As ICustomerDTO()
Function CreateOrUpdateC ustomers(ByVal SessionContext As
ISessionContext , ByVal Customer As ICustomerDTO) As ICustomerDTO
End Interface

---------------------------------------------------------------
Service Implementation. In this particular version, I have attempted to
resolve the issue by connecting and disconnecting (through self calling of
dispose) during each invocation of the web method.

Imports System.Web.Serv ices
Imports System.Runtime. InteropServices

<WebService(nam e:="PeopleSoftC ustomerService" ,
namespace:="htt p://hsb.com/PeopleSoftCusto merService", Description:="C reates
or updates PeopleSoft Customers and their Addresses")_
Public Class CustomerService
Implements ICustomerServic e
Implements IDisposable
Private m_oCISession As PeopleSoft_Peop leSoft.Session
Private m_isConnected As Boolean

Public Sub New()

End Sub

Public Sub dispose() Implements IDisposable.Dis pose
If (m_isConnected And Not m_oCISession Is Nothing) Then
Try
m_oCISession.Di sconnect()
Catch ex As Exception
'TODO: log this exception but otherwise there is nothing
that can be done with it at this point.
Finally
m_isConnected = False
'explicitly release the underlying COM object to improve
performance
Marshal.Release ComObject(m_oCI Session)
m_oCISession = Nothing
'Don't call finalize on this object to improve performance.
GC.SuppressFina lize(Me)
End Try
End If
End Sub

Public Function CreateOrUpdateC ustomers(ByVal context As
ISessionContext , ByVal customer As ICustomerDTO) As ICustomerDTO Implements
ICustomerServic e.CreateOrUpdat eCustomers
Call Me.CreateSessio n(context)
Dim oPSoftCustomerD AO As New CustomerDAO(Me. GetSession)
Return oPSoftCustomerD AO.CreateOrUpda teCustomer(cust omer,
context.ThrowEx ceptions)
End Function

Public Function CreateOrUpdateC ustomers(ByVal context As
ISessionContext , ByVal customers() As ICustomerDTO) As ICustomerDTO()
Implements ICustomerServic e.CreateOrUpdat eCustomers
Call Me.CreateSessio n(context)
Dim oPSoftCustomerD AO As New CustomerDAO(Me. GetSession)
Return oPSoftCustomerD AO.CreateOrUpda teCustomers(Cus tomers,
context.ThrowEx ceptions)
End Function

Public Function CreateOrUpdateC ustomers(ByVal context As SessionContext,
ByVal customers() As CustomerDTO) As CustomerDTO() Implements
ICustomerServic e.CreateOrUpdat eCustomers
Call Me.CreateSessio n(context)
Dim oPSOftCustomerD AO As New CustomerDAO(Me. GetSession)
Dim customersReturn ed() As ICustomerDTO =
oPSOftCustomerD AO.CreateOrUpda teCustomers(CTy pe(customers, ICustomerDTO()) ,
context.ThrowEx ceptions)
Me.dispose()
Dim customersToRetu rn() As CustomerDTO
customersToRetu rn =
System.Array.Cr eateInstance(Ge tType(CustomerD TO), customersReturn ed.Length)
customersReturn ed.CopyTo(custo mersToReturn, 0)
Return customersToRetu rn
End Function

Private Sub CreateSession(B yVal context As ISessionContext )
If (m_oCISession Is Nothing) Then
m_oCISession = New PeopleSoft_Peop leSoft.Session
If Not (m_oCISession.C onnect(1, context.Server,
context.UserNam e, context.Passwor d, 0)) Then
Throw New PeopleSoftServi ceException("Co uld not connect to
server " + context.Server + " with username " + context.UserNam e)
End If
m_isConnected = True
End If
End Sub

Private Function GetSession() As PeopleSoft_Peop leSoft.Session
Return m_oCISession
End Function
End Class
Hi Peter,
I have an application developed in ASP.NET 2.0 running fine in the test system (Win 2k, IIS 5.0). The application calls a Win32 COM dll.

Although when we deployed the application in the production system runnin on Windows 2003 (IIS 6.0), it gave me an error

The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFA ULT))

Any help on how I can configure the IIS 6.0 for it to work?

Thanks
Adnan

Posted from http://www.topxml.com/renntp using reNNTP: the website based NNTP reader.
Aug 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2366
by: andrew lowe | last post by:
Hi there, We have to use a com interop library generated by tlbimp, where the orginal com object is written in uniface (a compuware language). The method we use and have the problem with has the following signature: int exec( string servicetorun, string inparameters,
0
2224
by: Chris V | last post by:
Hello, I'm having problems sending MAPI Mail from an ASP.NET applcation (in VB) (which worked fine in traditional asp) When run on our test server, it returns an COMException (0x80010106): ]] exception from MAPI. (from the global.asa when trying to create MAPI session I get a .net exception "Cannot change thread mode after it is set")
0
2471
by: MarkD | last post by:
I have an ASP.NET (VB.NET) application that calls all VB6 COM DLL via Interop. The DLL uses functionality contained in a Custom OCX Control (Also VB6) that in turn contains a standard TreeView control. The Custom OCX is not used for visual purposes, but has some functionality that we require (hence hosting an OCX in a DLL). Everything...
1
3574
by: Tory Collum | last post by:
My code works as a VB.NET executable file. So I'm trying to "adapt" it to a ..NET XML Web Service. As a VB.NET file, I used Microsoft.Office.Core as the reference, and everything was fine, but when I try to do the same thing as an XML Web Service, VS.NET says my syntax is not defined. Can anyone tell me why the syntax is not defined? ...
1
3376
by: SQLJunkie | last post by:
Hi, I have installed SQL 2005 RTM on a new server and I keep getting this error (described below) quite frequently. Was wondering if anyone has a clue on what's happening here. I tried googling but no success! This generally happens when I am browsing the tree in Object explorer in SQL 2005 Management Studio. I can be doing anything -...
7
10943
by: R Reyes | last post by:
Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? I'm trying to manipulate MS Word from my Web Form application and I can't get passed this screen below. Please help, thanks in advance... Configuration Error Description: An error occurred during the processing of a configuration...
0
1343
by: bosky101 | last post by:
hi, im using VS 2005 ,and working on a windows applicaiton that opens powerpoint files. I ahve stumbled upon the folowing problems : 1. no pIA 's for office 2000 . what do i do ? 2. i managed to use ildasm to try to generate my new powerpoint dll's . as follows in VS command prompt of the projects bin/debug folder :
2
4737
by: RonS | last post by:
I am attempting to use a COM Interop inside my .NET Web Service. This same COM Interop works just fine in a VB.NET application. I've followed the guidance given in http://msdn2.microsoft.com/en-us/library/ms996450.aspx but to no avail. When I execute the web method that instantiates the COM Interop, I receive the following error: ...
1
3162
by: Reg | last post by:
Hello, I have a WCF Web Service using wsHttpDualBinding because I need a callback to Java client. I read Mr. A.Gupta's blog that if WCF Service uses wsHttpDualBinding for interop working is not guaranteed. I also tried to config wsHttpDualBinding in WCF Service Config file as follows:
0
7596
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7798
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8039
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3545
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1130
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
838
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.