Getting started help needed...

I have to write a class library to interface with a vendor's XML service that 
works via https posts and responses.  The vendor provides request and 
response xsd files for the schema.  My library needs to provide a common 
interface to other apps that need the functionality from this vendor, but we 
want a common dll for use in both asp.net and windows forms apps.

I haven't really worked with xml much, and not at all where a separate 
entity provides a schema in this fashion.  I don't really want to hard-code a 
class(es) to abstract all of types defined in the schema because they will 
change occasionally.

So, can someone point me to a good article/sample that might demonstrate how 
to encapsulate a schema like this?  What is the best practice for 
implementing something like this...?  

Thanks in advance...
baffled
0
Baffled (8)
9/24/2007 6:10:28 PM
dotnet.xml 7266 articles. 0 followers. Follow

4 Replies
538 Views

Similar Articles

[PageSpeed] 40

baffled wrote:
> I have to write a class library to interface with a vendor's XML service that 
> works via https posts and responses.  The vendor provides request and 
> response xsd files for the schema.  My library needs to provide a common 
> interface to other apps that need the functionality from this vendor, but we 
> want a common dll for use in both asp.net and windows forms apps.
> 
> I haven't really worked with xml much, and not at all where a separate 
> entity provides a schema in this fashion.  I don't really want to hard-code a 
> class(es) to abstract all of types defined in the schema because they will 
> change occasionally.
> 
> So, can someone point me to a good article/sample that might demonstrate how 
> to encapsulate a schema like this?  What is the best practice for 
> implementing something like this...?  

You can use the wsdl.exe tool in the .NET framework SDK to automatically 
generate a proxy class for the web service from its WSDL description.
You can even, with Visual Studio, add a reference of the WSDL to your 
project to use a proxy class.
See <URL:http://msdn2.microsoft.com/en-us/library/w3h45ebk.aspx> for 
more details.



-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
9/25/2007 12:48:55 PM
Thanks, but is this really a web service that the vendor is providing...?  
There is no wsdl file, only an xsd that specifies the format of the xml to 
post to their webserver as a parameter called xmlData.  The reply/results 
come in the form of XML in the response object.

I've used the xsd.exe tool (I have to code in .net 1.1) to create a typed 
DataSet, but I don't really like to use those generated classes.  

What I'd really like to do is to be able to create an empty (no data, just 
structure) XML document based on the xsd file, then allow the various 
elements to be populated from the app by setting properties or providing a 
name-value argument, then have the xml generated by the class and posted to 
the vendor's server.  Then, if the schema changes, only the changed element 
assignments need to be updated...

Is there a way to do this without coding a bunch of add element calls that 
have the elements hard-coded?  Is it possible to do something like the pseudo 
code below:

dim xmlDoc as new xmlDocument
xmlDoc.UseSchema("http://thevendorsite.com/mySchema.xsd")

'assign some values to the elements defined by the schema
xmlDoc.NewData()  'add a new "row"
xmlDoc.AddData("Element1", "value of element1")
xmlDoc.AddData("Element2", "value of element2")
xmlDoc.SaveData()  'save the new data
dim str as stirng = xmlDoc.ToString 'writes the xml data as a string

Thanks!
0
Baffled (8)
9/25/2007 2:20:01 PM
baffled wrote:
> Thanks, but is this really a web service that the vendor is providing...?  
> There is no wsdl file, only an xsd that specifies the format of the xml to 
> post to their webserver as a parameter called xmlData.  The reply/results 
> come in the form of XML in the response object.
> 
> I've used the xsd.exe tool (I have to code in .net 1.1) to create a typed 
> DataSet, but I don't really like to use those generated classes.  
> 
> What I'd really like to do is to be able to create an empty (no data, just 
> structure) XML document based on the xsd file, then allow the various 
> elements to be populated from the app by setting properties or providing a 
> name-value argument, then have the xml generated by the class and posted to 
> the vendor's server.  Then, if the schema changes, only the changed element 
> assignments need to be updated...

Then look into XML serialization/deserialization, use xsd.exe to infer 
classes from the XSD schema, then in your .NET code you can use those 
classes, see 
<URL:http://msdn2.microsoft.com/en-us/library/90c86ass(VS.80).aspx>.

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
9/25/2007 3:04:24 PM
Martin Honnen wrote:

>> So, can someone point me to a good article/sample that might demonstrate
>> how
>> to encapsulate a schema like this?  What is the best practice for
>> implementing something like this...?
> 
> You can use the wsdl.exe tool in the .NET framework SDK to automatically
> generate a proxy class for the web service from its WSDL description.
> You can even, with Visual Studio, add a reference of the WSDL to your
> project to use a proxy class.
> See <URL:http://msdn2.microsoft.com/en-us/library/w3h45ebk.aspx> for
> more details.

