problem with returning values in webservice

hello

i have a web method which returns an array of decimal,and i call it in java script function,

is there anyway to return different types in return? ive tried to return a class but in java script i couldnt get results,also what should i do if i have a data-table as result which has different dimension everytime,

this is java function

function load2me()

{ read_location.GetLocation(onSuccessme,onError); }

------------------------------------------------------------------------------------

function onSuccessme(result){

var lon = result[0];

var lat = result[1];

var speed=result[2];

var direction=result[3];

......}

------------------------------------------

webmethod

[WebMethod(EnableSession=true)]public decimal[] GetLocation()

{.......

con.Close();

decimal[] array1=new decimal[10];

array1[0] = e1/18000; array1[1] = e2/18000;

array1[2] = e3; array1[3] = e4;

array1[4] = e51; array1[5] = e52; array1[6] = e53; array1[7] = e54;

array1[8] = e55; array1[9] = e56;

return array1;

}

 

thanks.

0
Samiraek
6/7/2007 3:31:09 PM
asp.net.networking-webservices 2181 articles. 0 followers. Follow

1 Replies
748 Views

Similar Articles

[PageSpeed] 51
Get it on Google Play
Get it on Apple App Store

You can return a custom type (class) so long as it's serializable.  If it's a really complex type (e.g. nested arrays / dictionary objects) then you might need to roll your own json converter for it.

0
paul
6/7/2007 5:16:39 PM
Reply:

Similar Artilces:

