SOAP WS로 이동하고 wsdl에서 JAXB를 사용하여 SOAP 메시지에 사용 된 객체를 생성하는 과정에서. 비누 오류 메시지의 세부 정보 필드에 사용자 지정 예외를 얻으려고 할 때 문제가 있습니다. 다음은 기존 오류 메시지가 반환되는 방식입니다 (FooException이 자세하게 포함됩니다).비누 오류 자세한 사용자 정의 예외
<env:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header/>
<env:Body>
<env:Fault>
<faultcode>env:Server</faultcode>
<faultstring>Service specific exception: com.test.FooException: Invalid authentication credentials. Please try again.</faultstring>
<detail>
<n1:FooException xsi:type="n1:FooException" xmlns:n1="java:com.test">
<errorCode xsi:type="xsd:int">101</errorCode>
<errorReason xsi:type="xsd:string">InvalidUserCredentials:Invalid authentication credentials. Please try again</errorReason>
</n1:FooException>
</detail>
</env:Fault>
</env:Body>
</env:Envelope>
spring config xml 파일에 customer exceptionResolver bean 식별자를 설정했습니다.
<bean id="exceptionResolver" class="com.test.FacadeExceptionHandler">
<property name="order" value="1"></property>
<property name="defaultFault" value="SERVER"/>
<property name="exceptionMappings">
<value> com.test.FooException=SERVER,FaultMsg </value>
</property>
</bean>
은 내가 FacadeExceptionHandler를 생성하고 호출지고 있습니다,하지만 난 오류 메시지에 대한 세부 사항 부분에 FooException을 얻는 방법을 알아낼 수 없습니다.
도움이 될 것입니다!
미리 도움 주셔서 감사합니다.
'FooException' 구현을 보여줍니다. – kolossus