Hi there.

I have a similar problem - I am writing the server end though.

My problem seems to be, that everything assumes the http requests to carry a
soap message. This is not the case for me, where the content of the http
post is, besides headers, an XML fragment, described in an xsd. I have no
problem generating the classes, and I can manually serialize the stuff, but
I would like to use remoting to carry the messages as pure non-soap XML. Do
you have any advice for me?

Regards,

Mads

-- 
Med venlig hilsen/Regards

Systemudvikler/Systemsdeveloper cand.scient.dat, Ph.d., Mads Bondo
Dydensborg
Dansk BiblioteksCenter A/S, Tempovej 7-11, 2750 Ballerup, Tlf. +45 44 86 77
34 
0
mbd5160 (6)
9/25/2007 6:35:51 PM
Reply:

Similar Artilces:

Crystal Report Writer Needed for Central Florida Assignment
A Central Florida client has about 300 Crystal reports that need to be modified in the next 3-4 weeks. We are looking for a consultant that can be onsite to work with the clients for testing and approval. If interested, email a brief resume on you, availability information, and rate requirements to me at rwhaley@ibgnet.com -- Richard L. Whaley Author / Consultant / MVP 2006-2008 Documentation for Software Users Get our Free Tips and Tricks Newsletter and check out our books at http://www.AccoladePublications.com ...

i get error 404 not found when trying to download
I'm trying to download nokia pc suite to windows xp to upload gallery onto the computer but get error message404 not found - how can i download this pc suite please -- Krysy Albutt Krysy Albutt wrote: > I'm trying to download nokia pc suite to windows xp to upload gallery > onto the computer but get error message404 not found - how can i > download this pc suite please Care to enlighten us how this pertains to: - 1) Microsoft 2) Publisher 3) Windows If you're having problems downloading from the *NOKIA* site where do you think you should be directing your ...

How to get Calendar to send me reminders
I have changed my e-mail address but for some reason I cannot get Calendar to send reminders to my new address - I think I have carried out all that is necessary to effect the changover but I am not getting reminders sent. Can anyone help please? Is the Calendar Live ID based and accessible at Calendar.live.com ? -- ....winston ms-mvp mail "Dabardevon" wrote in message = news:FDC2B3B2-EDE4-41B1-BFC4-C0F9ED59CFB9@microsoft.com... I have changed my e-mail address but for some reason I cannot get = Calendar to send reminders to my new address - I think I have...

Target.Offset(0, 36).Value Help
In the below, I use this to force the persons USERNAME to populate 36 rows to the right in a column I hide. This shows me who was in a spreadsheet and updating ONE specific column... Column AD. My question is this... Can I poulate a named range with their USERNAME. I want to insert a named range, then force the USERNAME there. (INSERT>NAME>DEFINE>) Private Sub Worksheet_Change(ByVal Target As Excel.Range) Const myRange As String = "ad7:AD90" 'Const myrange As String = "A3,A6,A8,A11,A16" On Error GoTo stoppit Application.EnableEvents = False...

Some recipients get the attachment, some get winmail.dat
This one has me baffled. We are using Exchange 2000 and Outlook 2000 and have been for 8 months. No previous problems with attachments (.doc, .xls, .jpg). About 2 weeks ago, we started hearing from certain recipients that the attachment wasn't arriving; instead they were getting an unreadable file called winmail.dat. MS says that this is because the sender is using Rich Text to format the email. We have changed the senders to use Plain Text and still have the same problem. If the email is sent to several recipients, some will get the attachment fine, some will not. This didn'...

need a date look here
This is a multi-part message in MIME format --=_NextPart_2rfkindysadvnqw3nerasdf Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Get all the hots girls @ www.pearlymae.com --=_NextPart_2rfkindysadvnqw3nerasdf Content-Type: text/html Content-Transfer-Encoding: quoted-printable <html> <head> <meta name=3D"GENERATOR" content=3D"Microsoft FrontPage 6.0"> <meta name=3D"ProgId" content=3D"FrontPage.Editor.Document"> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dwindow...

Help with 'Auto_Open' please...
SubThe first time I open my excel workbook, a macro automatically runs. Part of this macro eventually calls for the deleting of 'Sheet1' in the workbook. When the macro is finished running, I save the file. The second time I open the workbook, I want it to check to see if it contains a 'Sheet1'. If it does, 'Exit Sub', else do something else... I've pasted my VBA code below. Do you see anything wrong with it? Many thanks, Craig ---------------------------------- Private Sub Auto_Open() calcmod = Application.Calculation With Application ...

Help please
I screwed something up and need help big-time. Somehow the default position of the cursor when I start a new document - or Outlook mail message - is in the right center part of the page. In fact, if I even open a document, it's formatted with everything scrunched over to the right. I can backspace and get the cursor to the right and it's not a big problem on documents with simple formatting, but for some complex documents, simply backspacing makes the formatting even worse. HELP PLEASW. -- rpbilleaud For a start, see http://word.mvps.org/FAQs/AppErrors/BlankDo...

How to get the CScrollBar's Handle in CTreeCtrl?
Hey,All: I thought I have a problem when I trid to get the CScrollBar's handle from my CTreeCtrl extended handle. Can anybody tell me whether I can get the handle of the CScrollBar from the CTreeCtrl? Thanks in advance! Carl :-| Carl wrote: > Hey,All: > > I thought I have a problem when I trid to get the CScrollBar's handle from > my CTreeCtrl extended handle. > Can anybody tell me whether I can get the handle of the CScrollBar from the > CTreeCtrl? > > Thanks in advance! > Carl > :-| > > Sorry, it is not that simple. The scroll bars that...

A Crystal Beginner
I am using Crystal 9.2.4.77 and have loaded the Crystal enhancements. Now I want to do against the CRM database. What do I do? I thought I would create a data source to the CRM SQLserver, which I did, then connect to it through Crystal Reports. That works, but when I drill down on the AAA_MSCRM database to choose my tables, it shows me dbo as the only option (where did this come from??) and under that are just a few generic tables. No CRM tables. Something's not quite right. What am I missing? file - log on to aps server "KBLawson" <klawson@aetinc.com> wrote in ...

Cannot get fast forward or fast reverse to work with WMP 11
I am running Vista Home Premium on a HP G 217-EM Notebook which comes pre-installed with Windows Media Player 11. When I play cds and try to fast forward or fast reverse by keeping the fast forward or fast reverse buttons constantly depressed nothing happens. Why is this, and can anyone come up with a solution? Many thanks This doesn't work on my system either, so it's probably just a limitation of WMP. Fast forward and fast reverse should work fine when you rip the CD's to MP3 or WMA files, and play these files instead. Regards -- Tim De Baets http://www....

Get paid while you get online!!
I found a great Internet company - Cashfiesta.com - that has created a product everyone can benefit from. They pay you while you work or play on your computer. All you need to do is keep their software - the FiestaBar=99 - active while you are online. They even pay you when your friends are using their computers. Unlike other companies, Cashfiesta gives you control over how much money you earn. They have an individual payrate based on the number of Special Offers you sign up for. As some of these offers are free, you can increase your payrate up to 33 times without spending a penny. It's...

