Pregunta

I have a custom java exception called ClientAlreadyExistsException this exception is thrown by a signup method in java and I use Apache CXF to generate the web services. Now in my C# client when I call for the signup method I can't catch the exception as it always returns an error FaultException`1 but in which I can actually see the text i wrote in the java exception.

I tried catching a SoapException but it didn't work and I even tried this :

try
        {
            //signup method call

        }
        catch (FaultException<ClientAlreadyExistsException> ex)
        {
            //code
        }

Any help ?

¿Fue útil?

Solución

Your C# client, executes a request to a SOAP web service. It has no difference if the SOAP server is implemented using Java or something else. The only way to indicate a specific error to your client, is to integrate the custom error in the SOAP mechanism. You could use this, or this as a reference.

Hope I helped!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top