I am giving example below about how I have added wsse header to wsdl:
<wsdl:definitions name = "ABC"
targetNamespace= "XXX"
xmlns:sec="http://schemas.xmlsoap.org/ws/2003/06/secext">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="XYZ">
<xsd:import namespace="http://schemas.xmlsoap.org/ws/2003/06/secext"
schemaLocation="/ws_security.xsd" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="Req">
<wsdl:part name="KeyVal" element="sec:UsernameToken" />
<wsdl:part name="RequestBody" element="tns:zzz " />
</wsdl:message>
<wsdl:message name="Resp">
<wsdl:part name="ResponseBody" element="tns:yyy " />
</wsdl:message>
<wsdl:portType name="RRR">
<wsdl:operation name="AAA">
<wsdl:input message="tns:zzz" />
<wsdl:output message=" tns:yyy " />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Binding" type=" RRR">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="AAA">
<soap:operation
soapAction="" />
<wsdl:input>
<soap:header use="literal" part="KeyVal"
message="tns:zzz " />
<soap:body use="literal" parts="RequestBody" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" parts="ResponseBody" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Service">
<wsdl:port binding="tns: Binding" name=" RRR">
<soap:address location="http://localhost:8080/ " />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
My AppContext.xml has following:
<jaxws:endpoint id="Service" implementor="com.service.SOAPService"
address="/myService" >
<jaxws:properties>
<entry key="schema-validation-enabled" value="true"/>
</jaxws:properties>
</jaxws:endpoint>
And also wants to remind what I said earlier, Schema validation on input works
perfectly fine when wsse header is removed from WSDL.
Thanks,
Vishal
-----Original Message-----
From: Mohana Rao S V [mailto:[email protected]]
Sent: Tuesday, March 24, 2015 2:45 PM
To: [email protected]
Subject: RE: Schema Validation on input doesn't work
Hi Vishal,
Could you please share details how are trying to achieve the wsse header
share the configuration and wsdl.
Thanks,
Mohan.
-----Original Message-----
From: Balana, Vishal [mailto:[email protected]]
Sent: Wednesday, March 25, 2015 12:07 AM
To: [email protected]
Subject: Schema Validation on input doesn't work
Hi All,
Any help would do wonders!
We have CXF SOAP service using wsdl-first approach.
Schema validation works fine if do not add wsse optional explicit header.
As soon as wsse header added to our wsdl CXF stops validating input
requests.
We are using CXF 2.7.3.
Service is deployed on tomcat 7.0.55.
What needs to be done to make it working?
Thanks,
Vishal