dotnet xml:
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 ReleaseCOMObject 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.Services.Protocols.SoapException was unhandled
Actor=""
Lang=""
Message="System.Web.Services.Protocols.SoapException: Server was unable to
process request. ---> System.Runtime.InteropServices.COMException
(0x80010105): The server threw an exception. (Exception from HRESULT:
0x80010105 (RPC_E_SERVERFAULT))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at PeopleSoft_PeopleSoft.CUSTOMER.set_GetHistoryItems(Boolean )
at com.hsb.peoplesoftservices.CustomerDAO..ctor(Session
oComponentInterfaceSession) in C:\Documents and Settings\rcollet\My
Documents\Visual Studio
2005\Projects\PeopleSoftComponentInterface\PeopleSoftComponentInterface\CustomerDAO.vb:line 23
at
com.hsb.peoplesoftservices.CustomerService.CreateOrUpdateCustomers(SessionContext
context, CustomerDTO[] customers) in C:\Documents and Settings\rcollet\My
Documents\Visual Studio
2005\Projects\PeopleSoftComponentInterface\PeopleSoftComponentInterface\CustomerService.vb:line 48
--- End of inner exception stack trace ---"
Node=""
Role=""
Source="System.Web.Services"
StackTrace:
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at
com.hsb.PeopleSoftCustomerWebserviceTest.PeopleSoftCustomerService.PeopleSoftCustomerService.CreateOrUpdateCustomers(SessionContext
SessionContext, CustomerDTO[] Customers) in C:\Documents and
Settings\rcollet\My Documents\Visual Studio
2005\Projects\PeopleSoftService\PeopleSoftCustomerWebserviceTest\Web
References\PeopleSoftCustomerService\Reference.vb:line 82
at com.hsb.PeopleSoftCustomerWebserviceTest.Module1.Main() in
C:\Documents and Settings\rcollet\My Documents\Visual Studio
2005\Projects\PeopleSoftService\PeopleSoftCustomerWebserviceTest\Module1.vb:line 79
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.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.PeopleSoftCustomerWebserviceTest.PeopleSoftCustomerService
'Imports com.hsb.peoplesoftservices
Imports System.Collections.Generic
Module Module1
Sub Main()
Dim customers As New List(Of CustomerDTO)
Dim addresses As New List(Of CustomerAddressDTO)
Dim customer As New CustomerDTO
Dim address As New CustomerAddressDTO
Dim context As New SessionContext
Dim szCustomerNumber As String = ""
With context
.UserName = "username"
.Password = "password"
.Server = "//APPSRVD:9070"
.ThrowExceptions = 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 = "Description"
.IsTypeBilling = True
.IsTypeLegal = True
.IsTypeShipTo = True
.IsTypeSoldTo = True
.IsTypeCorrespondence = True
.IsTypePrimaryBilling = True
.IsTypePrimaryLegal = True
.IsTypePrimaryShipTo = True
.IsTypePrimarySoldTo = True
.IsModified = False
End With
addresses.Add(address)
Dim address2 As CustomerAddressDTO = CType(address.Clone(),
CustomerAddressDTO)
address2.Address1 = "second address"
With address2
.IsTypePrimaryBilling = False
.IsTypePrimaryLegal = False
.IsTypePrimaryShipTo = False
.IsTypePrimarySoldTo = False
.IsModified = False
End With
addresses.Add(address2)
With customer
.Name = "RC Test " + System.DateTime.Now.ToString
.SetID = "SHARE"
.Addresses = addresses.ToArray
'Web Service Proxy Data Contracts do not expose public
constants. The actual value must be used.
'.TypeCode = CustomerDTO.TYPECODE_FRONTEND
.TypeCode = "5"
.IsModified = False
End With
customers.Add(customer)
Dim customer2 As CustomerDTO
customer2 = CType(customer.Clone(), CustomerDTO)
customer2.Name = "RC Test2 " + System.DateTime.Now.ToString
With customer2.Addresses(0)
.SequenceNumber = 0
.IsModified = False
End With
With customer2.Addresses(1)