I am trying to implement the recommendation in this article:
http://www.techper.net/2008/08/29/making-a-java-webapp-return-proper-soap-fault-responses/comment-page-1/
So that I can return predefined SOAP Fault Messages for certain HTTP Codes.
I have configured my web.xml file, but the code files are not returning. Is
there anything specific I need to do in CXF for accomplishing this? Or is
it more likely a WebLogic Server issue. Because my Soap Requests that
should create a 404 response (via my custom response) only keeps returning
the default 404.html.
web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>CodeLookupUtilityService Endpoint</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/CodeLookupUtilityServiceWar-context.xml
classpath*:/CodeLookupUtilityServiceClientInt-context.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<mime-mapping>
<extension>soap</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>
<error-page>
<error-code>401</error-code>
<location>/soap-error-responses/401.soap</location>
</error-page>
<error-page>
<error-code>403</error-code>
<location>/soap-error-responses/403.soap</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/soap-error-responses/404.soap</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/soap-error-responses/500.soap</location>
</error-page>
<error-page>
<error-code>503</error-code>
<location>/soap-error-responses/503.soap</location>
</error-page>
</web-app>
Sample File
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Service</faultcode>
<faultstring>404:Not Found</faultstring>
<detail>
<ex:msg xmlns:ex='http://healthnet.com/soa/frmwk/exception'>
The server has not found anything matching the Request-URI.
</ex:msg>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Thanks,
Jay
--
View this message in context:
http://cxf.547215.n5.nabble.com/CXFServlet-and-error-codes-tp3389935p3389935.html
Sent from the cxf-user mailing list archive at Nabble.com.