Partager via


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

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

See Also

Reference

ServiceAgent Class

ServiceAgent Members

TryHandleWebMethodException Overload

Microsoft.CommerceServer Namespace