Hi All,
I have a Web Service, which returns a DataSet and I am able to consume.
This is ok.
Now I want to return two things,
1. DataSet
2. String
Through one request only, I thot of using object as a return type to the
webservices but then how do I re cast it to string and dataset. Will that
work.
I tried with object array it didn't work with that, it says "implement
IConvertible"
Any Idea how do we use and consume the same.
Regards,
Shailesh Gajare 5 1369
Hi SMG,
you could add another table to the DataSet, which holds the string
reference. Or you can (as you described) a object-array:
....
return (new object [] { myStringValue , myDataSet });
....
You can read it as follows:
if (myResult != null && myResult.Length == 2)
{
localDataSet = myResult [1];
localString = myResult [0];
// do something you want with the references
}
Regards
Patrick
"SMG" wrote: Hi All, I have a Web Service, which returns a DataSet and I am able to consume. This is ok.
Now I want to return two things, 1. DataSet 2. String Through one request only, I thot of using object as a return type to the webservices but then how do I re cast it to string and dataset. Will that work. I tried with object array it didn't work with that, it says "implement IConvertible"
Any Idea how do we use and consume the same.
Regards, Shailesh Gajare
You could always return a class. The code below shoe show the idea.
Class ReturnMe
public DS as Dataset
public Str as string
end class
class WebServiceClas( )
.....
<webmethod> public function ReturnData(...) as ReturnMe
......
end class
"SMG" <SM*@nodmain.co m> wrote in
news:ez******** ******@TK2MSFTN GP14.phx.gbl: Hi All, I have a Web Service, which returns a DataSet and I am able to consume. This is ok.
Now I want to return two things, 1. DataSet 2. String Through one request only, I thot of using object as a return type to the webservices but then how do I re cast it to string and dataset. Will that work. I tried with object array it didn't work with that, it says "implement IConvertible"
Any Idea how do we use and consume the same.
Regards, Shailesh Gajare
You could always return a class. The code below shoe show the idea.
Class ReturnMe
public DS as Dataset
public Str as string
end class
class WebServiceClas( )
.....
<webmethod> public function ReturnData(...) as ReturnMe
......
end class
"SMG" <SM*@nodmain.co m> wrote in
news:ez******** ******@TK2MSFTN GP14.phx.gbl: Hi All, I have a Web Service, which returns a DataSet and I am able to consume. This is ok.
Now I want to return two things, 1. DataSet 2. String Through one request only, I thot of using object as a return type to the webservices but then how do I re cast it to string and dataset. Will that work. I tried with object array it didn't work with that, it says "implement IConvertible"
Any Idea how do we use and consume the same.
Regards, Shailesh Gajare
Thanks JD
But for that, the end user who are using my webservices should be aware of
such classes or I need to give that class file as well along with the
description of the web service.
Is it the right way to do it?
what does Best Practices suggest?
Regards,
Shailesh
"JD" <in*****@email. com> wrote in message
news:Xn******** *************** ******@199.45.4 9.11...
You could always return a class. The code below shoe show the idea.
Class ReturnMe
public DS as Dataset
public Str as string
end class
class WebServiceClas( )
.....
<webmethod> public function ReturnData(...) as ReturnMe
......
end class
"SMG" <SM*@nodmain.co m> wrote in
news:ez******** ******@TK2MSFTN GP14.phx.gbl: Hi All, I have a Web Service, which returns a DataSet and I am able to consume. This is ok.
Now I want to return two things, 1. DataSet 2. String Through one request only, I thot of using object as a return type to the webservices but then how do I re cast it to string and dataset. Will that work. I tried with object array it didn't work with that, it says "implement IConvertible"
Any Idea how do we use and consume the same.
Regards, Shailesh Gajare
The class will be exposed to the users, once you have your webmethod
return the class back.
Users code:
(make sure once you compile you webservice to update your web ref)
Dim a as new WebServ.WebServ iceClas
'This will be automatically created in the WSDL
Dim b as ReturnMe
b = a.ReturnData()
'Do whatever and refernce you want to the objects
b.DS()
b.Str
As far as Best Practice I'm not sure, I need to retrieve about 6 pieces
of data, orginally tried structure but that didn't work, but found an
article on microsoft that suggeted using this.
"SMG" <SM*@nodmain.co m> wrote in
news:OZ******** ******@tk2msftn gp13.phx.gbl: Thanks JD
But for that, the end user who are using my webservices should be aware of such classes or I need to give that class file as well along with the description of the web service.
Is it the right way to do it? what does Best Practices suggest?
Regards, Shailesh "JD" <in*****@email. com> wrote in message news:Xn******** *************** ******@199.45.4 9.11... You could always return a class. The code below shoe show the idea.
Class ReturnMe public DS as Dataset public Str as string end class
class WebServiceClas( ) .... <webmethod> public function ReturnData(...) as ReturnMe ..... end class
"SMG" <SM*@nodmain.co m> wrote in news:ez******** ******@TK2MSFTN GP14.phx.gbl:
Hi All, I have a Web Service, which returns a DataSet and I am able to consume. This is ok.
Now I want to return two things, 1. DataSet 2. String Through one request only, I thot of using object as a return type to the webservices but then how do I re cast it to string and dataset. Will that work. I tried with object array it didn't work with that, it says "implement IConvertible"
Any Idea how do we use and consume the same.
Regards, Shailesh Gajare
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: TK |
last post by:
Hi,
I need help on datagrid. I have a dataset exposed as a webservice. I do
have a web application that is supposed to consume the service on a
datagrid.
|
by: jib |
last post by:
Hi,
I am trying to send an Access database table containing a OLE field through
ASP.NET (web services) to a client (being a Word Macro). The table consists
of four columns with the first three being simple strings and the last one
my OLE object. The web service gets called by a Word macro - using the
debugger in Word, I can see the webservice returning with all info except
the fourth column. Whats going on?
Thanks for any info.
|
by: Bruce Hodge |
last post by:
Hi,
We have a couple of clients who are having trouble connecting to .Net
webservices, (they're coming from PHP and VFP). We were looking to provide
a diagonostic tool that displayed the soap message submitted so that if the
call failed they could compare their SoapMessage with the ones we generate
in .Net.
Thought the solution was an HttpModule hooked into begin request, but after
approx 10 requests it hangs the webservice/aspnet...
|
by: Prozon |
last post by:
Hi!
I have problem naming my webservices. One of the problem is that I got
naming conventions between my webservices and dataset that the
services uses.
Can someone please give me a good example of how to name a
webservice-class which handles articles for example?
And what is a good name for the "corresponding" dataset/s used? By now
the name of the dataset is just Article.
What is a good name for the webreference?
|
by: Pasho |
last post by:
hi
I have been facing problem using C# webservices (secured using SSL).
In my webservice(secured with SSL)
It works fine if I try to access data from database through dataset.
If I try to confirm the dataset with schema using following line
ds.ReadXMLSchema(schema) and then access data through dataset
schema is a url to my xsd file.
schema = https://localcomputer/sample/trace.xsd
| |
by: nixon |
last post by:
Hi there!
Im trying to build a 3 tier application that uses a smartclient in the
"view" layer.
The communication between the smartclient and the server should be
webservices because of potentiel firewall issues.
I´ve looke at to smartclient demos to figure out how the experts do the
stuff, design and overall architecture, Microsofts IssueVision and
TaskVision.
These applications uses DataSet´s to communicate between the layers and
|
by: smarty |
last post by:
Hi,
I have written a WSE in vis studio 2005 as and produced a dll that I can use
in other projects by including the following in the web.config.
<webservices>
<soapextensiontypes>
<add type="traceextension, simpleModule" priority="1" group="high"/>
</soapExtensionTypes>
</webservices>
|
by: Daniel |
last post by:
I wrote a pretty neat website today that can utilize no postback
AJAXIAN type features.
Basically to populate a drop down with a web service call that hits a
SQL server, based off the change of another drop down.
<%@ Page Language="C#" Title="Call Update" AutoEventWireup="true"
CodeFile="UpdateCall.aspx.cs" Inherits="Call_UpdateCall" %>
|
by: =?Utf-8?B?SXbDoW4gUMOpcmV6?= |
last post by:
Hi there,
I have a question that has been raised on how an application should handle
the data that is travelling through a three-layered application.
Our data is going to be handled by Dataset object(s), and the data to be
handled is as follows:
We have N Companies with data, which is distributed among 1 table with all
the data that is similar on all Companies, and 1 table for each Company that
has specific data to store, so in case we...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |