TryHandleWebMethodException Method (Exception, SoapHttpClientProtocol)
Handles SoapExceptions and WebExceptions raised from a Web service method call.
Namespace: Microsoft.CommerceServer
Assembly: Microsoft.CommerceServer.CrossTierTypes (in Microsoft.CommerceServer.CrossTierTypes.dll)
Syntax
'Declaration
Public Function TryHandleWebMethodException ( _
ex As Exception, _
serviceProxy As SoapHttpClientProtocol _
) As AgentExceptionHandlerResult
'Usage
Dim instance As ServiceAgent
Dim ex As Exception
Dim serviceProxy As SoapHttpClientProtocol
Dim returnValue As AgentExceptionHandlerResult
returnValue = instance.TryHandleWebMethodException(ex, _
serviceProxy)
public AgentExceptionHandlerResult TryHandleWebMethodException(
Exception ex,
SoapHttpClientProtocol serviceProxy
)
public:
AgentExceptionHandlerResult TryHandleWebMethodException(
Exception^ ex,
SoapHttpClientProtocol^ serviceProxy
)
public function TryHandleWebMethodException(
ex : Exception,
serviceProxy : SoapHttpClientProtocol
) : AgentExceptionHandlerResult
Parameters
- ex
Type: System..::.Exception
The exception object that should be handled.
- serviceProxy
Type: System.Web.Services.Protocols..::.SoapHttpClientProtocol
The Web service proxy object.
Return Value
Type: Microsoft.CommerceServer..::.AgentExceptionHandlerResult
A status code indicating to the caller whether the ServiceAgent object handled the exception, and if so, whether the operation that resulted in the exception should be aborted or retried. It is also possible that this method raises a different exception or maps the exception to a new exception type.
Remarks
The key service provided by the ServiceAgent class is handling of exceptions in a consistent manner. Working together with server-side methods, this permits exceptions that were raised by the Web service to be transmitted to the client as a SoapException and then mapped back to the original exception type by the agent and re-raised. This method also works to handle authentication-related WebExceptions.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.