Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / September 2007

Tip: Looking for answers? Try searching our database.

Getting started help needed...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
baffled - 24 Sep 2007 19:10 GMT
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
Martin Honnen - 25 Sep 2007 13:48 GMT
> 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
[quoted text clipped - 10 lines]
> 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.

Signature

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/

baffled - 25 Sep 2007 15:20 GMT
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!
Martin Honnen - 25 Sep 2007 16:04 GMT
> 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
[quoted text clipped - 10 lines]
> 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>.

Signature

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/

Mads Bondo Dydensborg - 25 Sep 2007 19:35 GMT
>> So, can someone point me to a good article/sample that might demonstrate
>> how
[quoted text clipped - 7 lines]
> 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

Signature

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.