web service request using XSD

20 May '14, 02:12 PM
8,014 Views
No Forum Badges

I have a web service which the "request unit" have a XSD that validates the input data .
I am using the " SoapUI " software to try out the service request and the scheme is shown me is:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webml.org/webservices">
   <soapenv:Header/>
   <soapenv:Body>
      <web:getProductsByMinMaxPrices/>
   < / soapenv : Body>
< / soapenv : Envelope>

And the XSD I use to validate the data is ( prices.xsd ) :

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.webml.org/webservices/wsdl/prices">
    
    <xsd:complexType name="pricesType">
        <xsd:sequence>
            <xsd:element minOccurs="1" maxOccurs="1" name="min-price" type="xsd:string"/>
            <xsd:element minOccurs="1" maxOccurs="1" name="max-price" type="xsd:string"/>
        < / xsd: sequence>
    < / xsd: complexType >
< / xsd : schema >

Thus an example of request scheme " SoapUI " to use is :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webml.org/webservices">
   <soapenv:Header/>
   <soapenv:Body>
      <web:getProductsByMinMaxPrices/>
<pricesType>
<min-price> 10 </ min- price>
<max-price> 200 < / max- price>
</ pricesType >

   < / soapenv : Body>
< / soapenv : Envelope>

But do not give me any results .


I would be very grateful if someone could help me.

Adrián.

 
x 0
Follow
Answer Answer at this question and get points!
Forum Starter - Level 3

Hello Adrian, 

This is a working request that you can use in SoapUI for getProductsByMinMaxPrices:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webml.org/webservices">
   <soapenv:Header/>
   <soapenv:Body>
    <w:getProductsByMinMaxPrices xmlns:w="http://www.webml.org/webservices">
          <prices>
            <min-price>10</min-price>
            <max-price>2000</max-price>
          </prices>
        </w:getProductsByMinMaxPrices>
   </soapenv:Body>
</soapenv:Envelope>

Usually you can obtain working request using .xsl file attached into the project.

In this case, for example, you can:

  1. Open AcmeWS project in WebRatio Platform
  2. In the WS_Invoke view, select the Request Responce component linked to getProductsByMinMaxPrices method.
  3. Select the Request Response component and move to the Properties View
  4. Next to "Input Transformation" you can find the get-by-min-max-prices.xsl file (This file receive min and max as input data and return a working request used by the component)
  5. Move to WebRatio Explorer view (on the left side)
  6. Move to the folder: Acme WS > WebContent > WEB-INF > descr
  7. In this folder you can find all the resources used in your project (In this case our file is: get-by-min-max-prices.xsl). Be careful: if you modify or delete one or more of these files, your project could stop working. 
  8. Open get-by-min-max-prices.xsl file and copy the portion of code you need to make a request in SoapUI

Moreover, remeber that request code cannot contain white spaces.

Best regards

Antonella Antico

   
x 1
Answer at this question and get points!

Related questions

Access wsdl in https Can not get generate and run option for DataService Project Cannot invoke method selectSingleNode() on null object Can't generate and run database or start tomcat server! CelsiusToFahrenheit Example com.webratio.rtx.RTXException: An error occurred dispatching the SOAP message Could not create service Custom Unit and AJAX / SOAP Description: Unknown tag 'wr:LinkResource' Exception REST Post request Exposing SOAP Web SERVICE on port different from 80 Generation options problem Getting started with Web Services How can I invoke a Rest Web Service having dynamic parameters? How to change smtp port invoking a webservice using REST java.lang.NullPointerException No cloud accounts available No database on my cloud account Parameters order in a webservice request Problema generando la logica de un proyecto Problemas al invocar webservice Properties of the XSD Resource (File) Publish a web service publish web service for storing information in PostgreSQL DB following XSD Resource Sync DataService Project with Mobile Project usuarios y grupos WebRatio and MySQL WebRatio Mobile Platform Community edition - Restful request WebService DateTime value is not parsed to Date. Web service provider newline problem Web service - Synchronize XSD When stars web ratio between dofollow and nofollow backlink has affected? When using web services, what kind authentication is used? which of these three models is closer to webratio/ifml way of creating web applications XML Out Unit and Soap Request Response Unit XML Schema Definition Support XML Schema Definition Support