You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Alejandro <al...@gmail.com> on 2012/07/30 18:18:33 UTC
SchemaValidation
Hi, I want to validate the webservice invocation throw SchemaValidation on
the server side. To do that I put @SchemaValidation(enabled=true) in my
WebService implementation and <jaxws:properties><entry
key="schema-validation-enabled" value="true" /></jaxws:properties> in the
service endpoint.
I need to use the schema that I have in the wsdl , I don't want to use a
file in the filesystem.
How can I do that?
Regards
Alejandro
--
View this message in context: http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: SchemaValidation
Posted by Daniel Kulp <dk...@apache.org>.
On Monday, July 30, 2012 09:18:33 AM Alejandro wrote:
> Hi, I want to validate the webservice invocation throw SchemaValidation on
> the server side. To do that I put @SchemaValidation(enabled=true) in my
> WebService implementation and <jaxws:properties><entry
> key="schema-validation-enabled" value="true" /></jaxws:properties> in the
> service endpoint.
>
> I need to use the schema that I have in the wsdl , I don't want to use a
> file in the filesystem.
That should be exactly what it DOES do. As long as the service is created
with the wsdlLocation attribute, it should be using the schema that is
pulled in that way.
Check the logs to make sure there is a "creating service from WSDL" line
instead of a "creating service from Class" type line.
Dan
>
> How can I do that?
>
> Regards
> Alejandro
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721.html Sent from
> the cxf-user mailing list archive at Nabble.com.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: SchemaValidation
Posted by Alejandro <al...@gmail.com>.
Without the schema validation thewebservice works fine.
The only things tgat I see is that the WSDL is generate on the fly, I don't
have a file.
I'll try to create a example project to send to you.
Regards.
--
View this message in context: http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721p5712201.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: SchemaValidation
Posted by Alejandro <al...@gmail.com>.
I'v seen your link and I found a diference with the example xsd and my xsd.
The root element for ticketDatais is like this:
<*xs:complexType name="terminalData"*><xs:sequence>......
And in you example the root element is like this:
<*xsd:element name="DoubleIt"*><xsd:complexType><xsd:sequence>.....
Your element is under element tag and my root element is under complexType,
is any way by annotations to put my element under element tag?
Regards.
Alejandro
--
View this message in context: http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721p5712202.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: SchemaValidation
Posted by Glen Mazza <gm...@talend.com>.
Quote: For example, when I've invoked the getTicket services I get this error:
org.apache.cxf.interceptor.Fault: Unmarshalling Error: cvc-elt.1: Cannot
find the declaration of element 'terminalData'.
Does this same error occur if you *don't* activate schema validation?
What values are you calling getTicket services to get that error?
Hopefully someone else can quickly answer your question for you. In the
meantime, your WSDL can probably be shrunk about 80% and still
demonstrate the same problem--doing that simplification beforehand helps
us in spotting errors, indeed you might even spot the error on your own
while simplifying the problem. You might also wish to modify my
WSDL-web service using its downloadable source code (
http://www.jroller.com/gmazza/entry/web_service_tutorial) to your
(greatly simplified) WSDL, with whatever modifications to replicate the
error and go ahead and attach it as a JIRA. With all the incoming
issues and other work the CXF team has, it's time-consuming for us to
rig up a web service provider and a SOAP client just by receiving a
WSDL--giving us a minimal Maven project that we can immediately deploy
will increase the chances of the problem being solved.
Glen
On 08/08/2012 09:25 AM, Alejandro wrote:
> This is my wsdl with the schema restrictions:
>
> <?xml version='1.0' encoding='UTF-8'?><wsdl:definitions
> name="BiometricService" targetNamespace="http://ws.biometria.XXXX.com"
> xmlns:ns1="http://schemas.xmlsoap.org/soap/http"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:tns="http://ws.biometria.XXXX.com"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <wsdl:types>
> <xs:schema attributeFormDefault="unqualified"
> elementFormDefault="unqualified"
> targetNamespace="http://ws.biometria.XXXX.com"
> xmlns="http://ws.biometria.XXXX.com"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:complexType name="terminalData">
> <xs:sequence>
> <xs:element minOccurs="0" name="branchId">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:maxLength value="10"/>
> <xs:whiteSpace value="replace"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> <xs:element minOccurs="0" name="data">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:maxLength value="50"/>
> <xs:whiteSpace value="replace"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> <xs:element minOccurs="0" name="deviceSerialNumber">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:maxLength value="50"/>
> <xs:whiteSpace value="replace"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> <xs:element minOccurs="0" name="zipCode">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:maxLength value="15"/>
> <xs:whiteSpace value="replace"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> <xs:complexType name="supervisor">
> <xs:sequence>
> <xs:element minOccurs="0" name="birthDate" type="xs:dateTime"/>
> <xs:element minOccurs="0" name="documentNumber">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:maxLength value="12"/>
> <xs:pattern value="([0-9])*"/>
> <xs:minLength value="5"/>
> <xs:whiteSpace value="replace"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> <xs:element minOccurs="0" name="documentType">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:maxLength value="1"/>
> <xs:pattern value="[12345]"/>
> <xs:minLength value="1"/>
> <xs:whiteSpace value="replace"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> <xs:element minOccurs="0" name="name">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:maxLength value="80"/>
> <xs:whiteSpace value="replace"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> <xs:element minOccurs="0" name="nickName">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:maxLength value="25"/>
> <xs:whiteSpace value="replace"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> <xs:complexType name="user">
> <xs:sequence>
> <xs:element minOccurs="0" name="birthDate" type="xs:dateTime"/>
> <xs:element minOccurs="0" name="documentNumber">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:maxLength value="12"/>
> <xs:pattern value="([0-9])*"/>
> <xs:minLength value="5"/>
> <xs:whiteSpace value="replace"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> <xs:element minOccurs="0" name="documentType">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:maxLength value="1"/>
> <xs:pattern value="[12345]"/>
> <xs:minLength value="1"/>
> <xs:whiteSpace value="replace"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> <xs:complexType name="palmCredential">
> <xs:sequence>
> <xs:element minOccurs="0" name="hash" type="xs:string"/>
> <xs:element minOccurs="0" name="palmData" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> <xs:element name="InvalidBankException" type="InvalidBankException"/>
> <xs:complexType name="InvalidBankException">
> <xs:sequence>
> <xs:element name="message" nillable="true" type="xs:string"/>
> <xs:element name="errorCode" nillable="true" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> <xs:element name="TicketExcpetion" type="TicketExcpetion"/>
> <xs:complexType name="TicketExcpetion">
> <xs:sequence>
> <xs:element name="message" nillable="true" type="xs:string"/>
> <xs:element name="errorCode" nillable="true" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> <xs:element name="UserException" type="UserException"/>
> <xs:complexType name="UserException">
> <xs:sequence>
> <xs:element name="message" nillable="true" type="xs:string"/>
> <xs:element name="errorCode" nillable="true" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> <xs:element name="getTicket" type="getTicket"/>
> <xs:complexType name="getTicket">
> <xs:sequence>
> <xs:element minOccurs="0" name="terminalData" type="terminalData"/>
> <xs:element minOccurs="0" name="supervisor" type="supervisor"/>
> <xs:element name="operation" type="xs:int"/>
> </xs:sequence>
> </xs:complexType>
> <xs:element name="getTicketResponse" type="getTicketResponse"/>
> <xs:complexType name="getTicketResponse">
> <xs:sequence>
> <xs:element minOccurs="0" name="result" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> <xs:element name="enrollment" type="enrollment"/>
> <xs:complexType name="enrollment">
> <xs:sequence>
> <xs:element minOccurs="0" name="ticketData" type="xs:string"/>
> <xs:element minOccurs="0" name="terminalData" type="terminalData"/>
> <xs:element minOccurs="0" name="supervisor" type="supervisor"/>
> <xs:element minOccurs="0" name="user" type="user"/>
> <xs:element minOccurs="0" name="palmCredential" type="palmCredential"/>
> </xs:sequence>
> </xs:complexType>
> <xs:element name="enrollmentResponse" type="enrollmentResponse"/>
> <xs:complexType name="enrollmentResponse">
> <xs:sequence>
> <xs:element minOccurs="0" name="result" type="user"/>
> </xs:sequence>
> </xs:complexType>
> <xs:element name="validate" type="validate"/>
> <xs:complexType name="validate">
> <xs:sequence>
> <xs:element minOccurs="0" name="ticketData" type="xs:string"/>
> <xs:element minOccurs="0" name="terminalData" type="terminalData"/>
> <xs:element minOccurs="0" name="supervisor" type="supervisor"/>
> <xs:element minOccurs="0" name="user" type="user"/>
> <xs:element minOccurs="0" name="palmCredential" type="palmCredential"/>
> </xs:sequence>
> </xs:complexType>
> <xs:element name="validateResponse" type="validateResponse"/>
> <xs:complexType name="validateResponse">
> <xs:sequence>
> <xs:element minOccurs="0" name="result" type="user"/>
> </xs:sequence>
> </xs:complexType>
> </xs:schema>
> </wsdl:types>
> <wsdl:message name="SupervisorException">
> <wsdl:part element="tns:UserException" name="SupervisorException">
> </wsdl:part>
> </wsdl:message>
> <wsdl:message name="enrollmentResponse">
> <wsdl:part element="tns:enrollmentResponse" name="parameters">
> </wsdl:part>
> </wsdl:message>
> <wsdl:message name="getTicketResponse">
> <wsdl:part element="tns:getTicketResponse" name="parameters">
> </wsdl:part>
> </wsdl:message>
> <wsdl:message name="UserException">
> <wsdl:part element="tns:UserException" name="UserException">
> </wsdl:part>
> </wsdl:message>
> <wsdl:message name="validateResponse">
> <wsdl:part element="tns:validateResponse" name="parameters">
> </wsdl:part>
> </wsdl:message>
> <wsdl:message name="TicketException">
> <wsdl:part element="tns:TicketExcpetion" name="TicketException">
> </wsdl:part>
> </wsdl:message>
> <wsdl:message name="enrollment">
> <wsdl:part element="tns:enrollment" name="parameters">
> </wsdl:part>
> </wsdl:message>
> <wsdl:message name="InvalidBankException">
> <wsdl:part element="tns:InvalidBankException"
> name="InvalidBankException">
> </wsdl:part>
> </wsdl:message>
> <wsdl:message name="validate">
> <wsdl:part element="tns:validate" name="parameters">
> </wsdl:part>
> </wsdl:message>
> <wsdl:message name="getTicket">
> <wsdl:part element="tns:getTicket" name="parameters">
> </wsdl:part>
> </wsdl:message>
> <wsdl:portType name="biometricService">
> <wsdl:operation name="getTicket">
> <wsdl:documentation>Get ticket</wsdl:documentation>
> <wsdl:input message="tns:getTicket" name="getTicket">
> </wsdl:input>
> <wsdl:output message="tns:getTicketResponse" name="getTicketResponse">
> </wsdl:output>
> <wsdl:fault message="tns:InvalidBankException"
> name="InvalidBankException">
> </wsdl:fault>
> </wsdl:operation>
> <wsdl:operation name="enrollment">
> <wsdl:documentation>Enroll user</wsdl:documentation>
> <wsdl:input message="tns:enrollment" name="enrollment">
> </wsdl:input>
> <wsdl:output message="tns:enrollmentResponse"
> name="enrollmentResponse">
> </wsdl:output>
> <wsdl:fault message="tns:SupervisorException"
> name="SupervisorException">
> </wsdl:fault>
> <wsdl:fault message="tns:UserException" name="UserException">
> </wsdl:fault>
> <wsdl:fault message="tns:InvalidBankException"
> name="InvalidBankException">
> </wsdl:fault>
> <wsdl:fault message="tns:TicketException" name="TicketException">
> </wsdl:fault>
> </wsdl:operation>
> <wsdl:operation name="validate">
> <wsdl:documentation>Validate user</wsdl:documentation>
> <wsdl:input message="tns:validate" name="validate">
> </wsdl:input>
> <wsdl:output message="tns:validateResponse" name="validateResponse">
> </wsdl:output>
> <wsdl:fault message="tns:SupervisorException"
> name="SupervisorException">
> </wsdl:fault>
> <wsdl:fault message="tns:UserException" name="UserException">
> </wsdl:fault>
> <wsdl:fault message="tns:InvalidBankException"
> name="InvalidBankException">
> </wsdl:fault>
> <wsdl:fault message="tns:TicketException" name="TicketException">
> </wsdl:fault>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="BiometricServiceSoapBinding"
> type="tns:biometricService">
> <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="getTicket">
> <soap:operation soapAction="" style="document"/>
> <wsdl:input name="getTicket">
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output name="getTicketResponse">
> <soap:body use="literal"/>
> </wsdl:output>
> <wsdl:fault name="InvalidBankException">
> <soap:fault name="InvalidBankException" use="literal"/>
> </wsdl:fault>
> </wsdl:operation>
> <wsdl:operation name="enrollment">
> <soap:operation soapAction="" style="document"/>
> <wsdl:input name="enrollment">
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output name="enrollmentResponse">
> <soap:body use="literal"/>
> </wsdl:output>
> <wsdl:fault name="SupervisorException">
> <soap:fault name="SupervisorException" use="literal"/>
> </wsdl:fault>
> <wsdl:fault name="UserException">
> <soap:fault name="UserException" use="literal"/>
> </wsdl:fault>
> <wsdl:fault name="InvalidBankException">
> <soap:fault name="InvalidBankException" use="literal"/>
> </wsdl:fault>
> <wsdl:fault name="TicketException">
> <soap:fault name="TicketException" use="literal"/>
> </wsdl:fault>
> </wsdl:operation>
> <wsdl:operation name="validate">
> <soap:operation soapAction="" style="document"/>
> <wsdl:input name="validate">
> <soap:body use="literal"/>
> </wsdl:input>
> <wsdl:output name="validateResponse">
> <soap:body use="literal"/>
> </wsdl:output>
> <wsdl:fault name="SupervisorException">
> <soap:fault name="SupervisorException" use="literal"/>
> </wsdl:fault>
> <wsdl:fault name="UserException">
> <soap:fault name="UserException" use="literal"/>
> </wsdl:fault>
> <wsdl:fault name="InvalidBankException">
> <soap:fault name="InvalidBankException" use="literal"/>
> </wsdl:fault>
> <wsdl:fault name="TicketException">
> <soap:fault name="TicketException" use="literal"/>
> </wsdl:fault>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="BiometricService">
> <wsdl:port binding="tns:BiometricServiceSoapBinding"
> name="BiometricPort">
> <soap:address
> location="http://localhost:8080/biometria/BiometricService"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
>
> For example, when I've invoked the getTicket services I get this error:
> org.apache.cxf.interceptor.Fault: Unmarshalling Error: cvc-elt.1: Cannot
> find the declaration of element 'terminalData'.
> at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:823)
> at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:644)
> at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:157)
> at
> org.apache.cxf.interceptor.DocLiteralInInterceptor.getPara(DocLiteralInInterceptor.java:259)
> at
> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:126)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)
> at
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211)
> at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:193)
> at
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:110)
>
> I don't know why, but its happend in old services.
>
> Any idea.
>
> Regards
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721p5712188.html
> Sent from the cxf-user mailing list archive at Nabble.com.
Re: SchemaValidation
Posted by Alejandro <al...@gmail.com>.
This is my wsdl with the schema restrictions:
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions
name="BiometricService" targetNamespace="http://ws.biometria.XXXX.com"
xmlns:ns1="http://schemas.xmlsoap.org/soap/http"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://ws.biometria.XXXX.com"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="unqualified"
targetNamespace="http://ws.biometria.XXXX.com"
xmlns="http://ws.biometria.XXXX.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="terminalData">
<xs:sequence>
<xs:element minOccurs="0" name="branchId">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10"/>
<xs:whiteSpace value="replace"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="data">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
<xs:whiteSpace value="replace"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="deviceSerialNumber">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
<xs:whiteSpace value="replace"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="zipCode">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="15"/>
<xs:whiteSpace value="replace"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="supervisor">
<xs:sequence>
<xs:element minOccurs="0" name="birthDate" type="xs:dateTime"/>
<xs:element minOccurs="0" name="documentNumber">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="12"/>
<xs:pattern value="([0-9])*"/>
<xs:minLength value="5"/>
<xs:whiteSpace value="replace"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="documentType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="1"/>
<xs:pattern value="[12345]"/>
<xs:minLength value="1"/>
<xs:whiteSpace value="replace"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="80"/>
<xs:whiteSpace value="replace"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="nickName">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="25"/>
<xs:whiteSpace value="replace"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="user">
<xs:sequence>
<xs:element minOccurs="0" name="birthDate" type="xs:dateTime"/>
<xs:element minOccurs="0" name="documentNumber">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="12"/>
<xs:pattern value="([0-9])*"/>
<xs:minLength value="5"/>
<xs:whiteSpace value="replace"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="documentType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="1"/>
<xs:pattern value="[12345]"/>
<xs:minLength value="1"/>
<xs:whiteSpace value="replace"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="palmCredential">
<xs:sequence>
<xs:element minOccurs="0" name="hash" type="xs:string"/>
<xs:element minOccurs="0" name="palmData" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="InvalidBankException" type="InvalidBankException"/>
<xs:complexType name="InvalidBankException">
<xs:sequence>
<xs:element name="message" nillable="true" type="xs:string"/>
<xs:element name="errorCode" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="TicketExcpetion" type="TicketExcpetion"/>
<xs:complexType name="TicketExcpetion">
<xs:sequence>
<xs:element name="message" nillable="true" type="xs:string"/>
<xs:element name="errorCode" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="UserException" type="UserException"/>
<xs:complexType name="UserException">
<xs:sequence>
<xs:element name="message" nillable="true" type="xs:string"/>
<xs:element name="errorCode" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="getTicket" type="getTicket"/>
<xs:complexType name="getTicket">
<xs:sequence>
<xs:element minOccurs="0" name="terminalData" type="terminalData"/>
<xs:element minOccurs="0" name="supervisor" type="supervisor"/>
<xs:element name="operation" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:element name="getTicketResponse" type="getTicketResponse"/>
<xs:complexType name="getTicketResponse">
<xs:sequence>
<xs:element minOccurs="0" name="result" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="enrollment" type="enrollment"/>
<xs:complexType name="enrollment">
<xs:sequence>
<xs:element minOccurs="0" name="ticketData" type="xs:string"/>
<xs:element minOccurs="0" name="terminalData" type="terminalData"/>
<xs:element minOccurs="0" name="supervisor" type="supervisor"/>
<xs:element minOccurs="0" name="user" type="user"/>
<xs:element minOccurs="0" name="palmCredential" type="palmCredential"/>
</xs:sequence>
</xs:complexType>
<xs:element name="enrollmentResponse" type="enrollmentResponse"/>
<xs:complexType name="enrollmentResponse">
<xs:sequence>
<xs:element minOccurs="0" name="result" type="user"/>
</xs:sequence>
</xs:complexType>
<xs:element name="validate" type="validate"/>
<xs:complexType name="validate">
<xs:sequence>
<xs:element minOccurs="0" name="ticketData" type="xs:string"/>
<xs:element minOccurs="0" name="terminalData" type="terminalData"/>
<xs:element minOccurs="0" name="supervisor" type="supervisor"/>
<xs:element minOccurs="0" name="user" type="user"/>
<xs:element minOccurs="0" name="palmCredential" type="palmCredential"/>
</xs:sequence>
</xs:complexType>
<xs:element name="validateResponse" type="validateResponse"/>
<xs:complexType name="validateResponse">
<xs:sequence>
<xs:element minOccurs="0" name="result" type="user"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="SupervisorException">
<wsdl:part element="tns:UserException" name="SupervisorException">
</wsdl:part>
</wsdl:message>
<wsdl:message name="enrollmentResponse">
<wsdl:part element="tns:enrollmentResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getTicketResponse">
<wsdl:part element="tns:getTicketResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="UserException">
<wsdl:part element="tns:UserException" name="UserException">
</wsdl:part>
</wsdl:message>
<wsdl:message name="validateResponse">
<wsdl:part element="tns:validateResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="TicketException">
<wsdl:part element="tns:TicketExcpetion" name="TicketException">
</wsdl:part>
</wsdl:message>
<wsdl:message name="enrollment">
<wsdl:part element="tns:enrollment" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="InvalidBankException">
<wsdl:part element="tns:InvalidBankException"
name="InvalidBankException">
</wsdl:part>
</wsdl:message>
<wsdl:message name="validate">
<wsdl:part element="tns:validate" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getTicket">
<wsdl:part element="tns:getTicket" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="biometricService">
<wsdl:operation name="getTicket">
<wsdl:documentation>Get ticket</wsdl:documentation>
<wsdl:input message="tns:getTicket" name="getTicket">
</wsdl:input>
<wsdl:output message="tns:getTicketResponse" name="getTicketResponse">
</wsdl:output>
<wsdl:fault message="tns:InvalidBankException"
name="InvalidBankException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="enrollment">
<wsdl:documentation>Enroll user</wsdl:documentation>
<wsdl:input message="tns:enrollment" name="enrollment">
</wsdl:input>
<wsdl:output message="tns:enrollmentResponse"
name="enrollmentResponse">
</wsdl:output>
<wsdl:fault message="tns:SupervisorException"
name="SupervisorException">
</wsdl:fault>
<wsdl:fault message="tns:UserException" name="UserException">
</wsdl:fault>
<wsdl:fault message="tns:InvalidBankException"
name="InvalidBankException">
</wsdl:fault>
<wsdl:fault message="tns:TicketException" name="TicketException">
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="validate">
<wsdl:documentation>Validate user</wsdl:documentation>
<wsdl:input message="tns:validate" name="validate">
</wsdl:input>
<wsdl:output message="tns:validateResponse" name="validateResponse">
</wsdl:output>
<wsdl:fault message="tns:SupervisorException"
name="SupervisorException">
</wsdl:fault>
<wsdl:fault message="tns:UserException" name="UserException">
</wsdl:fault>
<wsdl:fault message="tns:InvalidBankException"
name="InvalidBankException">
</wsdl:fault>
<wsdl:fault message="tns:TicketException" name="TicketException">
</wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BiometricServiceSoapBinding"
type="tns:biometricService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getTicket">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="getTicket">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getTicketResponse">
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="InvalidBankException">
<soap:fault name="InvalidBankException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="enrollment">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="enrollment">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="enrollmentResponse">
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="SupervisorException">
<soap:fault name="SupervisorException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="UserException">
<soap:fault name="UserException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="InvalidBankException">
<soap:fault name="InvalidBankException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="TicketException">
<soap:fault name="TicketException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="validate">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="validate">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="validateResponse">
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="SupervisorException">
<soap:fault name="SupervisorException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="UserException">
<soap:fault name="UserException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="InvalidBankException">
<soap:fault name="InvalidBankException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="TicketException">
<soap:fault name="TicketException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="BiometricService">
<wsdl:port binding="tns:BiometricServiceSoapBinding"
name="BiometricPort">
<soap:address
location="http://localhost:8080/biometria/BiometricService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
For example, when I've invoked the getTicket services I get this error:
org.apache.cxf.interceptor.Fault: Unmarshalling Error: cvc-elt.1: Cannot
find the declaration of element 'terminalData'.
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:823)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:644)
at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:157)
at
org.apache.cxf.interceptor.DocLiteralInInterceptor.getPara(DocLiteralInInterceptor.java:259)
at
org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:126)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)
at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211)
at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:193)
at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:110)
I don't know why, but its happend in old services.
Any idea.
Regards
--
View this message in context: http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721p5712188.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: SchemaValidation
Posted by Daniel Kulp <dk...@apache.org>.
On Monday, July 30, 2012 12:32:05 PM Alejandro wrote:
> The problem is when I enable schemavalidator I'd get an error saying that
> can find any node, if I'll disable the schemavalidator it's work fine.
Would likely need to see a testcase. This could be just about anything
from invalid schema being generated by moxy, how cxf is mapping it into the
wsdl, schema validator load issues, etc....
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: SchemaValidation
Posted by Alejandro <al...@gmail.com>.
The problem is when I enable schemavalidator I'd get an error saying that can
find any node, if I'll disable the schemavalidator it's work fine.
--
View this message in context: http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721p5711736.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: SchemaValidation
Posted by Daniel Kulp <dk...@apache.org>.
On Monday, July 30, 2012 12:18:01 PM Alejandro wrote:
> Daniel, you are right, I'm deploy the service without wsdlLocation, and
> the wsdl would be generated with the @Facets.
>
> I need to use that schema generated dynamically to use SchemaValidation?
>
> It's clear?
Yep. That's exactly what it should be doing right now. Since that's the
only schema it knows about, that's the schema that it will use to validate
the message.
Dan
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721p5711732.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: SchemaValidation
Posted by Alejandro <al...@gmail.com>.
Daniel, you are right, I'm deploy the service without wsdlLocation, and the
wsdl would be generated with the @Facets.
I need to use that schema generated dynamically to use SchemaValidation?
It's clear?
--
View this message in context: http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721p5711732.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: SchemaValidation
Posted by Daniel Kulp <dk...@apache.org>.
On Monday, July 30, 2012 11:27:51 AM Alejandro wrote:
> I'm using javax.xml.bind.annotation.Facets (@Facets) to put restrictions,
> ranges, lengths, etc. So my xsd inside the wsdl have all this stuff.
I'm still kind of confused....
If you deploy a service with a wsdlLocation attribute, that wsdl is the one
that should be returned from the ?wsdl URL's. If not, that would be a bug.
Thus, that wsdl shouldn't have the facets in it.
If you DON'T deploy the service with a wsdlLocation attribute, then the wsdl
would be generated (and your @Facet's picked up, assuming moxy) and thus
runtime would then use that wsdl/schema for the validation.
Dan
> Regards.
> Alejandro
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721p5711727.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: SchemaValidation
Posted by Glen Mazza <gm...@talend.com>.
All I can see right now, certainly not the answer you'd like, is to
switch to a WSDL (contract)-first web service, i.e., deploy your web
service Java-first as you presently have it, grab the WSDL from the
browser, and use that to create a WSDL-first web service[1][2].
Contract-first development is not a bad way to go anyway[3]. But
perhaps someone else can think of a solution for you that will allow you
to remain Java-first.
Glen
[1] http://www.jroller.com/gmazza/entry/web_service_tutorial
[2]
http://cxf.apache.org/docs/defining-contract-first-webservices-with-wsdl-generation-from-java.html
[3]
http://static.springsource.org/spring-ws/site/reference/html/why-contract-first.html
On 07/30/2012 02:27 PM, Alejandro wrote:
> I'm using javax.xml.bind.annotation.Facets (@Facets) to put restrictions,
> ranges, lengths, etc. So my xsd inside the wsdl have all this stuff.
>
> Regards.
> Alejandro
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721p5711727.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Glen Mazza
Talend Community Coders
coders.talend.com
blog: www.jroller.com/gmazza
Re: SchemaValidation
Posted by Alejandro <al...@gmail.com>.
I'm using javax.xml.bind.annotation.Facets (@Facets) to put restrictions,
ranges, lengths, etc. So my xsd inside the wsdl have all this stuff.
Regards.
Alejandro
--
View this message in context: http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721p5711727.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: SchemaValidation
Posted by Glen Mazza <gm...@talend.com>.
Hmm...I guess you have a Java-first web service with no WSDL? I'm
unsure how schema validation can be done then--especially since in the
Java-first scenario (at least with JAXB databinding) you're not going to
have the XSD validation elements (acceptable ranges and lengths, for
example) that you would have with a hardcoded WSDL whose XSDs have those
restrictions defined.
Glen
On 07/30/2012 01:32 PM, Alejandro wrote:
> Sorry but, I think that you don't understand my issue.
>
> I don't want to use wsdlLocation="WEB-INF/wsdl/myWSDL.xsd", I need to
> validate against the schema that I find in
> http://localhost:8080/myservices/MyService?wsdl under
> <wsdl:types><xs:schema...> or
> http://localhost:8080/myservices/MyService?wsdl=myService.wsdl
>
> It's clear?
>
> Regards
> Alejandro
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721p5711725.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Glen Mazza
Talend Community Coders
coders.talend.com
blog: www.jroller.com/gmazza
Re: SchemaValidation
Posted by Alejandro <al...@gmail.com>.
Sorry but, I think that you don't understand my issue.
I don't want to use wsdlLocation="WEB-INF/wsdl/myWSDL.xsd", I need to
validate against the schema that I find in
http://localhost:8080/myservices/MyService?wsdl under
<wsdl:types><xs:schema...> or
http://localhost:8080/myservices/MyService?wsdl=myService.wsdl
It's clear?
Regards
Alejandro
--
View this message in context: http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721p5711725.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: SchemaValidation
Posted by Glen Mazza <gm...@talend.com>.
This blog entry might help:
http://www.jroller.com/gmazza/entry/soap_xml_schema_validation
Glen
On 07/30/2012 12:18 PM, Alejandro wrote:
> Hi, I want to validate the webservice invocation throw SchemaValidation on
> the server side. To do that I put @SchemaValidation(enabled=true) in my
> WebService implementation and <jaxws:properties><entry
> key="schema-validation-enabled" value="true" /></jaxws:properties> in the
> service endpoint.
>
> I need to use the schema that I have in the wsdl , I don't want to use a
> file in the filesystem.
>
> How can I do that?
>
> Regards
> Alejandro
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SchemaValidation-tp5711721.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Glen Mazza
Talend Community Coders
coders.talend.com
blog: www.jroller.com/gmazza