> 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