• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: RE: Small real not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: RE: Small real not working


  • Subject: RE: RE: Small real not working
  • From: "Amandeep Singh" <email@hidden>
  • Date: Mon, 9 Apr 2007 17:29:22 -0600
  • Thread-topic: RE: Small real not working

Thanks. I am using apple script to connect to a web service (developed using AXIS and Java) using SOAP. The web service method accepts a complex data type, one of which is a float (as defined in WSDL).

On script side, I create a record (to simulate complex data type) and send SOAP request (listed below). "CPUSpeed" parameter is defined as "float" in WSDL. If I send the value as "0" or "1" or any integral value, it is automatically type-casted into float. However, if I give some floating point value as "2.4" or "1.2", axis throws an exception saying "Could not convert java.lang.Double to bean field 'CPUSpeed', type float". I tried giving the value as "1.0 as small real", but the error was the same.

-- SET THE DEFAULT VALUES
property SOAP_Endpoint_URL : "http://amandeep-rd-xp:8080/axis/services/myservice";
property SOAP_app : "soap"
property method_namespace_URI : "mynamespace"
property SOAP_action : ""

set method_name to "isHostEnabled"

set hostSummary to {|CPUSpeed|:1, |noOfCPUs|:1, |RAMInstalled|:1}

set method_parameters to {|host|:hostSummary}
copy my SOAP_call(SOAP_Endpoint_URL, method_name, method_namespace_URI, method_parameters, SOAP_action) to {call_indicator, call_result}
if the call_indicator is false then
	beep
	display dialog "An error occurred." & return & return & call_result buttons {"Cancel"} default button 1
else
	display dialog "Host enabled - " & call_result buttons {"OK"} default button 1
end if

on SOAP_call(SOAP_Endpoint_URL, method_name, method_namespace_URI, method_parameters, SOAP_action)
	try
		using terms from application "http://www.apple.com/placebo";
			tell application SOAP_Endpoint_URL
				set this_result to call soap ¬
					{method name:method_name ¬
						, method namespace uri:method_namespace_URI ¬
						, parameters:method_parameters ¬
						, SOAPAction:SOAP_action}
			end tell
		end using terms from
		return {true, this_result}
	on error error_message number error_number
		if the error_number is -916 then ¬
			set the error_message to "The script was unable to establish a connection to the Internet."
		return {false, error_message}
	end try
end SOAP_call

-----Original Message-----
From: Olof Hellman [mailto:email@hidden]
Sent: Monday, April 09, 2007 5:14 PM
To: Amandeep Singh; AS users
Subject: RE: RE: Small real not working

Amandeep -

Perhaps you can show us how you are sending a small real from "apple script",
and why you care about receiving a float instead of a double on the web service end.

- Olof

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Quark Spread Saving Question (From: Oakley Masten <email@hidden>)
 >Re: Quark Spread Saving Question (From: Shane Stanley <email@hidden>)
 >Small real not working (From: "Amandeep Singh" <email@hidden>)
 >RE: Small real not working (From: "Amandeep Singh" <email@hidden>)
 >RE: RE: Small real not working (From: Olof Hellman <email@hidden>)

  • Prev by Date: RE: Small real not working
  • Next by Date: Re: Image Events can't see Gray color space
  • Previous by thread: RE: RE: Small real not working
  • Next by thread: RE: Small real not working
  • Index(es):
    • Date
    • Thread