axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krishnakumar B" <>
Subject Validation
Date Tue, 11 Feb 2003 10:10:39 GMT
I have created a message style web service. I want the request validated
against a XSD Schema. 
How do i do this? 
The server accepts any form of XML request i send and it is not validated
against the schema in the WSDL.
My client
String namespace = " http://localhost:8080/DOMService/services/DOMService";
String wsdlURL = "
QName serviceQN = new QName(namespace, "DOMServiceService");
QName portQN = new QName(namespace, "DOMService");
Service service = new Service(new URL(wsdlURL), serviceQN);
Call call = (Call) service.createCall(portQN, "echoDoc");
Vector results = (Vector) call.invoke(
   new Object[] {
    new SOAPBodyElement(new ByteArrayInputStream(s.getBytes("UTF-8")))});
RPCElement doc = (RPCElement) results.get(0);
<wsdl:definitions xmlns:wsdl="" xmlns="" xmlns:SOAP-ENC="" xmlns:intf="
http://localhost:8080/DOMService/services/DOMService" xmlns:tns1="
http://DefaultNamespace" xmlns:wsdlsoap="" xmlns:xsd="" targetNamespace="
  <schema xmlns="" targetNamespace="
   <complexType name="Tester">
     <element name="One" nillable="true" type="xsd:string"/>
     <element name="Two" nillable="true" type="xsd:string"/>
   <element name="Tester" nillable="true" type="tns1:Tester"/>
 <wsdl:message name="echoDocResponse">
  <wsdl:part name="echoDocResponse" type="tns1:Tester"/>
 <wsdl:message name="echoDocRequest">
  <wsdl:part name="echoDocRequest" type="tns1:Tester"/>
 <wsdl:portType name="DOMService">
  <wsdl:operation name="echoDoc">
   <wsdl:input name="echoDocRequest" message="intf:echoDocRequest"/>
   <wsdl:output name="echoDocResponse" message="intf:echoDocResponse"/>
 <wsdl:binding name="DOMServiceSoapBinding" type="intf:DOMService">
  <wsdlsoap:binding style="document" transport=""/ <>
  <wsdl:operation name="echoDoc">
    <wsdlsoap:body use="literal" namespace="
<http://localhost:8080/DOMService/services/DOMService> >
    <wsdlsoap:body use="literal" namespace="
<http://localhost:8080/DOMService/services/DOMService> >
 <wsdl:service name="DOMServiceService">
  <wsdl:port name="DOMService" binding="intf:DOMServiceSoapBinding">
   <wsdlsoap:address location="
<http://dt675-krishnakb:8080/DOMService/services/DOMService> >


This message (including attachment if any) is confidential and may be privileged. Before opening
attachments please check them for viruses and defects. MindTree Consulting Private Limited
(MindTree) will not be responsible for any viruses or defects or any forwarded attachments
emanating either from within MindTree or outside. If you have received this message by mistake
please notify the sender by return  e-mail and delete this message from your system. Any unauthorized
use or dissemination of this message in whole or in part is strictly prohibited.  Please note
that e-mails are susceptible to change and MindTree shall not be liable for any improper,
untimely or incomplete transmission.

View raw message