문제

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 ?

도움이 되었습니까?

해결책

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!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top