Help needed #7
Please Help me in the following :: For Example in Cell A1 I write (15860) Rupees '''Rupees is Pakistani Currency' now it should be divided into parts as under:::> A2 >> [heading is Thousands] > 15 A3 >> [heading is Five Hundreds] > 01 A4 >> [heading is Hundreds] > 03 A5 >> [heading is Fifty] > 01 A6 >> [heading is Tens] > 01 in this example the amount has been divided into parts that it has 15-notes of Tho...

Can't get auto-update (update) to install
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC I've been trying to manually check for updates to Word 2008, and I get a &quot;critical update&quot; notice, asking me to install auto-update. When I try to install it, I cannot. It just keeps repeating the attempt, in an &quot;endless loop.&quot; What to do? <br> Thank you. ...

help reading xml doc
I'm new to XML, so please bear with me. I'm using XPathNavigator and XPathNodeIterator to return a set of xml nodes from a document that looks like this: <root> <book title="Some Title"> <chapter> <title>Chapter 1</title> <starting_page>34</starting_page> <number_of_pages>15</number_of_pages> </chapter> <chapter> <title>Chapter 2</title> <starting_page>50</starting_page> <number_of_pages>15</number_of_pa...

Spreadsheet getting corrupted
Hello All: I have a relatively large spreadsheet. I am getting errors (see after my signature line). What could be causing these errors? Is it that the spreadsheet is too large? Thanks Deguza -------------------------------------------------------- Microsoft Office Excel File Repair Log Errors were detected in file 'C:\Documents and Settings\deguza\My Documents\sales\Sales_2006_2007.xls' The following is a list of repairs: Global PivotTable report information was repaired due to integrity problems. Global PivotTable report information was repaired due to integrity problems. Glo...

Reg getting the next IV Document Number field !
Hi, I am creating a window in dexterity similar to the item transaction entry window (Transactions>Inventory> Transaction Entry). In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field. I wanted to know if there is any function , or table that i can access to get the next document number in the new window that i am creating. Thanks, swetha -- swetha >In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field.< T...

Scaling XY charts with suppressed starting value
The autoscaling feature of the Excel graphing function seems to have (limited) mind of its own. I'm trying to graph Y-values in the -1.5 t 1.5 range and X-values from 190 to 410 with the minimum from 190 to 29 and the max value from 290 to 410. The autoscaling of Y works fine, but the X-axis always start at 0 while the high value properly sets the maximum. Of course, I could fi the minimum at 190, but that is not what I had in mind. Does anyone know how to overcome this limitation without using a macro -- Message posted from http://www.ExcelForum.com Per - You need to make an XY Sca...

Opening the help window
I have prototyped something before trying it for real in our application. I have this line in my prototype: ::HtmlHelp(GetSafeHwnd(), cHelpFile, HH_DISPLAY_INDEX, NULL); This opens the help system in a separate window, which I can always find later (with FindWindow) and direct to particular pages. Doing the above in the application gives me an unresolved external error, but I can't find anything to include that I'm not already including. MSDN doesn't mention what to include in the help page for HtmlHelp operation. What should I include? Or what am I missing? "GT&q...

Need to change data entered into cell. HELP ASAP!!
I have a list of over 7000 unique numbers (i.e. 123 or 77- 123). I need to add the letters "MH" in front of each number. Is there an easier way to do this than to click and edit each individual cell manually? Please help, anyone have any suggestions? Lots of thanks in advance. Hi one way (if you only have numbers): use acustom format : "MH"0 another way: in the adjacent column in row one (lets say in B1) enter the formula ="MH" & A1 copy this formula down After this select column B and copy the contents (CTRL+C). goto 'Edit - Paste Special' a...

Help!
I am not very skilled in Access and need to create a very basic form for quality assurance. I have the form set up with a set amount of questions and a score box next to each one. I have built an expression in the final box where I am able to add all of them and divide by the amount of standards to come up with the average. This is the problem: I need to be able to also include "N/A" as an answer and make sure that the question that has this will not be included in the final average. This could be different every time depending on the case. Some may have 1 or another may have 5...

Get notified when Out of Office is on
I am using Outlook 2007. With 2003, when returning from leave, I used to get a notification that the Outlook out of office was still on and asking me if I wanted to switch it off. This reminder no longer appears with 2007. How can I switch this setting on so that I get the notification? "Mary Ann" <MaryAnn@discussions.microsoft.com> wrote in message news:ED5533A7-D0EA-41B8-B1A0-A9D15FB6FD98@microsoft.com... >I am using Outlook 2007. With 2003, when returning from leave, I used to get > a notification that the Outlook out of office was still on and asking me ...

How do I get??
Sorry if this seems a fairly easy question to you guys. I have a spreadsheet and I need to get the current system time into a cell. The format of the time is hh:mm am/pm. Any assistance would be most helpful. Hi try =INT(NOW()) in this cell and format is to your needs -- Regards Frank Kabel Frankfurt, Germany PM wrote: > Sorry if this seems a fairly easy question to you guys. > > I have a spreadsheet and I need to get the current system time into a > cell. The format of the time is hh:mm am/pm. > > Any assistance would be most helpful. PM, in the cell you want pu...

Getting Control ID in Active X control
GetWindowLong return 0. You need to call GetDlgCtrlID from outside the activex control as the function available within the control returns an arbitrary value of zero. Take a look at this article http://xendra.ens.uabc.mx/~sinfante/loo/libro/ch17_4.htm particularly the paragraph preceeding the title "MFC and Ambient Properties". This really begs the question why you want the ID in the first place as activex controls have to be fully self containing to operate - with a few exceptions where sibling controls need to be able to locate each other. - Tim "ytv" <...

over VPN, it gets stuck when sending outgoing email
When I use VPN to connect to work from home, the outlook can not finish sending outgoing emails. The progress bar moves to the end but then stops there forever. It can never finish. The receiving of new incoming emails work fine. All other network functionality works, e.g. internet browsing, telnet, ftp, etc, all work fine. My system is win2k. I use linksys wireless DSL router. I'd appreciate any hint! Are you using Exchange server? I'd set up your mail profile to prompt you to work offline or online - when using VPN, work offline with scheduled syncs. If not using exchange, pos...