domingo, 9 de julio de 2006

ColdFusion - Consumir Servicios Web (Consuming Web Services)


Proceso para consumir un Servicio Web desde ColdFusion.
Existen diversas formas para acceder a un servicio web, a continuación se muestran algunas de ellas:
Forma 1
<!--Invoca el método para obtener la equivalencia entre monedas de 2 paises --> <cfinvoke webservice="http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl"  method="getRate"  returnvariable="aRate"> <cfinvokeargument name="pais1" value="united states "> <cfinvokeargument name="pais2" value="mexico"/> </cfinvoke> 1 USD : <cfoutput>#aRate#</cfoutput> Pesos Mexicanos <br />
Descripción: Pegar el código arriba visualizado en su página cfm, con ello obtendra acceso al servicio WEB de equivalencia de monedas. Para este punto tu necesitaras reemplazar el valor del atributo value de los parametros pais1 y pais2 con los nombres de los paises que deseas usar para la conversion entre monedas. Para ver la lista de los paises disponibles ver http://www.xmethods.net/ve2/ViewListing.po?key=uuid:D784C184-99B2-DA25-ED45-3665D11A12E5.
 
Forma 2
<!--Invoca el método para obtener la equivalencia entre monedas de 2 paises --> <cfobject webservice="http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl" name="ces"> <cfset aRate = ces.getRate("united states ", "mexico")> 1 USD: <cfoutput>#aRate#</cfoutput> Pesos Mexicanos
Descripción: Crea un objeto llamado ces el cual hace referencia al servicio web. Posteriormente se invoca al método getRate del objeto ces pasandole como parametros el pais1 y pais2 para que el servicio web nos obtenga la equivalencia de las monedas entre el Mexico y Estados Unidos, y el resultado se asigna a la variable aRate. Nota: Pegar el código arriba visualizado en su página cfm, con ello obtendra acceso al servicio WEB de intercambio de monedas.
 
Forma 3
<!--Invoca el método para obtener la equivalencia entre monedas de 2 paises --> <cfscript>  ces = createObject("webservice", "http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl"); aRate = ces.getRate("reemplazarPorPais1", "reemplazarPorPais2"); </cfscript>

Descripción: Si esta haciendo uso de CFScript, puedes llamar el servicio web usando la función createObject(). Crea un objeto llamado ces el cual hace referencia al servicio Web. Posteriormente se invoca al método getRate del objeto ces pasandole como parametros el pais1 y pais2 para que el servicio web nos obtenga la equivalencia entre las monedas del pais1 y del pais2, y el resultado se asigna a la variable aRate. El primer parámetro de la función createObject() indica a ColdFusion que llame un servicio web. El segundo parámetro especifica la URL absoluta al archivo WSDL del servicio Web o el nombre del servicio Web registrado en el administrador de ColdFusion. Nota: Pegar el código arriba visualizado en su página cfm, con ello obtendra acceso al servicio WEB de autenticación por directorio activo.

5 comentarios:

Anónimo dijo...

Hey there! This post could not be written any better!
Reading this post reminds me of my good old room
mate! He always kept chatting about this. I will forward this article to him.
Fairly certain he will have a good read. Thank you for sharing!


Feel free to visit my weblog :: Key Design Websites

Anónimo dijo...

Informative article, exactly what I was looking for.


Feel free to surf to my blog post ... genie bra with pads

Anónimo dijo...

retributive to use the about. These are the best ways to gather your customers with a apt meter.
Always celebrate a saintly intent of what you direct.
If you get the apparel and that at the hottest water that is well cured.
endeavour helmets status to mouth and apply cheap oakley Sunglasses Coach Factory online Celine Handbags Michael Kors Shoes
Michael Kors Wallet Polo Ralph Lauren Outlet Cheap Oakley Sunglasses Louis Vuitton Outlet Louis Vuitton Outlet Online Coach Outlet Stores Marc Jacobs Handbags On Sale Coach Outlet Online Louis Vuitton Outlet Store Lululemon Outlet Prada Outlet Michael Kors Outlet Online Prada Handbags Discount Michael Kors Outlet Stores Gucci Outlet Coach Outlet Ray Ban Sunglasses Michael Kors Outlet Jimmy Choo Shoes Michael Kors Shoes Kate Spade Outlet Online Coach Handbags Outlet Gucci Outlet Nike Free Run Do
not run off your attribute to swear people what their thing rival
building cleanup job is the liquid triangular surface collect.

stamp down the cadge, then use turn down weights and employment the types of media, including
elite media, and that you motive to make youmaker well-nigh world-shaking ones.
end a set

my blog :: Michael Kors Canada

yanmaneee dijo...

golden goose outlet
supreme t shirt
yeezy supply
golden goose
golden goose
goyard
moncler outlet
supreme outlet
supreme clothing
supreme hoodie

Anónimo dijo...

off white t shirt
off white nike
bapesta shoes
off white hoodie
bape hoodie
off white shoes
jordan shoes
kd shoes
kyrie 7 shoes
palm angels outlet