You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Naveen Srinivasa Murthy <nm...@datalinx.net> on 2002/10/17 23:10:21 UTC

How to associate xml schemas to the a web service input parameter...

Hi,

find below the WSDL for my web service.
my webservice "MyService" has 2 arguments
'arg' and 'arg2''. The 'arg' is of type "string",
but actually its content is XML. Is there any
way I can put info into the WSDL saying
that 'arg' is an XML and give its XSD schema location?


<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="http://localhost/axis/services/MyService/axis/services/MySe
rvice" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost/axis/services/MyService/axis/services/MyService
-impl"
xmlns:intf="http://localhost/axis/services/MyService/axis/services/MyService
" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <wsdl:message name="serviceMethodResponse">
    <wsdl:part name="return" type="xsd:string"/>
  </wsdl:message>
  <wsdl:message name="serviceMethodRequest">
    <wsdl:part name="arg" type="xsd:string"/>
    <wsdl:part name="arg2" type="xsd:string"/>
  </wsdl:message>
  <wsdl:portType name="MyService">
    <wsdl:operation name="serviceMethod" parameterOrder="arg arg2">
      <wsdl:input message="intf:serviceMethodRequest"
name="serviceMethodRequest"/>
      <wsdl:output message="intf:serviceMethodResponse"
name="serviceMethodResponse"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="MyServiceSoapBinding" type="intf:MyService">
    <wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="serviceMethod">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="serviceMethodRequest">
        <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost/axis/services/MyService/axis/services/MyService"
use="encoded"/>
      </wsdl:input>
      <wsdl:output name="serviceMethodResponse">
        <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost/axis/services/MyService/axis/services/MyService"
use="encoded"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="MyServiceService">
    <wsdl:port binding="intf:MyServiceSoapBinding" name="MyService">
      <wsdlsoap:address
location="http://localhost/axis/services/MyService"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>


Thanks and Regards

Naveen Srinivasa Murthy



help - axis and schema validation

Posted by Naveen Srinivasa Murthy <nm...@datalinx.net>.

I want to know whether the Service and Call objects
provided by axis, can somehow do a schema validation
of a webservice input parameter before Webservice invocation.

consider this part of my wsdl

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="http://localhost/axis/services/MyService/axis/services/MySe
rvice" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost/axis/services/MyService/axis/services/MyService
-impl"
xmlns:intf="http://localhost/axis/services/MyService/axis/services/MyService
" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:esxsd="http://naveen.com/myxml.xsd"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <wsdl:message name="serviceMethodResponse">
    <wsdl:part name="return" type="xsd:string"/>
  </wsdl:message>
  <wsdl:message name="serviceMethodRequest">
    <wsdl:part name="arg" element="esxsd:ROOT"/>
    <wsdl:part name="arg2" type="xsd:string"/>


the input param 'arg' is supposed be an xml conforming

to the 'ROOT' element in the http://naveen.com/myxml.xsd schema.



I m calling my webservice using a Service and Call objects

and im providing the WSDL url to the Service obj during the WS

call. Is the Call object supposed to automatically validate

the input against http://naveen.com/myxml.xsd schema? If not can

I achieve this?



Please let me know...



thanks

Naveen