how to retrieve a value which is returned by a webservice method by using the webservice behavior
Hello Mate,                     I am using the webservice behavior to call a webservice method through internet. but i have a problem in getting a value which is returned from a webservice method. the jscript shown below is not working. Could u please help me in this ? This is my web method:<WebMethod(True)> _ Public Function add(ByVal a As Integer, ByVal b As Integer)Return a + b End Function  This is my jscript file: Function add() {  service.useService("GridTasks.a...

powerbuilder wsdl return value .Net webservice
The function GetInvoiceIDsByCustomer() returns an any variable (array). I had expected we could use allways a string as we did with easysoap. This is not excepted. In some cases we have to use a longlong, in other cases a string. I had expected powerbuilder would automatically convert the longlong to a string. Why differs this between EasySoap and .Net. Thanks Eric Solved this one by using an any array. Thanks Eric ontsnapt wrote: > The function GetInvoiceIDsByCustomer() returns an any variable (array). > > I had expected we could use allways a string a...

Problem reading values of custom class objects that are returned in a generic list from a webservice
On the client-side I am trying to access properties of objects that have been returned in the array. I am able to get the array, with the correct number of objects, but when I try to access their properties, I get an empty string. I'm including parred down version of my code. I'm getting a little frustrated with the lack of good documentation (but I understand it's in beta...) and I haven't found anything online that has solved my problems, so I thought I'd try here. Any help is very appreciated! The custom class: namespace Company{    public class Section   ...

return more than value from webservice
Hi I have a webservice that first of all return a string value, then I would like to return a boolean value which is set after the initial function is ran. But this boolean value never changes. Is it possible at all to return more than one value from a webservice?    hi modig, As you told first you want to return a string and then you wan to send a boolen value which  is set after the initial function is ran. So, can you write another function that return an arraylist object. The another function will run after the initial function finishes running. ...

Problem calling a secure Webservice from another Webservice
The situation is as follows: I have a library VRKModule which calls an external Webservice requiring a Client Certificate. Function VRKModule.VRKQuery(string): 1    public void VRKQuery(string SSN)2            {3                XmlSerializer Serializer;4                MemoryStream Stream;5                try6 &n...

autocomplete return values from webservice
Hi all,  I'm trying to put an autocompleter on a textbox and I'm stuck.The autocomplete is there, but in my webserver I do the following (just for test)         Dim products(5) As String        products(0) = "test"        products(1) = "ibiza"        products(2) = "formentera"        Return (products) and on the Return I get 'value of type 1-dimensional array...

webservice returns multiple values
Hi Friends! i have a webmethod which takes two inputparameters and returns one value to the calling application. Now i have to  return two values to the calling application. simply how to return two variables through a webmethod which accpts two input parameters.... Thanks in Advance!!! Hi, with ASP.NET webservices, you have simple data types and complex data types which can be used to passed to and returned from web methods. You could return an array or use a dataset. Please read for more info http://www.dotnetjunkies.ddj.com/quickstart/aspplus/doc/webservicetypes.aspxVishal H...

problem with returning from webservice to js
This is probably a very basic question, yet I'm stuck on it for quite some time now.I have a serializable class that implements Arraylist, I only added a public/private (tried both) string attribute (_Success) and a public property to address that attribute. (Success)Now what i want to do is return an object of this type from the getmessages() method in my webservice and access that result in my onGetMessagesComplete(result) method. Anyway so far so good.I receive the object in the onGetMessagesComplete method, I even see all the messages that I added to the object on the server side, ho...

Secure the data in XML (returned by a webservice) during Webservice calls
          My website has a flash object which call a webserviec which returns a xml back to flash.  How can i secure the data which is passed through the XML.  That is I dont want any users read the xml which i am giving to falsh object using any tools like fiddler, fire bug etc... Please give me your valuable suggestions and IdeasRegards    Hi, check this URL regarding secured web service   http://msdn2.microsoft.com/en-us/library/aa302428.aspx...

this webservice does not return value from the function
Hello PB Gurus, I'm trying to call following web service provided in JRUN4 webserver samples. id = reservation.reserve(in0,in1,in2,in3,in4,in5) Powerbuilder 10 (build 8011) can invoke this webservice successfully ( I can able to verify this using the web server log), but powerbuilder unable to capture the return value from this service. I'm getting error like "Could not find element by name : id". I suppose to get the reservation number from this function. Please help me. Thanks Raj Thambusamy Hi All, any idea about this issue ? -Raj...

Problem while returning array in webservice
I am trying for some time now but no success . I had a following requirement. I am creating a web service where I am returning an Array from it . There is no compilation Error. But when I am trying to view tha same in browser(while testing my service) I am dealing with following errorYou must implement a default accessor on System.Array because it inherits from ICollectionAny Help on this? ThankSAS   Are you using the keyword "Array" for the variable that is being returned? If so , try defining your webmethod's return value as an explicit defined str...

Ajax.NET WebService problem
Hi community,   I am making a site that follows the exact same procedure found at http://aspnetpodcast.com/CS11/blogs/asp.net_podcast/archive/2008/05/01/asp-net-podcast-110-integrating-asp-net-ajax-with-google-maps.aspx , and it works fine when I compile and run it under localhost. (The setup is : Master page with a <ScriptManager> which points to a WebService (.asmx) file. Then the main asp.net page (.aspx) has a few javascript functions, which call methods from the .asmx file.)  When I upload to our IIS server, and try view it across the internet, the page loads, but does...

Webservice does not return value from the function
Hello PB Gurus, I'm trying to call following web service provided in JRUN4 webserver samples. id = reservation.reserve(in0,in1,in2,in3,in4,in5) Powerbuilder 10 (build 8011) can invoke this webservice successfully ( I can able to verify this using the web server log), but powerbuilder unable to capture the return value from this service. I'm getting error like "Could not find element by name : id". I suppose to get the reservation number from this function. Please help me. Thanks Raj Thambusamy sorry for the duplicate - Ignore this ple...

Problem in Sending XML to Secure WebService from Another Webservice...
hi, I am facing the problem in sending xml to seucre web sevice from another web service. Here is the exact situation, that we have a web application that is going to connect with the webservice. In this webservice we have a funcation that is going to send string as xml format to another secure webservice. the secure webservice accepts out request string (xml format) and send response as strng(xml format) to the pervious webservice. In each time when call the secure webservice from first webservice we have the requestid. For this requestid the seucre webservic...

Web resources about - problem with returning values in webservice - asp.net.networking-webservices

webservices Articles, Posts, Blogs, Videos - Technorati
— Authority: The job consist in a PHP program that read a file, compose a message (email or sms) and call an API of email provider (Amazon SES) ...

Section: software:webservices
Wired.com © 2012 Condé Nast. All rights reserved. Use of this Site constitutes acceptance of our User Agreement (effective 3/21/12) and Privacy ...

Products - CrunchBase
Product profiles

App Search on Flickr - Application Sharing!
Flickr is almost certainly the best online photo management and sharing application in the world. Show off your favorite photos and videos to ...

Wikipedia:Press coverage 2005 - Wikipedia, the free encyclopedia
If you add an article, please cite both the title and the source. Note that if you're listing an article from a traditional press wire service ...

Entity–relationship model - Wikipedia, the free encyclopedia
In software engineering , an entity-relationship model ( ER model for short) is an abstract and conceptual representation of data . Entity-relationship ...

Entity-relationship model - Wikipedia, the free encyclopedia
In software engineering , an entity-relationship model ( ER model for short) is an abstract and conceptual representation of data . Entity-relationship ...

IT and Telecommunications Jobs in Melbourne Metro - MyCareer
Find IT and Telecommunications Jobs in Melbourne Metro on MyCareer. Fresh IT and Telecommunications Jobs posted daily. Free email alerts and ...

AWS Elastic Beanstalk: A Quick and Simple Way into the Cloud
Flexibility is one of the key principles of Amazon WebServices - developers can select any programming language and software package,any operating ...

How To Use the Amazon SDK for Android to Upload Photos to Amazon S3
This article demonstrates how to use the AWS SDK for Android to upload an image to Amazon Simple Storage Service (S3) from your mobile device ...

Resources last updated: 12/3/2015 4:32:34 AM