XML 문서 및 비즈니스 오브젝트는 유효성 검증 서비스를 사용하여 유효성이 검증될 수 있습니다.
게다가 기타 서비스는 명백한 최소 표준을 요구하거나 런타임 예외를 처리합니다. 이 중 하나는 BOXMLSerializer입니다.
XML 유효성 검증 예외로 생성된 모든 메시지에 대한 로그를 볼 수 있습니다. 아래 예제는 BOXMLSerializer에 의해 유효성 검증된 부적절한 XML 코딩으로 생성된 메시지입니다.
javax.xml.ws.WebServiceException: org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: Element type "TestResponse" must be followed by either attribute specifications, ">" or "/>". javax.xml.ws.WebServiceException: org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope
[9/11/08 15:16:27:417 CDT] 0000003e ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "transactionNotSupportedActivitySessionNotSupported" on bean "BeanId(WSXMLValidationApp#WSXMLValidationEJB.jar#Module, null)". Exception data: WebServicesFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException faultString: org.xml.sax.SAXParseException: Element type "TestResponse" must be followed by either attribute specifications, ">" or "/>". Message being parsed: <?xml version="1.0"?><TestResponse xmlns="http://WSXMLValidation"<firstName>Bob</firstName> <lastName>Smith</lastName></TestResponse> faultActor: null faultDetail: [9/11/08 15:16:35:135 CDT] 0000003f ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "transactionNotSupportedActivitySessionNotSupported" on bean "BeanId(WSXMLValidationApp#WSXMLValidationEJB.jar#Module, null)". Exception data: WebServicesFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException faultString: org.xml.sax.SAXException: WSWS3066E: Error: Expected 'envelope' but found TestResponse Message being parsed: <?xml version="1.0"?><TestResponse xmlns="http://WSXMLValidation"> <firstName>Bob</firstName><middleName>John</middleName> <lastName>Smith</lastName> </TestResponse> faultActor: null faultDetail:
[9/11/08 15:35:13:401 CDT] 00000064 WebServicesSe E com.ibm.ws.webservices.engine.transport.http.WebServicesServlet getSoapAction WSWS3112E: Error: Generating WebServicesFault due to missing SOAPAction. WebServicesFault faultCode: Client.NoSOAPAction faultString: WSWS3147E: Error: no SOAPAction header! faultActor: null faultDetail:
유효성 검증 서비스에 대한 자세한 정보는 참조 섹션에 생성된 API 및 SPI 문서에서 BOInstanceValidator 인터페이스를 참조하십시오.