Website and Service communication

HoneyMG 1 Reputation point
2021-06-16T07:55:00.553+00:00

Hello!I have website which upload a file to service and then it checks header information. I want on the website to have label with error message if the file doesn`t have that header information. I decided to try with Soap exception. This is my code on web service:

try
{
    if ((RFile.CheckHeaderValue(FullFilePath, "value1") 
        || (RFile.CheckHeaderValue(FullFilePath,"value2")))
    {
        throw new SoapException("Please select value1 or value2",
            SoapException.ClientFaultCode);
    }        
}
catch (SoapException ex)
{
    throw ex;
}

Code from the website:

if (userID != null)
{
    try
    {
        client.ScheduleJob(userProject.SelectedItem.Text,false,FullPath)
    }
    catch (SoapException ex)
    {
        string exp = ex.Message;
        Label1.Text=exp;
    }
}

When I debug it does catch the exception BUT on the service. On the website it doesn`t. Do you have any idea why? Or if someone have any idea how i can get response from service?

Thank you

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,346 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,204 questions
{count} votes