Click here to Skip to main content
13,003,589 members (61,922 online)
Rate this:
Please Sign up or sign in to vote.
See more:

I have a server which is using a SOAP technology. It contains of forms and e.t.c. Also I have an application which find and replace text in files (in XML files) and save changes in new file. So, I need to call my server using application and replace the text in XML form and save it in my PC.
Here is the link of the same program+source. The difference is that my program has one more button, which is using to call server. This is code's part of my version:
private void button1_Click(object sender, EventArgs e)    
{                                                                                           Services.SAPUserInfo myObj = new MassFindAndReplace.Services.SAPUserInfo();        Services.Service s = new Services.Service(); 
            myObj = s.SAPgetUserInfoAll("2500036077");  }

Here is a part of XML:

<my:lg_code xmlns:my="#unknown">2500036077</my:lg_code>

For example, my program will find "2500036077" and will replace it to another string and will save the document in my pc. I added the web reference to my win form, and pasted the url of my intranet to it. So, now I am connected to server. But I don't understand how can I provide a data from server with my program?
I am a beginner in web services and C#, please help with this problem. Thank You.
Posted 18-Aug-11 2:40am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

When you reference a web service you don't need to parse the XML, the objects will be created for you through the generated proxy/client class.

You will then have a .NET object that you can modify the values of.

If you want, you can then save it out as XML using XmlSerializer[^]. This is a good doc with lots of explanation and good examples.

With the object in hand, you can then just do property assignment instead of search and replace.

There really should be any need to parse/edit the XML directly (unless there's a requirement here you've not yet listed). SOAP isn't meant to be something used by humans.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170626.1 | Last Updated 18 Aug 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100