blog-samples icon indicating copy to clipboard operation
blog-samples copied to clipboard

Tutorial cxf_x509_profile: WS-I Compliance Error (Assertion: BP2703)

Open HimalayFei opened this issue 10 years ago • 4 comments

I added a wsp:Policy element in WSDL and since then I am getting WS-I compliance error. I went thru the following blog, and the error goes away when I declare wsp:Policy before wsdl:types, wsdl:service, wsdl:message, wsdl:binding

http://frommyworkshop.blogspot.com/2011/03/quick-fix-of-ws-i-bp2703-assertion.html

However, if its a Java First WSDL, the generated WSDL always has the wsp:Policy element at the end.

Exception: org.xml.sax.SAXException: Error: cvc-complex-type.2.4.a: Invalid content was found starting with element 'wsp:Policy'. One of '{"http://schemas.xmlsoap.org/wsdl/":import, "http://schemas.xmlsoap.org/wsdl/":types, "http://schemas.xmlsoap.org/wsdl/":message, "http://schemas.xmlsoap.org/wsdl/":portType, "http://schemas.xmlsoap.org/wsdl/":binding, "http://schemas.xmlsoap.org/wsdl/":service}' is expected. at org.wsi.xml.XMLUtils$ErrHandler.error(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source) at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.wsi.xml.jaxp.DocumentBuilderImpl.parse(Unknown Source) at org.wsi.xml.XMLUtils.parseXML(Unknown Source) at org.wsi.xml.XMLUtils.parseXMLDocument(Unknown Source) at org.wsi.test.profile.validator.impl.wsdl.BP2703.validate(Unknown Source) at org.wsi.test.profile.validator.impl.BaseValidatorImpl.processAssertions(Unknown Source) at org.wsi.test.profile.validator.impl.wsdl.WSDLValidatorImpl.processDefinitionAssertions(Unknown Source) at org.wsi.test.profile.validator.impl.wsdl.WSDLValidatorImpl.validate(Unknown Source) at org.wsi.test.analyzer.BasicProfileAnalyzer.validateWSDL(Unknown Source) at org.wsi.test.analyzer.BasicProfileAnalyzer.validateConformance(Unknown Source) at org.wsi.test.analyzer.BasicProfileAnalyzer.main(Unknown Source)

HimalayFei avatar Oct 13 '14 19:10 HimalayFei

This has nothing to do with me. If you have CXF questions, ask on the CXF User's Mailing List or Stack Overflow.

gmazza avatar Oct 13 '14 20:10 gmazza

Its not a CXF question. I was pointing the way you ordered wsp:Policy element in your WSDL here.. https://github.com/gmazza/blog-samples/blob/master/cxf_x509_profile/service/src/main/resources/DoubleIt.wsdl

It does NOT comply to WS-I, changing the order fixes the issue.

HimalayFei avatar Oct 13 '14 22:10 HimalayFei

OK, Thanks, I'll look at it. AFAICT your original posting made no reference to my cxf_x509_profile tutorial so I had no idea what you were talking about. In the future please clearly state the tutorial when letting me know of a problem.

gmazza avatar Oct 13 '14 22:10 gmazza

yeah, it was my bad not pointing to exact location. I have updated the subject. Thank you.

HimalayFei avatar Oct 13 '14 22:10 HimalayFei