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.Xormsga2 etx)
{
LXML lxml = new LXML();
DateTime dt = DateTime.Now;
string lenderid = _dal.GetLenderId(etx.orderHeader.custId.ToString());
lxml.Order[0]._ProductType = "TSR";
lxml.Order[0]._OrderRef = etx.orderHeader.orderNo.ToString();
lxml.Status[0].MessageCode = "1050";
lxml.Status[0].MessageTextCode = "QRY";
lxml.Status[0].MessageDesc = "Order Query";
lxml.Request[0].RequestDate = dt.ToString("yy/MM/dd");
lxml.Request[0].ClientTransactionID = etx.clientTransactioId.ToString();
lxml.Request[0].TradingPartnerID = "LAS";
lxml.Request[0].TradingClientID = lenderid + 
etx.orderHeader.custId.ToString();
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 SendOrderKeyToBizTalk(LXML lxml)
{
XmlDocument xml = new XmlDocument();
xml.Load(lxml.GetXml());
XmlNode node = xml.DocumentElement;
TaxWS.Taxws ws = new TaxWS.TaxCertws();
ws.PortOperation(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? 


0
nfr1 (20)
1/24/2006 8:42:05 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
363 Views

Similar Articles

[PageSpeed] 24

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" <nfr@nospam.com> wrote in message 
news:eakLvaSIGHA.3036@tk2msftngp13.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.Xormsga2 etx)
> {
> LXML lxml = new LXML();
> DateTime dt = DateTime.Now;
> string lenderid = _dal.GetLenderId(etx.orderHeader.custId.ToString());
> lxml.Order[0]._ProductType = "TSR";
> lxml.Order[0]._OrderRef = etx.orderHeader.orderNo.ToString();
> lxml.Status[0].MessageCode = "1050";
> lxml.Status[0].MessageTextCode = "QRY";
> lxml.Status[0].MessageDesc = "Order Query";
> lxml.Request[0].RequestDate = dt.ToString("yy/MM/dd");
> lxml.Request[0].ClientTransactionID = etx.clientTransactioId.ToString();
> lxml.Request[0].TradingPartnerID = "LAS";
> lxml.Request[0].TradingClientID = lenderid + 
> etx.orderHeader.custId.ToString();
> 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 SendOrderKeyToBizTalk(LXML lxml)
> {
> XmlDocument xml = new XmlDocument();
> xml.Load(lxml.GetXml());
> XmlNode node = xml.DocumentElement;
> TaxWS.Taxws ws = new TaxWS.TaxCertws();
> ws.PortOperation(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?
> 


0
RYoung
2/20/2006 8:39:42 PM
Reply:

Similar Artilces:

i am so confused
As of day before yesterday, i was recieving and sending mail like i should, but now it says my username and/or password are inncorrect, and they are stored in the com, and my phone. i retyped them, and it says the same thing??? i just tried again, and it said the following: The connection to the server has failed. Subject 'hi', Account: 'pop.att.yahoo.com (1)', Server: 'smtp.att.yahoo.com', Protocol: SMTP, Port: 465, Secure(SSL): Yes, Socket Error: 10061, Error Number: 0x800CCC0E Pleas help.... anyone!!!!! i am lost without my e-mail!! Your settings look ...

Where I can download SR1a in spanish
Hi. I'm really desesperate. In my work we have a lot of Office 2000 license and I need to update de Office 2000 to SP3. But, first I need to update to SR1a and that file don't exist yet!!! :-( I don't understand the Microsoft politic. Can anybody help me to adquire the SR1a in spanish Thanks Hi tess, It appears you can obtain the SR1a installer (in spanish) here: http://office-2000-sr1.malavida.com/descargar Running that should download & install the correct SR1a update for your system. -- Cheers macropod [Microsoft MVP - Word] "tess" &l...

create a inventory of files on computer in excel
I want to pull up a list of files by folders and copy the details of this files into a inventory list in excel. Thus I can do a assement on Excel of dulicates and outdated files. couple of options here... http://makeashorterlink.com/?Y49E21ECA Jim Cone San Francisco, USA "Shanerrs" <Shanerrs@discussions.microsoft.com> wrote in message news:D36C1E65-194E-4232-AA2D-C26744538EF0@microsoft.com... > I want to pull up a list of files by folders and copy the details of this > files into a inventory list in excel. > Thus I can do a assement on Excel of duplica...

Exporting data in comma delimited format in text file
I have Excel 2002. How do you export columns of data in a comma-delimited text file? Thanks Try saving the file. Make sure you choose: "CSV (Comma delimetd)(*.csv)" as the file type. If you want to only save certain columns (or even just a certain range), copy those to a worksheet in a new workbook save that new workbook as a .CSV file. You could also write your own code to do exactly what you want. Here are some sites with sample code: J.E. McGimpsey's: http://www.mcgimpsey.com/excel/textfiles.html Earl Kiosterud's Text Write program: www.smokeylake.com/excel (o...

How can I view all messages
I've just switcehd over from Lotus Notes and have previoulsy been able to view all messages, tasks , calendar items etc in one list. This is useful if you have filed a message and then forgotten wihich folder it is in. Can you do this in Outlook? Carl <Carl@discussions.microsoft.com> wrote: > I've just switcehd over from Lotus Notes and have previoulsy been > able to view all messages, tasks , calendar items etc in one list. > This is useful if you have filed a message and then forgotten wihich > folder it is in. Can you do this in Outlook? Nope. Advanced Searc...

How do I minimize multiple Excel files to just one Excel icon on .
Just got Windows XP/Professional and Excel 2003 after being in an Office 2000 environment. In Excel 2000 when multiple worksheets were open and I minimized to my Taskbar only 1 Excel icon showed up. Now in Excel 2003, when I minimize, there is an icon for Each spreadsheet that I have open. Only want 1 icon since I do have multiple spreadsheet open in Excel often. <Tools> <Options> <View> tab, And *Uncheck*, "Windows In Task Bar", -- HTH, RD ============================================== Please keep all correspondence within the Group, so all may benefit...

Can the distribution list suppress individual names?
How can I get the distribution list suppress individual names in the TO: header? Other mailers allow the distribution group to show just "Mylist" (the name of the list) in each recipient's TO: header... Thanks. Personal Distribution Lists are always expanded by the Outlook client. Try putting the personal distribution lists in the BCC field and use something silly in the To field like "Friends <your_email_address_goes_here>" "Keyman" <Keyman@discussions.microsoft.com> wrote in message news:759D3CC2-D65A-4359-8F14-16E182823035@microsoft.co...

open money 97 data file with money 2000/2001
I try to open money 97 data file with money 2000 or 2001 and the error message I got is that the file can not be opened, the program is not properly installed. Please tell me how I can use the data file from money 97 in later version of money. Thanks. ...

No Personal Folder Files are currently open
Yesterday, I exported my contacts from Outlook 2003 to use on another PC. This export worked fine. Since then (may just be coindidence), when I try and back up my personal file using Outlook Personal Folders Backup, the "save backup" button is blank and clicking on options gives the legend "No Personal Folder files are currently open" The last succesful backup was 3 February at 22:36. Well, the Outlook file must be open as all e mail, calendar, contacts, tasks & notes are available and working. I do however have a "Personal Folders" listed at...

Can I print a publisher document in word format?
I want to email a document in publisher, but recipient doesnt have publisher on their computer, how else can I email the document. Can I change the document into word? Cathy <Cathy@discussions.microsoft.com> was very recently heard to utter: > I want to email a document in publisher, but recipient doesnt have > publisher on their computer, how else can I email the document. Can I > change the document into word? You could, but you wouldn't want to. Use a program like PrimoPDF (www.primopdf.com) to convert to PDF, then send them the PDF file (which can be opened in the ...

Text import wizard does import properly beyond text file line 1048
I have attempted again to get the text import feature of MS Excel 2007 to work using a really long (10,402,255 lines) ascii format text data files with two columns of fixed width fields. Despite the updates to the Excel 2007 program since I first tried this, the implementation of this feature remains pitiful. Here are my findings of how this feature of Excel behaves: 1. If you set up the text import to start on the first line of the text source file and put them into your worksheet starting on cell A1, then the importer will capture the first 1048576 lines and put them all into ...

collate rows from several files into one new master file
Hi, Can anyone please help. I have several different, single sheet spreadsheets and I need a way to collate these into one single Master spreadsheet, one row per sheet under the next and i need this to be automated either via macro or VBA. For Example: The empty Master spreadsheet has headings only. Lets say HeadingA, HeadingB through to HeadingZ for column Z. Now I have 3 single sheet .xls's: The first one has data in HeadingA, HeadingB and HeadingK The second has data in HeadingA, HeadingK, M and Q The third has data in A, M Q R and T Effectively, each original .xls wi...

Can I delete C:/WSUS?
Hi, I'm running SBS2008 Standard, with all service packs and updates. I have WSUS installed (of course) and moved the WSUS installation to my large D: drive where it happily consumes 15 GB of data. I notices that I have a C:\WSUS folder that takes up 3.7 GB, which isn't the end of the world but I'd like to save that space if possible. It contains C:\WSUS\UpdateServicesDbFile\SUSDB.mdf. Is is safe to delete this since "everything" has moved to the D drive? Thanks, - Mark That is your WSUS database file so you don't want to delete it. "Ps...

Can I delete WinSxS folder on Vista?
I have a PC running Vista, and can I delete C:\Windows\winsxs or the files in the folder? "Jacob Hnri" <jhnri4@gmail.com> wrote in message news:F3DCF012-975E-4F82-BAFA-A5C6941FBF69@microsoft.com... > I have a PC running Vista, and can I delete C:\Windows\winsxs or the files in the folder? You can delete anything if you really want to. If you do delete the winsxs folder I think you will have lots of problems. That's why Microsoft have restricted access to Windows folders and sub-folders to stop people like you from wrecking the Windows installation. ...

How can I identify a system uniquely using MFC code
Hi all, I am working on a MFC application. I need to identify every system which uses this application. How can I do this using MFC? Is there any unique identifier for a PC which can be retrieved using MFC? Thanks & Regards Sachin Bhave > I am working on a MFC application. I need to identify every > system which uses this application. How can I do this using MFC? Is there > any unique identifier for a PC which can be retrieved using MFC? You can find the computer SID in the registry. More details over here: http://www.sysinternals.com/Utilities/NewSid....

How can I insert the degree sign with F after it as a shortcut?
I know how to insert the degree sign but can I put in a degree sign with the F after it in a short keyboard stroke or two? You could make it an automatic text entry of various types (AutoText, AutoCorrect, AutoComplete As You Type, depending on your version of Word), or you could assign a keyboard shortcut to the degree sign in the Insert Symbol panel and then type the F. On Nov 26, 3:42=A0pm, Sharrietta <Sharrie...@discussions.microsoft.com> wrote: > I know how to insert the degree sign but can I put in a degree sign with = the > F after it in a short keyboard stroke...

SQL Server Error whilst creating new attribute
I've previously added a good number of custom attributes the Lead entity type, however whenever I try a add a new attribute since I receive the an error telling me that the attribute addition has failed and to check the Event Log for more information. In the Event Log is two related error events: (the first) dmLog: New size of the attribute ({FEC5CEBE-B6F3-4E3C-90E9- B1A1CB2333F5}) exceeds the SQL Server row limit of 8000 bytes. (second) dmLog: Failed to add new String attribute (CFSCL_ACCOUNTS_InvoiceType) to Lead entity. I've googled this error message and found a Microsoft...

Probs with creating multiple pivot charts from pivot table
Every new pivot chart report I create from a particular pivot table refreshes all the previous charts (which are on separate worksheets) to contain the same data. This is driving me nuts. I have created a pivot table on a new worksheet. Then using the information provided in the pivot table I created four different pivot chart reports (3D Pie) which looked great at first glance. BUT then I realised that everytime I ticked a different option on my drop down pivot field button it would change ALL of the other charts as well. Eg. From the pivot table I created a chart after selecting azale...

How do I import Microsoft Word files into Microsoft Excel?
I'm trying to import Microsoft Word files into 2003 Microsoft Excel, and am unable to do so. You can't import documents that are in Word format. You could save the Word documents in text format, then import them. Or, copy the data in Word, and paste it into Excel. Excel wrote: > I'm trying to import Microsoft Word files into 2003 Microsoft Excel, and am > unable to do so. -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html ...

Publisher Email Document Formatting Changes
I am trying to send a publisher file as the body of an email. When I preview the email, everything looks fine. When I send the email, any deisgn check issues cause the formatting to change, dramatically affecting the document. I cannot rectify some of the design check issues (such as overlapping). I cannot send the email as an attachment or PDF the document and copy and paste it into the email. Is there a way to override the design checker or prevent the formatting changes that come out when the email is sent? Meghan wrote: > I am trying to send a publisher file as the body of an ema...

Can't send mail to cin.net
Hi, We are using Exchange 2003 and though we had DNS troubles (i.e. with EarthLink, etc) when we first installed last year we've put those problems behind us long ago. But this week we can't send mail to a new customer using email on domain 'cin.net'. When my clients end email they get a message back from Exchange saying "Delivery Status Notification (Delay). I've done some Google searches on how to trouble shoot this and here is how far I've got but not sure what to try next. nslookup for mx returns 'oak.cin.net' telnet on port 25 to oak.cin.net ...

Can't create the item
I use Outlook from MS Office 2003 Business Edition. Everything has worked fine until the past few days. Now, whenever I click on an E-mail address link inside a webpage, I get a message from Outlook that says "Can't create the item." One person on this group gave me the following advice: >Close Outlook, find and rename the frmscache.dat to .old I did searches on all my drives and the file named above was not found. More thoughts? are you using the advanced option to search all hidden files and folders? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outl...

CListCtrl confusion
I am confused about the meaning of selected (LVIS_SELECTED) and focused (LVIS_FOCUSED). What is the difference? The above can be set/read with Set/GetItemState(). The there is also GetSelectionMark() and its set. When you get the selection mark, is this the one that is selected? Or does it mean something else? What I am able to do is click on a row and then execute my method, doit(). Now I want to simply use the up and down arrow keys to move the selection and focus up and down the list, each time calling doit() for the new row. The problem I am running into is that I get recursive calls to...

Can not save a file
Hello: I am trying to save an Excel 2003 spreadsheet into a folder which contains brackets. Example "C:\[My Folder]". Everytime I try to save it I get an error saying the file name is invalid due to the bracket, but there are no brackets in the file name. The path has brackets. I was able to save files here before. Does anyone have any idea how to get around this? Harrison Midkiff Looks like a bug in Excel. I don't have a good workaround. It seems that if you opened the workbook from this folder you can save it, if you do not change the file's name. So you&...

(more!) elementFormDefault confusion
Hi all, From what I can read, it doesn't look like I'm the only one getting confused with the elementFormDefault and attributeFormDefault properties of XML schemas. I am wanting to get a full understanding of these properties, as I want to be able to generate XML that conforms to these settings via the XmlTextWriter. The two main reference articles I can find are: http://geekswithblogs.net/dmillard/archive/2004/10/20/12935.aspx http://blogs.msdn.com/ebattalio/archive/2006/03/03/543154.aspx However, I have a couple of questions regarding this: 1. In Minty Fresh's example, w...