Publish a web service

04 Jun '14, 02:04 PM
20,300 Views
No Forum Badges

Hello,

I publishing a web service called "Almacenar Datos" which it is responsible for receiving data (file:”llamada.xml” -- code added to the end ) XSD format as we have previously defined in WebRatio and treat your data.

 

On one hand we have information that will identify where we need to add the new data as it is information that we previously stored in the database using the site view "Administration". In my case this information would be:

 

 <Empresa>Domino's Pizza</Empresa>

            <Servicio>

                        <Calidad_llamada>50</Calidad_llamada>

            </Servicio>

            <Llamadas>

                        <Llamada>

                                               ……..

                             <Tipo>Consulta</Tipo>   

                             <Evento>1</Evento>

                        </Llamada>

            </Llamadas>

 

On the other hand we have new information to add to the database and that has to be related to the identifying information mentioned in the previous point.. In my case this information would be:

 

<Llamadas>              

            <Llamada>    

                        <Tlf>92454321</Tlf>

                        <Operador>Peter</Operador>

                        <Duracion>70</Duracion>

                        <Retencion>20</Retencion>

                        <Realizado>Si</Realizado>

                        <Fecha_hora>04/06/2014 11:18:00</Fecha_hora>         

            </Llamada>

   </Llamadas>

 

To end the information received by the web service would like to know if this service can perform calculations. Eg from <Fecha_hora> field where is set the time of the call with this information,  relate the entity "Llamadas" to the relevant entity "Franja Horaria".

The "Franja Horaria" entity related calls within a timespan.

 

I would be grateful if you could send me some examples of the features implemented in my web project, adding the XSD file for formatting information in the web service.(acendran@gmail.com).

I can send my web project to anyone who can help me to watch the Domain Model and the rest of the project.

 

Thank you in advance.

 

Adrián Cendrán

--------------------------------------------------------------------------

File: llamada.xml:

<?xml version="1.0" encoding="UTF-8"?>
<inv:CallCenter xmlns:inv="urn:callcenter.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<Empresa>Domino's Pizza</Empresa>
<Servicio>
    <Calidad_llamada>50</Calidad_llamada>
</Servicio>
<Llamadas>
    <Llamada>    
        <Tlf>92454321</Tlf>
        <Operador>Peter</Operador>
        <Duracion>70</Duracion>
        <Retencion>20</Retencion>
        <Realizado>Si</Realizado>
        <Fecha_hora>04/06/2014 11:18:00</Fecha_hora>
        <Tipo>Consulta</Tipo>    
        <Evento>1</Evento>
    </Llamada>
    <Llamada>    
        <Tlf>924879456</Tlf>
        <Operador>John</Operador>
        <Duracion>60</Duracion>
        <Retencion>10</Retencion>
        <Realizado>Si</Realizado>
        <Fecha_hora>04/06/2014 11:19:00</Fecha_hora>
        <Tipo>Incidencia</Tipo>
        <Evento>2</Evento>    
    </Llamada>
</Llamadas>    
</inv:CallCenter>

 

File: llamadas.xsd

 

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:llamada.com" xmlns:inv="urn:llamada.com">

<xsd:element name="CallCenter" type="inv:CallCenterType" />

<xsd:complexType name="CallCenterType">
 <xsd:sequence>
  <xsd:element name="Empresa" type="inv:EmpresaType"/>
  <xsd:element name="Servicio" type="inv:ServicioType"/>  
  <xsd:element name="Llamadas" type="inv:ItemsType"/>
 </xsd:sequence>
</xsd:complexType>
 
<xsd:simpleType name="EmpresaType">
 <xsd:restriction base="xsd:string">
   <xsd:pattern value="([a-z][A-Z])+"/> 
 </xsd:restriction>
</xsd:simpleType>
 
  
 <xsd:complexType name="ServicioType">
  <xsd:sequence>
   <xsd:element name="Calidad_llamada" type="xsd:integer"/>   
  </xsd:sequence>
 </xsd:complexType>
 
 <xsd:complexType name="ItemsType">
  <xsd:sequence>
   <xsd:element name="Llamada" type="inv:ItemType" minOccurs="1" maxOccurs="unbounded"/>
  </xsd:sequence>
 </xsd:complexType>
 
 <xsd:complexType name="ItemType">
  <xsd:sequence>
   <xsd:element name="Tlf" type="xsd:string"/>
   <xsd:element name="Operador" type="xsd:string"/>
   <xsd:element name="Duracion" type="inv:TiempoType"/>
   <xsd:element name="Retencion" type="inv:TiempoType"/>
   <xsd:element name="Realizado" type="inv:BooleanType"/>
   <xsd:element name="Fecha_hora" type="xsd:string"/>
   <xsd:element name="Tipo" type="inv:ListType"/>
   <xsd:element name="Evento" type="xsd:string"/>
  </xsd:sequence>
 </xsd:complexType>
 
 
 
 <xsd:simpleType name="TiempoType">
  <xsd:restriction base="xsd:nonNegativeInteger">
   <xsd:minExclusive value="0" />   
  </xsd:restriction>
 </xsd:simpleType>
 
 <xsd:simpleType name="BooleanType">
   <xsd:restriction base="xsd:string">
        <xsd:enumeration value="Si"/>
        <xsd:enumeration value="No"/>
   </xsd:restriction>
 </xsd:simpleType>  
 
  
 <xsd:simpleType name="ListType">
  <xsd:restriction base="xsd:string">
   <xsd:enumeration value="Broma/Error" />
   <xsd:enumaration value="Consulta" />
   <xsd:enumeration value="Pedido Realizado" />
   <xsd:enumaration value="Reclamación" />
   <xsd:enumeration value="Incidencia" />
   <xsd:enumaration value="Servicio no disponible en Dirección" />
   <xsd:enumeration value="Cuelga en Cliente en retención" />
   <xsd:enumaration value="Cola Saturada" />
   <xsd:enumeration value="Superado porcentaje de retención" />   
  </xsd:restriction>
 </xsd:simpleType>
 
</xsd:schema>

 
x 0
Follow
Answer Answer at this question and get points!
Forum Expert - Level 5

Hi Adrian,

I noticed looking at your project:

- The name of the web project has spaces, you should delete them to make sure that the project is generated successfully

- To save the data in a persistent database, retrieved from a web service based on an XSD you need to lean volatile entity based on your XSD as explained in the article http://www.webratio.com/learn/learningobject/XML Scheme-Definition-Support, because the persistent entities can not be associated with it, and then save the data automatically.

- When creating a Web service you must always have in addition to the "Error Response", also the "Response" Operation which is the output of the response of the web service when its operations are completed successfully as you can see from the examples in this article http://www.webratio.com/learn/learningobject/Getting-started-with-Web-Services

The logic that you should follow in order to solve your problem is:

- Create the entity volatile based on XSD

- On solicit the input is set as a parameter based sull'XSD, ie attach the XSD Provider and the relative XSD Type.

- Use the "XML I / O" component instead of "XML In". By setting the "Mode" to "Import" and associate this entity volatile component based sull'xsd.

- To save the data to the database, once you've saved on the extent volatile data received from the web service you read the data just loaded in the volatile entity and save in the persisten entity.

 

Let me know if the information you have been helpful.

Best regards,

Ombretta malinverno

 
x 0
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 invoke rest web service that returns a pdf 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 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 request using XSD 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