On Jun 25, 2013, at 2:50 PM, David Karlsen <[email protected]> wrote: > What do you think Dan?
Kind of a toss up. Those names aren't really needed in most cases if the appropriate names are added to the @WebService annotation on the impl. In that case, that config is redundant and "noise". Dan > > > 2013/6/21 David Karlsen <[email protected]> > >> Maybe that faq should refer to how to configure the endpoints for "full >> schema validation" (e.g. not only based off the JAXB annotations). The >> annotations lack some metadata so that the validation is not 100% like in >> the schema. >> >> Needed configuration: >> 1. delcare a prefix for the namespace of the service >> 2. declare the serviceName attribute to point to the name in the wsdl >> 3. declare the endpointName attribute to point to the name in the wsdl >> Like this: >> >> <jaxws:endpoint xmlns:cust="urn:srv.jfr.tac.fs.edb.com: >> ws:customer:v1" >> serviceName="cust:TACSCustomerService_V1" >> endpointName="cust:TACSCustomerService_V1PortTypeSoap11" >> implementor="#customerServiceV1Ws" >> address="/TACSCustomerService_V1" >> wsdlLocation="wsdl/TACSCustomerService_V1.wsdl"> >> <jaxws:properties> >> <entry key="schema-validation-enabled" >> value="${cxf.schemaValidation:true}" /> >> <entry key="faultStackTraceEnabled" >> value="${cxf.faultStackTraceEnabled}" /> >> <entry key="exceptionMessageCauseEnabled" >> value="${cxf.exceptionMessageCauseEnabled}" /> >> </jaxws:properties> >> </jaxws:endpoint> >> >> >> >> >> 2013/6/19 Daniel Kulp <[email protected]> >> >>> >>> Answered in the FAQ: >>> >>> >>> http://cxf.apache.org/faq.html#FAQ-HowcanIturnonschemavalidationforjaxwsendpoint%3F >>> >>> Dan >>> >>> >>> >>> On Jun 19, 2013, at 12:20 PM, Hilderich <[email protected]> wrote: >>> >>>> Hello All! >>>> >>>> we are using Apache CXF together with Apache Camel inside Apache Karaf: >>>> >>>> - Apache CXF Compatibility Bundle Jar (2.6.3) >>>> - camel-cxf (2.10.2) >>>> >>>> We are using a web service via code first apprach. >>>> >>>> The issue we are encounter is that an missing parameter inside the >>>> /complexType / >>>> (XML Schema) is ignored by the validation although the /complexType /is >>>> configured >>>> as follows (WSDL snippet): >>>> ... >>>> <xs:complexType name="orderDataMergingBean"> >>>> <xs:sequence> >>>> <xs:element name="brandNo" type="xs:string"/> >>>> <xs:element name="brandName" type="xs:string"/> >>>> <xs:element name="packageType" type="xs:string"/> >>>> <xs:element name="packageFormat" type="xs:string"/> >>>> <xs:element name="inputDir" type="xs:string"/> >>>> <xs:element minOccurs="0" name="acceptanceTimestamp" >>>> type="xs:dateTime"/> >>>> <xs:element minOccurs="0" name="orderSource" >>> type="xs:string"/> >>>> <xs:element name="override" type="xs:boolean"/> >>>> </xs:sequence> >>>> </xs:complexType> >>>> ... >>>> >>>> When we omit e.g. the /packageType /information for the request the web >>>> service can be >>>> used still though /packageTyp /is equipped implicit with minOccurs=1 and >>>> maxOccurs=1. >>>> >>>> How can we configure the web service properly to refuse such a request >>> and >>>> tell the client >>>> that such a request is invalid? >>>> >>>> The Java class (code first approach) looks as below: >>>> >>>> @XmlRootElement(name = "order") >>>> @XmlAccessorType(XmlAccessType.FIELD) >>>> public class OrderDataMergingBean implements Serializable { >>>> >>>> ... >>>> @XmlElement(required=true) >>>> private TecdocType packageType; >>>> ... >>>> >>>> Many thanks in advanced >>>> Hilderich >>>> >>>> >>>> >>>> -- >>>> View this message in context: >>> http://cxf.547215.n5.nabble.com/elements-with-minOccurs-1-in-a-complexType-not-honoured-tp5729512.html >>>> Sent from the cxf-user mailing list archive at Nabble.com. >>> >>> -- >>> Daniel Kulp >>> [email protected] - http://dankulp.com/blog >>> Talend Community Coder - http://coders.talend.com >>> >>> >> >> >> -- >> -- >> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen >> > > > > -- > -- > David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
