.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

reading the result of a web service (XML)

Posted By:      Posted Date: August 23, 2010    Points: 0   Category :ASP.Net

Hi all,

I registered for a service that returns me the geolocation of the visitor and i process it in my exe application (c#).

But i dont know how to read that data in cs?

Here is the link that i send : 


and returning page content ;  

<?xml version="1.0" encoding="UTF-8" ?>
  <provider>Turk Telekom</provider>

View Complete Post

More Related Resource Links

Reading Certificate information in Windows Service

Hi, I have created windows service application, While starting the service i try to get the user certificate information using follwoing code. It is return nothing. but when i try to call the same set of code using windows application it returns the certificate. Can you provide any suggestion on why Windows service call not returning the certificate information. How we can get the certificate information in windows service application.     Dim matchedCertificate As X509Certificate2 = Nothing     Dim store As New X509Store(searchConfig.StoreName, searchConfig.StoreLocationEnumValue) store.Open(   OpenFlags.ReadOnly Or OpenFlags.OpenExistingOnly)     Dim matchedCertificates As X509Certificate2Collection = CType(store.Certificates, X509Certificate2Collection)     Dim findValue As Object     ' Apply all search criterias     For Each searchCriteria As SearchCriteria In searchConfig.SearchCriteria     ' Resolve tokens in findValue findValue = ResolveTokens(searchCriteria.FindValue) matchedCertificates =   DirectCast(matchedCertificates.Find(searchCriteria.FindTypeEnumValue, findValue, False), X509Certificate2Collection)       Trace.WriteLine(String.Format("Found {0} certs with search criteria {1}={2}", matchedCertificates.Count, s

Binding Web Service Result in asp:gridview and enable sorting(paiging)

Hello everyoneI have web service and gridviewI'm binding it without problemcode: protected void Page_Load(object sender, EventArgs e) { GetCallsService wservice = new GetCallsService(); List<Call> list = wservice.getCalls(2); GridView1.DataSource = list; //GridView1.AllowSorting = true; GridView1.DataBind(); } But I want to enable sorting and(or) paging.   GridView1.AllowSorting = true; this doen't solves problem.everything worls fine if I'm usign sqlDatasource but when datasource is web service it doesn't wokdoes enyone know solution?

Service for reading custom DLQ in WCF MSMQ 4.0

Hi folks, i want to write the web service that will be read messages from DLQ.   As i understand if the message can not be delivered(there are other cases such as timeout, authentication etc.) from Client to Service, then message will be placed to DLQ(in this case i use custom DLQ), and DLQ Service will be called automatically.  I wrote the 3 services: client, service and DLQ Service, but  when i turn off the service(server) and make client calling service, then message is not placed to DLQ(appropriate methods not called in DLQ Service). But when i turn on service messages are delivered to service.  My code below :  // server app.config  <?xml version="1.0" encoding="utf-8" ?> <configuration>   <system.web>     <compilation debug="true" />   </system.web>   <!-- When deploying the service library project, the content of the config file must be added to the host's    app.config file. System.Configuration does not support config files for libraries. -->   <system.serviceModel>     <services>       <service name="Service.MyService" behaviorConfiguration="Service.Service1Behavior">         <host>   

calling web service from SSIS return result as null



I got this result

<Result>The result is null. Either the result is null or the Web method returns void.</Result> 
 when I calling web service from SSIS. I setup HTTP connection and tested without any problem; download WSDL without any problem; I did exactly as the link: http://msdn.microsoft.com/en-us/library/ms181267.aspx. From input editor, I selected service and method. For the chosen method, there will be 3 variables (1 input parameter, 2 output parameters). For the input variable, I defined the package variable as string, and copied XML content to the variable as the value. I will select this defined package variable as the input parameter. I then moved to defined output file.
 When I run the simple package, I will get the output file as result as above. What is wron

TableAdapter Fill() not returning result over WCF Service


Firstly I must mention I'm new to WCF and relatively new to .NET Development - so what I'm doing might not be the best way to do it.


My problem is that when I indirectly use a table adapter's Fill() over a WCF Service connection to fill a strongly typed DataTable - it fills the table, but in the calling function, the table remains empty.


I’m busy creating a proof-of-concept using Visual Studio 2010 Professional on Windows 7 Professional accessing MS SQL 2008.

I’m trying to create an n-tier setup and thus have the following 5 projects:

1. "MsSqlDataAccess" - a project containing the TableAdapters from a strongly typed dataset.

2. "Entity" - I've separated my DataSet from the "MsSqlDataAccess" to be in this project.

3. "Comm" - WCF Service using netTCPBinding.

 - This makes available GetUsers() and FillUsers().

 - FillUsers() can either take a dataset or a datatable.

 - Above mentioned methods call the applicable TableAdapter methods.

4. "Service" - a Windows Service hosting the WCF Service.

5. "WpfTestClient" - a WPF client consuming the service.


I can return a filled DataTable when I use the TableAdapter's Get() method via the WCF service's GetUsers() method.<

How to bind distinct values to DropDownList from DataSet (as a result of a web service call)?


Hi there,

I'm trying to bind a dataset (where the data is coming from a webservice) to a dropdownlist; the problem is that I'm getting duplicates in the list... how can I display distinct values only:

drp_Brand.DataSource = ds.Tables[0];
            drp_Brand.DataTextField = "Brand";
            drp_Brand.DataValueField = "Brand";



How to setup a ReceiveReply activity to receive the result of a WCF service operation?


I already figured out what I have to do to send a WCF message to a WCF service developed with .NET, but I could not get the result back to the workflow. I need to know what I have to do to get that result. 

I have a very simple test WCF service with following contract:

[ServiceContract(Namespace = http://www.juergen-bayer.net/samples/wcf)]
public interface IDemoService
  long Add(int value1, int value2);

The client application uses a workflow with a Send and a ReceiveReply activity. The WCF endpoint is configured in the config file:

   name="BasicHttpBinding_IDemoService" />

The Send activity is configured like follows:

Action="http://www.juergen-bayer.net/samples/wcf/IDemoService/Add" => This would also be the default value in my case

The parameters of the WCF message are placed in the content: 


C# reading Java/Php/SOAP service, WSDL generated file missing some namespace information

I'm trying to use a Web Service, which I believe is Java/php/SOAP, using C#.
I can connect and send fine, but the results, which are an array of information,
is null. The return is not instant, and I can get back errors.
I believe the problem is in the WSDL translation. The actual response coming back
does not line up with the WSDL generated code in reguards to namespaces. In
perticular, 'getCategoryTreeResponse' & 'getCategoryTreeResult' do not show up 
in the generated file.
I'm quite sure the WSDL file provided is poorly written but I have no control
over it. WSDL.exe only works when I pass a saved copy of the web service's
provided WSDL information due to the way it is called.

Reading configuration settings from service installer



not sure if this is the correct forum but anyway: I have a windows service and I am using the default settings stored in configuration file, like myservice.exe.config. Everything works fine when the service runs, but when I want to install or uninstall it via the installutil, the settings stored in myservice.exe.config are not read.  I guess this is because the installutil is the application being run, and loading my service assembly via reflection does not cause its configuration file to be read. Okay, but how can I do that? How can I cause the settings stored in app configuration file to be loaded during the installation phase of the service?



Reading XML data from Google GeoCode (Maps) Service v3


Google Maps API has upgraded their geocoding service. The old style had each data element in a unique node, so I was reading each node using SelectSingleNode. Now, the node names are all the same, so my VB.net program is not working accurately, except on the lat/long parameters because those are still unique.

Here is the link to an address and how the API responds: http://maps.googleapis.com/maps/api/geocode/xml?address=1210%20cassat%20av,%20jacksonville,%20fl,%20USA&sensor=true


and here is my code:

Dim uriRequest As New Uri(GoogleMapsAPI_URL & _address & _output)
            Dim geoRequest As HttpWebRequest = WebRequest.Create(uriRequest)
            Dim geoResponse As HttpWebResponse = geoRequest.GetResponse()
            Dim sr As New StreamReader(geoResponse.GetResponseStream(), Encoding.UTF8)
            'instantiate new xml document to hold the google geo resulting xml
            Dim geoXml As New XmlDocument()


            'Dim TitleNode As XmlNodeList = geoXml.GetElementsByTagName("address_component")

            'Get County (administrative_area_level_2)

            _GeoCounty = geoXml.Item("/GeocodeResponse/result/address_component/[type=administrative_area_level_2]")

            _GeoCountyData = _GeoCounty.InnerXml.ToString()


Reading XML got from consuming the Sharepoint List Web Service


Hi Experts,

I consumed a sharepoint web service, to query a List based in external server. (As explained in various Blogs)

This was easy and I was able to get the XML as result.

Now the problem is,  I want it in more readable format - as I have to bind into a DataGrid. Is it possible to render XML into DataSet or DataTable ?

My code is attached:

Dim wsListsItems As New mdart.Lists() 
'wsListsItems.Credentials = System.Net.CredentialCache.DefaultCredentials Dim credentials As NetworkCredential = New NetworkCredential("", "", "") wsListsItems.Credentials = credentials 'Instantiate an XmlDocument object. Dim xmlDoc As New System.Xml.XmlDocument() Dim listName As String = &q

Problem with reading byte array from stream in WCF Service


Hello i have WCF Service and at some point of my program i am getting pointer to byte array. I want to copy bytes from this byte array/pointer to another byte array and send it to client.


// EDIT : THis code is TOTALLY wrong  please see post under to see code and proper problem. Sorry for mistake.

 byte[] arrbyt = new byte[params.ActualSize + 1];
 int isize = Marshal.SizeOf(typeof(byte))*arrbyt.Length;
 IntPtr pt = Marshal.AllocHGlobal(isize);

 int ind = 0;
 while (read != 0)
 str.RemoteRead(out *(byte*)pt, size, out read);

 Marshal.Copy(pt, arrbyt, 0, isize);

//after that arrbyt is still empty but pt has good values in it. I tryied also with stackalloc and then IntPtr to it and then Marshal.Copy but the result was the same.

//Does any one had similar problem or have an idea how to copy bytes from pt to other array?

//edit RemoteRead is like ISequentialStream::Read M

Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

WCF Tip: Using Properties in Service Contracts

you'll notice all of the Service Contracts are implemented with interfaces containing only methods. For the longest time I thought that's all that was supported, until I thought about it a little more. In C# land, properties are simply wrappers around a get method and set method, so why wouldn't we be able to use properties in a service contract? Well the answer is we can.

Realizing a Service-Oriented Architecture with .NET

This article is meant to be a practical discussion guide to building a .NET application in a service-oriented architecture. We will consider real-world goals, real-world obstacles, and experience-based solutions. I quickly concede the approaches discussed here are not exhaustive or infallible. This paper is focused on application development, not application integration. We will specifically consider architectural issues and component design issues.

The Potential of Web Services

Web Service for uploading documents into SharePoint

WS UploadService is a web service written for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 and is meant for uploading documents into SharePoint. I have just uploaded the zip file to GotDotNet.com so it will take some time before the zip file appears in the list of downloads. For the time being, you can download the zip file from the following location

Reading and Writing Images From a Windows Mobile Database using UltraLite 10(C#)

Periodically I get a request for information on how to read and write binary data to a database running on Windows Mobile. If you search the Internet you can typically find examples that are available on Windows Desktops or allow you to read and write to a local file system. The problem is that it can take a bit of work to get this code to work on Windows Mobile accessing a database.

Ultimately you might be asking, why would I want to store and image in a database? Well in an environment where you synchronizing data between a local mobile database and a consolidated (central) database this can be extremely useful. Imagine if an insurance adjuster went to an accident scene, took a picture of a damaged car, loaded it into his Windows Mobile database and then replicated that image up to the Insurance headquarters for approval. All of this could be done in a very short period of time when using images in the database. Another good example might be a doctor who was waiting for a patient chart to become available. If you could store the image in a database this chart could be sent down to the doctor's device once it became available.

For this article I am not going to get into how to synchronize the images to and from a remote and central database as this is typically fairly straightforward when using a data synchronization technologies like MobiLink
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend