473,404 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

How do I create an xml file and execute in c#...

UPS Rates & Service is an xml method of requesting rates on shipping
out boxes from the "checkout" point of online shopping cart software.
Well, I have gotten my c# project all the way to the point of having
all this information stored in variables ready to place in UPS Rates &
Service xml.
How do I create and activate an xml file from within my c#
application?
Can I build it with strings then save it as a file and execute it
somehow?
Any help is appreciated.
Thanks,
Trinity

Apr 6 '07 #1
4 3088
There are a number of ways to do this, but in your particular case I'd say
your best bet is to have a "template" xml saved as a file, with the elements
that are supposed to be filled in for UPS being blank.

You would load the into an XmlDocument class instance using the Load method,
and then, using XPATH methods, you would "fill in" the values before posting
it to the UPS WebSite.

Example:

myUpsXmlDocument.SelectSingleNode("//weight").InnerText= myWeight.ToString();

Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"trint" wrote:
UPS Rates & Service is an xml method of requesting rates on shipping
out boxes from the "checkout" point of online shopping cart software.
Well, I have gotten my c# project all the way to the point of having
all this information stored in variables ready to place in UPS Rates &
Service xml.
How do I create and activate an xml file from within my c#
application?
Can I build it with strings then save it as a file and execute it
somehow?
Any help is appreciated.
Thanks,
Trinity

Apr 6 '07 #2
On Apr 6, 8:38 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
There are a number of ways to do this, but in your particular case I'd say
your best bet is to have a "template" xml saved as a file, with the elements
that are supposed to be filled in for UPS being blank.

You would load the into an XmlDocument class instance using the Load method,
and then, using XPATH methods, you would "fill in" the values before posting
it to the UPS WebSite.

Example:

myUpsXmlDocument.SelectSingleNode("//weight").InnerText= myWeight.ToString();

Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net

"trint" wrote:
UPS Rates & Service is an xml method of requesting rates on shipping
out boxes from the "checkout" point of online shopping cart software.
Well, I have gotten my c# project all the way to the point of having
all this information stored in variables ready to place in UPS Rates &
Service xml.
How do I create and activate an xml file from within my c#
application?
Can I build it with strings then save it as a file and execute it
somehow?
Any help is appreciated.
Thanks,
Trinity- Hide quoted text -

- Show quoted text -
Thank you, I will give this a try.
Trint

Apr 6 '07 #3
Hi Trinity,

As Peter said, creating a template file to begin with (Notepad is probably good enough for this) is a good starting point. I'm not familiar with UPS Rates @ Services but if what you call 'xml method' is really a webservice then the xml is probably just a description of what is expected as input for that method. If so, your best bet is to try to create a Web Reference to the service, and then hopefully you can use it as you would any other method.

XML is just text and can't be executed in any way. You can build it in any number of ways, but all it does is hold information in a format readable to a bunch of stuff.

On Fri, 06 Apr 2007 14:13:23 +0200, trint <tr***********@gmail.comwrote:
UPS Rates & Service is an xml method of requesting rates on shipping
out boxes from the "checkout" point of online shopping cart software.
Well, I have gotten my c# project all the way to the point of having
all this information stored in variables ready to place in UPS Rates &
Service xml.
How do I create and activate an xml file from within my c#
application?
Can I build it with strings then save it as a file and execute it
somehow?
Any help is appreciated.
Thanks,
Trinity



--
Happy coding!
Morten Wennevik [C# MVP]
Apr 6 '07 #4
On Apr 6, 9:07 am, "Morten Wennevik [C# MVP]"
<MortenWenne...@hotmail.comwrote:
Hi Trinity,

As Peter said, creating a template file to begin with (Notepad is probably good enough for this) is a good starting point. I'm not familiar with UPS Rates @ Services but if what you call 'xml method' is really a webservice then the xml is probably just a description of what is expected as input for that method. If so, your best bet is to try to create a Web Reference to the service, and then hopefully you can use it as you would any other method.

XML is just text and can't be executed in any way. You can build it in any number of ways, but all it does is hold information in a format readable to a bunch of stuff.

On Fri, 06 Apr 2007 14:13:23 +0200,trint<trinity.sm...@gmail.comwrote:
UPS Rates & Service is an xml method of requesting rates on shipping
out boxes from the "checkout" point of online shopping cart software.
Well, I have gotten my c# project all the way to the point of having
all this information stored in variables ready to place in UPS Rates &
Service xml.
How do I create and activate an xml file from within my c#
application?
Can I build it with strings then save it as a file and execute it
somehow?
Any help is appreciated.
Thanks,
Trinity

--
Happy coding!
Morten Wennevik [C# MVP]
ok, I'm working on it and will let everyone know what it looks like.
Thanks,
Trint

Apr 6 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Lauren Quantrell | last post by:
Is there a way to create a text file (such as a Windows Notepad file) by using a trigger on a table? What I want to do is to send a row of information to a table where the table: tblFileData has...
22
by: nobody | last post by:
hello everybody, is there a way of creating an array with help of a function that would accept the name of this array as a parameter and then create global Array type variable of that name? so...
9
by: Albretch | last post by:
.. I am trying to create a database in a MS Access DB via JDBC drivers. I have tried both sun.jdbc.odbc.JdbcOdbcDriver and ids.sql.IDSDriver From some reason both drivers Exceptions tell me...
1
by: Eric Wood | last post by:
We have an application that is accessed using shared drives, client executes program from server. We have already coded the program to create and save the a bat file either locally on the users...
2
by: Mikey | last post by:
Sample VB .NET source code to create mailing labels or customized letters using MS Word MailMerge This VB .NET source code will start MS Word and call methods and set properties in MS Word to...
7
by: Roemer | last post by:
Hi all I stumbled over a new problem: I have a programm with just a class that is asynchronous listening for network connections. As soon as someone connected, a new form needs to be created....
2
by: Michael | last post by:
Hello, I've created an ASP web page where users in our organization can create Active Directory computer accounts. The web page is running on a Server 2003 SP1 IIS 6 installation. The...
2
by: tanyali | last post by:
I am using Linux Suse10, php 5 . execute a shell script in a terminal, it works. output is a file with data . when I use it in php like this (code : php) : chdir("../file");...
1
by: henrymania | last post by:
Am writing a code for database backup....by backupservlet is as given below i get the following exception
0
by: kurtf | last post by:
Hope somebody could help me with the creation of a table in sqlite3 from python. I am developing an application that allows a user to import a data file and insert the data into a sqlite3...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.