Read data from SQL server and convert it to XML in C#

Example code to Read data from SQL server and convert it to XML: using System; using System.Data; using System.Xml; using System.Data.SqlClient; using System.IO;   public class TestWriteXML { public static void Main() { String strFileName = c:/temp/out.xml; SqlConnection conn = new SqlConnection(server=localhost;uid=sa;pwd=;database=db); String strSql = SELECT name,age FROM people; SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand […]
Continue reading…

Enjoyed this post? Share it!

 
 

XML web services using visual studio2008

Create simple XML web services using visual studio2008
Continue reading…

Enjoyed this post? Share it!

 
 

XML-RPC Variable type detection

XML-RPC is clever enough to automatically detect the data type of the parameters passed to it in the xmlrpc_encode_request function. Example code: <?php $intvar = "77"; settype($intvar, "integer"); $req = xmlrpc_encode_request("NameOfRemoteCall’, $intvar); echo $req; ?> Output: <?xml version="1.0" encoding="iso-8859-1"?> <methodCall> <methodName>NameOfRemoteCall</methodName> <params> <param> <value><int>77</int></value> </param> </params> </methodCall>
Continue reading…

Enjoyed this post? Share it!

 
 

Create an XML-RPC Request with xmlrpc_encode_request

The process to create an XML-RPC request can be broken up into individual steps: Serialize the PHP data into XML-RPC format Create an XML-RPC request by combining HTTP headers and serialized data Make the call to the service The PHP function xmlrpc_encode_request can be used to serialize data and it creates the entire XML-RPC request […]
Continue reading…

Enjoyed this post? Share it!

 
 

XML-RPC Array Data Type

In XML-RPC, Numerically indexed arrays are passed as a single structure within the value element. Arrays are defined with a specific structure of child elements. Example Declaration: <params> <param> <value> <array> <data> <value><string>Two</string></value> <value><boolean>1</boolean></value> <value><double>42.307400</double></value> </data> </array> </value> </param> </params> The array tag defines the value of the parameter as an array, and the data […]
Continue reading…

Enjoyed this post? Share it!

 
 

XML-RPC Base64-Encoded Binary Data Type

To transfer binary information via XML-RPC we need to encode the data in base64 (serialization) and use the base64 tags as xml tags. Example Declaration: <param> <value> <base64>UHSYDhD1423Cc0Ad3NVP4OidTd8E1kRY5Edh</base64> </value> </param> Since PHP does not have a binary data type, developers need to encode files in base64 for XML-RPC transfer by using the file_get_contents function.
Continue reading…

Enjoyed this post? Share it!

 
 

XML-RPC Date/Time Data Type

An XML-RPC date/time data type is a primitive data type and specifies a date and a time value, up to the second. It follows the format YYYYMMDDTHH:MM:SS. using Year, month, day, hour, minute, and second conventions. The “T”, however, is a literal to separate Date and time representation. Since there is no date/time data type […]
Continue reading…

Enjoyed this post? Share it!

 
 

XML-RPC Integer Data Type

The integer is a primitive data type and is represented by a four byte signed integer. It is similar to the PHP data type integer. The integer tag can be represented as int or i4, for four byte integer. Example Declaration: <param> <value><int>42</int></value> </param> Alternate Example Declaration: <param> <value><i4>42</i4></value> </param>
Continue reading…

Enjoyed this post? Share it!

 
 

XML-RPC String Data Type

The string data type is the basic text string and is a primitive data type. It is similar to the string data type in PHP. Example Declaration: <param> <value><string>Hello,Visitor!</string></value> </param> The string data type most common data type in XML-RPC and any values of the value element without data type tags inside will default to […]
Continue reading…

Enjoyed this post? Share it!

 
 

PHP XML-RPC Responses

An XMP-RPC request can get two types of responses. One on successful execution of service, and one on erroring out. If an XML-RPC request was successful, we will receive the data we requested. If there was an error, a special XML-RPC fault message will be returned. Like regular web page requests response, a header will […]
Continue reading…

Enjoyed this post? Share it!

 
 

PHP XML-RPC Requests

XML-RPC requests are generally sent as HTTP POST requests and hence must have well formed HTTP POST headers. The actual remote call and parameters, in XML format, follows the header as the body of the HTTP request. POST /RPCexample HTTP/1.0 User-Agent: PHP5 XML-RPC Client (Mac OS X) Host: w3mentor.com Content-Type: text/xml Content-length: 181 <?xml version="1.0"?> […]
Continue reading…

Enjoyed this post? Share it!

 
 

PHP XML-RPC Introduction

XML-RPC is an easy and useful data transport mechanism for web applications. Requests and responses are formatted in standard XML and are easy to parse. It is simple for clients and service providers to implement this protocol. Inbuilt PHP functions for XML-RPC make it easy to work with XML-RPC data. RPC stands for remote procedure […]
Continue reading…

Enjoyed this post? Share it!