473,396 Members | 1,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Transforming a SOAP result with a XSL using 'Javascript Soap Client'

Hi,

I have an WebService (.net 3.5) with Soap 1.1 method. I am using ASP 3 (classic) with Javascript Soap Client to call the WebService and I need to transform the result with a XSL file, but i don´t know how to do this with a SOAP 1.1. I have some solutions with a default XML results.

XML Result:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  3.   <soap:Body>
  4.     <KYRHResponse>
  5.       <KYRHResult>
  6.         <KYRH xmlns="">
  7.           <Informativo>
  8.             <Status>OK</Status>
  9.             <MsgErro></MsgErro>
  10.             <QtdRegistros>15</QtdRegistros>
  11.           </Informativo>
  12.           <Cabecalho>
  13.             <Item>
  14.               <NomeBanco>xxxxx</NomeBanco>
  15.               <Cabec>AGENCIA: xxxxx CONTA: xxxxx</Cabec>
  16.               <DataRef>21/06/11</DataRef>
  17.               <Cabec1>VCTO CRT  N.NUMERO  DEP.         VALOR     - SACADO (CGC E NOME) -  OBSERVACAO</Cabec1>
  18.             </Item>
  19.           </Cabecalho>
  20.           <Dados>
  21.             <Item>
  22.               <Venc>01/07</Venc>
  23.               <Carteira>112</Carteira>
  24.               <NossoNum>12121212</NossoNum>
  25.               <DacNossoNum>4</DacNossoNum>
  26.               <Depos>2861</Depos>
  27.               <Valor>1.316,27</Valor>
  28.               <BR></BR>
  29.               <CGC>11111111</CGC>
  30.               <Nome>xxxx xxxxxx</Nome>
  31.               <Obs></Obs>
  32.             </Item>
  33.           </Dados>
  34.         </KYRH>
  35.       </KYRHResult>
  36.     </KYRHResponse>
  37.   </soap:Body>
  38. </soap:Envelope>
  39.  
XSL file:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4.   <xsl:template match="/">
  5.  
  6.     <table border="1" cellpadding="2" padding="2">
  7.  
  8.       <xsl:if test="/*/*/*/*/*/*/Informativo/Status = 'OK'">
  9.  
  10.         <xsl:if test="/*//Informativo/QtdRegistros != 0">
  11.           <xsl:call-template name="OK_REGISTROS" />
  12.         </xsl:if>
  13.  
  14.         <xsl:if test="/*/Informativo/QtdRegistros = 0">
  15.           <xsl:call-template name="NOK_REGISTROS" />
  16.         </xsl:if>
  17.  
  18.       </xsl:if>
  19.  
  20.       <xsl:if test="/*/Informativo/Status = 'Erro'">
  21.         <xsl:call-template name="NOK"/>
  22.       </xsl:if>
  23.  
  24.     </table>
  25.  
  26.   </xsl:template>
  27.  
  28.   <xsl:template name="NOK">
  29.     <tr>
  30.       <td colspan="8">
  31.         Erro: <xsl:value-of select="/*/Informativo/MsgErro"/>
  32.       </td>
  33.     </tr>
  34.   </xsl:template>
  35.  
  36.   <xsl:template name="OK_REGISTROS">
  37.  
  38.     <xsl:if test="/*/Informativo/QtdRegistros > 0">
  39.       <tr>
  40.         <td colspan="8">
  41.           <hr />
  42.         </td>
  43.       </tr>
  44.       <tr>
  45.         <th>Vencimento</th>
  46.         <th>Carteira</th>
  47.         <th>N. numero</th>
  48.         <th>CNPJ</th>
  49.         <th>Sacado</th>
  50.         <th>Valor</th>
  51.         <th>Depositaria</th>
  52.         <th>Obs</th>
  53.       </tr>
  54.       <xsl:for-each select="/*/Dados/Item">
  55.         <tr>
  56.           <td>
  57.             <center>
  58.               <xsl:value-of select="Venc"/>
  59.             </center>
  60.           </td>
  61.           <td>
  62.             <center>
  63.               <xsl:value-of select="Carteira"/>
  64.             </center>
  65.           </td>
  66.           <td>
  67.             <xsl:value-of select="NossoNum"/>-<xsl:value-of select="DacNossoNum"/>
  68.           </td>
  69.           <td>
  70.             <center>
  71.               <xsl:value-of select="CGC"/>
  72.             </center>
  73.           </td>
  74.           <td>
  75.             <xsl:value-of select="Nome"/>
  76.           </td>
  77.           <td>
  78.             <xsl:value-of select="Valor"/>
  79.           </td>
  80.           <td>
  81.             <xsl:value-of select="Depos"/>
  82.           </td>
  83.           <td>
  84.             <xsl:value-of select="Obs"/>
  85.           </td>
  86.         </tr>
  87.       </xsl:for-each>
  88.     </xsl:if>
  89.  
  90.   </xsl:template>
  91.  
  92.   <xsl:template name="NOK_REGISTROS">
  93.     <tr>
  94.       <td colspan="8">
  95.         Nenhum registro foi localizado.
  96.       </td>
  97.     </tr>
  98.   </xsl:template>
  99.  
  100. </xsl:stylesheet>
  101.  
Jun 24 '11 #1
0 2315

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I...
2
by: Dean | last post by:
Hi I've got a question relating to using Javascript on an Intranet. I have a directory with a list of files in the format week36.xls, week37.xls and I want to write a script that will scan...
2
by: Ralph Krausse | last post by:
I want to create my own kind of counter, for myself. I have a resume page on my site. I want to know how many people go there but dont want to 'go there' myself because I don't want to increase the...
4
by: Peter Wullems | last post by:
I have created a schema to vallidate SOAP messages the first couple of lines are as follows: <?xml version="1.0" encoding="utf-8" ?> <SOAP-ENV:Envelope xmlns:SOAP-...
0
by: EagleRed | last post by:
I have written a Web service that I must access from a modified VC++ 6.0 console application. I am using the SOAP Toolkit version 2.0. I am using the HttpConnector, and the SoapSerializer to...
0
by: pmclinn | last post by:
In the .net designer wrote a proceedure named 'Fireitup'. How do I call on this proceedure from client javascript.
6
by: Vikram | last post by:
I have added some input elements on a page using javascript at client side. when i submit the page, i am unable to access the values of input elements created using request.form. Are elements...
1
by: JTrigger | last post by:
I need to call a .Net web service that takes an array or object as a parameter from a PERL client. I have been trying to use the PERL SOAP::Lite package to do this without success. I can call one...
8
by: Mark | last post by:
Hi... I used wsdl.exe to generate some wrapper classes from someone's soap web service, and I'm looking for some way to look at what the soap request packet actually looks like. The webservice...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.