Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27349

VS 2012 Have to make some XML to send off

$
0
0
I've made a quick proof-of-concept app that talks with a web service API - using some XML.

I tested it with code like this

Code:

        Dim postString As String = "<?xml version='1.0'?><txtsig_request version='2.0'>"
        postString &= "<credentials><api_username>xyz</api_username><api_password>abc123</api_password>"
        postString &= "<client_id>789</client_id></credentials>"
        postString &= actionString
        postString &= "</txtsig_request>"

How can I make this exact same kind of XML using a proper XML method?

My production code is going to pass in the un and pw and client_id - so I am either doing a bit of string manipulation here or doing it the proper way.

I have used XDOCUMENT to load up the returned XML stream - just to pop it into a multi-line text box for now (again proof-of-concept time here).

Can I use XDOCUMENT to make this XML string - and really make sure it looks 100% like the example they gave me (as shown in the hardwired strings above)

Viewing all articles
Browse latest Browse all 27349

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>