473,663 Members | 2,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Confused! Can I create an XML document from an XSD file?

I am confused. I was given a fairly complex xsd schema for use in a project.
When I added this to a website in VS 2005, it shows up in intellesense and I
can instantiate, manipulate it etc. with the following code in the BLL
layer:

public LXML CreateLXML(ref Tsrsubi1.Xormsg a2 etx)
{
LXML lxml = new LXML();
DateTime dt = DateTime.Now;
string lenderid = _dal.GetLenderI d(etx.orderHead er.custId.ToStr ing());
lxml.Order[0]._ProductType = "TSR";
lxml.Order[0]._OrderRef = etx.orderHeader .orderNo.ToStri ng();
lxml.Status[0].MessageCode = "1050";
lxml.Status[0].MessageTextCod e = "QRY";
lxml.Status[0].MessageDesc = "Order Query";
lxml.Request[0].RequestDate = dt.ToString("yy/MM/dd");
lxml.Request[0].ClientTransact ionID = etx.clientTrans actioId.ToStrin g();
lxml.Request[0].TradingPartner ID = "LAS";
lxml.Request[0].TradingClientI D = lenderid +
etx.orderHeader .custId.ToStrin g();
return lxml;
}

When I pass this to a method in the DAL for use in a Web Service call, it
compiles fine as:

public void SendOrderKeyToB izTalk(LXML lxml)
{
XmlDocument xml = new XmlDocument();
xml.Load(lxml.G etXml());
XmlNode node = xml.DocumentEle ment;
TaxWS.Taxws ws = new TaxWS.TaxCertws ();
ws.PortOperatio n(node);
}

However, I am unable to recognize the LXML when the same XSD file is added
to a class project (as oppossed to Web Site).

The bottom line is I want to be able to use the schema to add values to a
XML document and pass it to the Web Service from a project class... Can I do
this?
Jan 24 '06 #1
1 1533
I believe dropping the .xsd in a web project will fire off a custom build
provider to compile the .xsd into a typed-dataset class which gives you the
strong typed object shown in your code below. To be able to use that class
in a class library, I believe you'd want to use the xsd.exe tool to generate
the typed dataset and share that library in your solution.

Ron

"Ray Stevens" <nf*@nospam.com > wrote in message
news:ea******** ******@tk2msftn gp13.phx.gbl...
I am confused. I was given a fairly complex xsd schema for use in a
project. When I added this to a website in VS 2005, it shows up in
intellesense and I can instantiate, manipulate it etc. with the following
code in the BLL layer:

public LXML CreateLXML(ref Tsrsubi1.Xormsg a2 etx)
{
LXML lxml = new LXML();
DateTime dt = DateTime.Now;
string lenderid = _dal.GetLenderI d(etx.orderHead er.custId.ToStr ing());
lxml.Order[0]._ProductType = "TSR";
lxml.Order[0]._OrderRef = etx.orderHeader .orderNo.ToStri ng();
lxml.Status[0].MessageCode = "1050";
lxml.Status[0].MessageTextCod e = "QRY";
lxml.Status[0].MessageDesc = "Order Query";
lxml.Request[0].RequestDate = dt.ToString("yy/MM/dd");
lxml.Request[0].ClientTransact ionID = etx.clientTrans actioId.ToStrin g();
lxml.Request[0].TradingPartner ID = "LAS";
lxml.Request[0].TradingClientI D = lenderid +
etx.orderHeader .custId.ToStrin g();
return lxml;
}

When I pass this to a method in the DAL for use in a Web Service call, it
compiles fine as:

public void SendOrderKeyToB izTalk(LXML lxml)
{
XmlDocument xml = new XmlDocument();
xml.Load(lxml.G etXml());
XmlNode node = xml.DocumentEle ment;
TaxWS.Taxws ws = new TaxWS.TaxCertws ();
ws.PortOperatio n(node);
}

However, I am unable to recognize the LXML when the same XSD file is added
to a class project (as oppossed to Web Site).

The bottom line is I want to be able to use the schema to add values to a
XML document and pass it to the Web Service from a project class... Can I
do this?

Feb 20 '06 #2

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

Similar topics

6
1578
by: Paul C-T | last post by:
I've read the newsgroups on this ... the PHP website and I'm still confused .... I am parsing a variable $howmany to a for / loop to print out multiple form fields with similar names ... for ($t = 1; $t < $howmany; ++$t) { print '<TR><TD>Enter field ' . $t . '</TD><TD><INPUT TYPE="text" NAME="field' . $t . '"></TD></TR>'; }
5
5474
by: Haoyu Zhang | last post by:
Dear Friends, Python assignment is a reference assignment. However, I really can't explain the difference in the following example. When the object is a list, the assignment seems to be a reference. However, when the object is a number, the story is so different. I don't understantd for what reason Python deals with them differently. The example is as follows: >>> a = >>> b = a
2
2612
by: Brian Roberts | last post by:
I'm confused about the use of hasattr/getattr, or possibly namespaces. I know how to do this: class UnderstandThis(object): def do_foo(self): pass def do_bar(self): pass def doit(self, cmd): funcname = 'do_' + cmd if hasattr(self, funcname): getattr(self, funcname)()
9
2239
by: vijay | last post by:
Hello, I am new to C Programming and just started reading K&R. I was about to finish the pointers chapter but got very confused with: 1. int arr; >From what I have read, arr is a pointer to the first int and &arr is a pointer to the whole array of 10 ints. Then why does sizeof(arr) gives 40 while sizeof(&arr) gives 4. Shouldn't is be the other way around.
13
1833
by: Marvin | last post by:
Hi: I have been programming with OOP and C++ for over 10 years but I am new to javascript. I am very confused about one aspect and would appreciate it if someone could explain the differences between the following 2 groups of "statements": function myFunc (x) { a = 1;
11
3907
by: timmu | last post by:
Someone asked me a question about integer division and printf yesterday, I tell him he should do a casting to float/double before you do any interger division. But he doesn't think so, so I try to do some example to explain, However, after some trying, I confused when I try to do some integer constant division, I know I should do float division something like 3.0/6.0, but I'm still confused where the -0.124709 comes for the following...
4
1471
by: SteveW | last post by:
Now that vista and the 3.0 framework are gold, I'm a bit confused, so any clarification would be very helpful. The 3.0 framework is gold and is downloadable etc. What is not 'gold' and 'supported' is the WCF/WPF addons to vs2k5. But here's where I get confused. If I have vs2k5 source code. which contains 3.0 'code', on a pc which does not have the WCF/WPF addons. It compiles, runs, has intellisense etc. etc. etc.
2
2493
by: abshirf2 | last post by:
Hello all, I am really confused, please help! :( I have tomcat 5.5 installed on my machine and i have the JDK/JRE installed. Everything is working fine. Now what i want to do is install php on this server so i can run and test some scripts, i've written. Can someone please direct me on how to do this? Or give me a link to HOWTO or a tutuorial please. I am confused because i've already done a search on installing php and i've seen...
0
1886
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the form every thing works fine: checking items by code as well as checking with mouse: Using the CheckdItems Property is confused too.
2
6825
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the form every thing works fine: checking items by code
0
8345
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,...
0
8858
Oralloy
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...
0
8771
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8634
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7371
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
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
2
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.