Rafa,
Muchas gracias! ![]()
Rafa,
Muchas gracias! ![]()
Antonio Linares wrote:Rafa,
Muchas gracias!
*--// Para WebService Saludar (Regresa el clásico Hola Mundo)
cLink:='http://localhost/saludar.asmx/Saludar?WSDL'
*--// Para WebService CaF (Convierte de Celsius a Fahrenheit, devuelve un valor Double)
cLink:='http://localhost/saludar.asmx/CaF?valor=45'
*--// Para WebService FaC (Convierte de Fahrenheit a Celsius, devuelve un valor Double)
cLink:='http://localhost/saludar.asmx/FaC?valor=120'
cTipVar:='string'
do case
case 'WSDL'$cLink; cTipVar:='string'
case 'CaF' $cLink; cTipVar:='double'
case 'FaC' $cLink; cTipVar:='double'
endc
*--// Consumiendo Web Service a traves del metodo HTTP GET
objXML:=CreateObject("Microsoft.XMLDOM")
objXML:async:=.F. // El analizador no devolverá el control a su código hasta que el documento se haya cargado
if objXML:Load( cLink )
? objXML:getElementsByTagName( cTipVar ):item(0):text
else
? 'Error ' +str(oBjXML:ParseError:ErrorCode)+CRLF+;
'Descripción '+oBjXML:ParseError:Reason +CRLF+;
'Línea ' +str(oBjXML:ParseError:Line) +CRLF+;
'URL ' +oBjXML:ParseError:Url +CRLF+;
'Fuente ' +oBjXML:ParseError:srcText
endi<%@ WebService Language="C#" Class="HolaMundoWebS" %>
using System.Web.Services;
[WebService(
Namespace="http://localhost/",
Description="Hola, Mundo al estilo Web Service")]
public class HolaMundoWebS {
[WebMethod(Description="Devuelve la cadena Hola, Mundo")]
public string Saludar() {
return "Hola, Mundo";
}
[WebMethod(Description="Convierte de Fahrenheit a Celsius, devuelve un valor Double")]
public double FaC(double valor)
{ const double fc = (5.0 / 9.0);
return ((valor - 32) * fc);
}
[WebMethod(Description="Convierte de Celsius a Fahrenheit, devuelve un valor Double")]
public double CaF(double valor)
{ const double fc = (5.0 / 9.0);
return (valor / fc + 32);
}
}<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
Web Site Administration Tool to configure settings for your application. Use
the Web site->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings/>
<system.web>
<customErrors mode="Off"/>
<webServices>
<protocols>
<add name="HttpGet"/>
<remove name="HttpPost"/>
<add name="HttpSoap"/>
<add name="Documentation"/>
</protocols>
</webServices>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
<authentication mode="Windows"/>
-->
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
-->
</system.web>
</configuration>Rafa, Joel,
Muchas gracias a ambos! ![]()
ALguien sabe como usar el <![CDATA[]] para crear archivos xml, agradeceria su ayuda
Rafa, tengo una consulta de soap,
tengo un xml de respuesta que que trae un archivo adjunto, en SOAPUI lo puedo ver pero como puedo extraerlo mediante fivewin, este es el xml de respuesta y que tiene un adjunto.. a ver si me puedes orientar,, gracias
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header xmlns:work="http://bea.com/2004/06/soap/workarea/">
<cl:token xmlns:cl="cl.zofri.sve">0e2099080517762c4--3bc04e97-f4-c-1303-0a88 a2d1-7f43-7:6434ab958b9:a6545-e40b9280507561c6-23-c-4090-147cc1-04-3ab80acd -3f13274673:af948495a95:5</cl:token>
<cl:respuesta xmlns:cl="cl.zofri.sve">
<java:resCodigo xmlns:java="java:cl.zofri.sve.utl.bo">0</java:resCodigo>
<java:resMensaje xmlns:java="java:cl.zofri.sve.utl.bo">Se ejecuto correctamente el servicio.</java:resMensaje>
<java:resSeveridad xmlns:java="java:cl.zofri.sve.utl.bo">O</java:resSeveridad>
</cl:respuesta>
<work:WorkContext xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">
<java class="java.beans.XMLDecoder">
<string>weblogic.app.sveProcDocEAR</string>
<int>214</int>
<string>weblogic.workarea.StringWorkContext</string>
<string>r43.3</string>
<string>weblogic.app.KNAEar</string>
<int>214</int>
<string>weblogic.workarea.StringWorkContext</string>
<string>r43.2</string>
<string/>
</java>
</work:WorkContext>
</env:Header>
<env:Body>
<m:exportarBorradoresResponse xmlns:m="http://cl/zofri/sve/prd/wsn">
<m:return>
<Include href="cid:return=216af389-dcc9-4770-80fb-610304b481e0@http://cl/zofri/sve/prd/wsn" xmlns="http://www.w3.org/2004/08/xop/include"/>
</m:return>
</m:exportarBorradoresResponse>
</env:Body>
</env:Envelope>
<![CDATA[]] se utiliza para incrustar JavaScript en HTML ![]()
Gracias Manuel, por la respuesta..
Pero mi inquietud va por otro lado en estos momentos, no se si tu ya resolviste este problema con webservice de que cuando este te contesta con un xml y trae un archivo adjunto, como logro traer ese archivo para poder ver que contiene...