Re: Web services question from a beginner

2002-10-08 Thread Robert Polickoski

John,

I used DreamWeaverMX's automatic configure capability to get the following code:

cfinvoke 
 webservice=http://www.ejseinc.com/WeatherService/Service.asmx?WSDL;
 method=getDayForcastInfo
 returnvariable=aDayForcastInfo
cfinvokeargument name=day value=enter_value_here/
cfinvokeargument name=zipCode value=enter_value_here/
/cfinvoke

cfinvoke 
 webservice=http://www.ejseinc.com/WeatherService/Service.asmx?WSDL;
 method=getExtendedWeatherInfo
 returnvariable=aExtendedWeatherInfo
cfinvokeargument name=zipCode value=enter_value_here/
/cfinvoke

cfinvoke 
 webservice=http://www.ejseinc.com/WeatherService/Service.asmx?WSDL;
 method=getWeatherInfo
 returnvariable=aWeatherInfo
cfinvokeargument name=zipCode value=enter_value_here/
/cfinvoke

The structs are as follows:

cfset aDayForcastInfo=StructNew()
aDayForcastInfo.date
aDayForcastInfo.day
aDayForcastInfo.forecast
aDayForcastInfo.high
aDayForcastInfo.low
aDayForcastInfo.precipChance
aDayForcastInfo.typeDesc
aDayForcastInfo.iconIndex
cfset aExtendedWeatherInfo=StructNew()
aExtendedWeatherInfo.day1
aExtendedWeatherInfo.day2
aExtendedWeatherInfo.day3
aExtendedWeatherInfo.day4
aExtendedWeatherInfo.day5
aExtendedWeatherInfo.day6
aExtendedWeatherInfo.day7
aExtendedWeatherInfo.day8
aExtendedWeatherInfo.day9
aExtendedWeatherInfo.typeDesc
aExtendedWeatherInfo.info
cfset aWeatherInfo=StructNew()
aWeatherInfo.UVIndex
aWeatherInfo.dewPoint
aWeatherInfo.feelsLike
aWeatherInfo.forecast
aWeatherInfo.humidity
aWeatherInfo.lastUpdated
aWeatherInfo.location
aWeatherInfo.pressure
aWeatherInfo.reportedAt
aWeatherInfo.temprature
aWeatherInfo.visibility
aWeatherInfo.wind
aWeatherInfo.typeDesc
aWeatherInfo.iconIndex


I hope this helps.

Take care,
Robert
-- Original Message --
From: John Munyan [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Date:  Tue, 8 Oct 2002 13:18:40 -0700

Let me start by saying that I am a beginner with programming in general.

 

I am trying to configure consume a weather web service but am unsure
what is going wrong.  I have spent about 8 hours trying to get figure
this out and have thus far failed.  The problem I believe is that the
webservice has struct's and I am not dealing with them appropriately.  I
have reviewed what information there is (I believe) on consuming complex
web services and not found an example complete enough that I can
understand how different methods of consumption might apply to my
situation.

 

The web service I am attempting to use is:

 

http://www.xmethods.net/ve2/ViewListing.po;jsessionid=6kLVZKkGRqLBTCjYjr
Mspppz(QhxieSRM)?serviceid=147576

 

The WSDL is:

 

http://www.ejseinc.com/WeatherService/Service.asmx?WSDL

 

The code I am using is:

 

html

head

titleUntitled Document/title

meta http-equiv=Content-Type content=text/html; charset=iso-8859-1

/head

 

body

 

cfinvoke 

 webservice=http://www.ejseinc.com/WeatherService/Service.asmx?WSDL;

 method=getWeatherInfo

 returnvariable=aWeatherInfo

cfinvokeargument name=zipCode value=98102/

/cfinvoke

cfdump var = #aWeatherInfo#

/body

/html

 

The page itself can be viewed at.  It takes a couple seconds to load.  

 

http://www.attrition.ws/win1.cfm

 

I would appreciate any pointers about how to make this work, either
conceptual or practical.  Like I said I am new to Coldfusion and
programming in general and specifically am unsure what the implication
of consuming a web service  providing a (stuct (I think)is).  I am by no
means averse to reading information about how to get this working so if
you have the time to point me to any resources which might assist me
directly or indirectly I would value that very much.

 

Sincerely,

 

John 

 



~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com



RE: Web services question from a beginner

2002-10-08 Thread Michael Corbridge

John,

We've all spent '8 hours' getting to square one, so don't get discouraged.

Here's some code that accomplishes what you are after:

cfscript
ws = 
createObject(webservice,http://www.ejseinc.com/WeatherService/Service.asmx?WSDL;);
getLocation = ws.getWeatherInfo(98102).getLocation();
getForecast = ws.getWeatherInfo(98102).getForecast();
getTemprature =  ws.getWeatherInfo(98102).getTemprature();
getFeelsLike =  ws.getWeatherInfo(98102).getFeelsLike();
getVisibility = ws.getWeatherInfo(98102).getVisibility();
getPressure = ws.getWeatherInfo(98102).getPressure();
getDewPoint = ws.getWeatherInfo(98102).getDewPoint();
getUVIndex = ws.getWeatherInfo(98102).getUVIndex();
getHumidity = ws.getWeatherInfo(98102).getHumidity();
getWind = ws.getWeatherInfo(98102).getWind();
getReportedAt = ws.getWeatherInfo(98102).getReportedAt();
getLastUpdated = ws.getWeatherInfo(98102).getLastUpdated();
/cfscript


getLocation =cfoutput#getLocation#/cfoutputbr
getForecast = cfoutput#getForecast#/cfoutputbr
getTemprature = cfoutput#getTemprature#/cfoutputbr
getFeelsLike = cfoutput#getFeelsLike#/cfoutputbr
getVisibility = cfoutput#getVisibility#/cfoutputbr
getPressure = cfoutput#getPressure#/cfoutputbr
getDewPoint = cfoutput#getDewPoint#/cfoutputbr
getUVIndex = cfoutput#getUVIndex#/cfoutputbr
getHumidity = cfoutput#getHumidity#/cfoutputbr
getWind = cfoutput#getWind#/cfoutputbr
getReportedAt = cfoutput#getReportedAt#/cfoutputbr
getLastUpdated = cfoutput#getLastUpdated#/cfoutputbr


I am using cfscript because I feel that it is a more comfortable code to work with 
webservices.

A big hint: do a cfdump on 'ws.getWeatherInfo(98102)'

I hope this helps, and thanks for using webservices and CFMX!

michael d corbridge
macromedia
617.219.2307
[EMAIL PROTECTED]

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.



RE: Web services question from a beginner

2002-10-08 Thread Michael Corbridge

btw

cfscript
ws = 
createObject(webservice,http://www.ejseinc.com/WeatherService/Service.asmx?WSDL;);
objWs = ws.getWeatherInfo(02466);
getLocation = objWs.getLocation();
getForecast = objWs.getForecast();
getTemprature =  objWs.getTemprature();
getFeelsLike =  objWs.getFeelsLike();
getVisibility = objWs.getVisibility();
getPressure = objWs.getPressure();
getDewPoint = objWs.getDewPoint();
getUVIndex = objWs.getUVIndex();
getHumidity = objWs.getHumidity();
getWind = objWs.getWind();
getReportedAt = objWs.getReportedAt();
getLastUpdated = objWs.getLastUpdated();
/cfscript

is about 10x faster

hth,

michael d corbridge
macromedia
617.219.2307
[EMAIL PROTECTED]
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm