Home Backend Development XML/RSS Tutorial XML-RPC experience detailed explanation

XML-RPC experience detailed explanation

Mar 16, 2017 pm 04:53 PM

I went to Yuanzi today and found that Yuanzi already supports the WebBlog function of Office2007, so I took a look and used XML-RPC technology. Open dudu XML-RPCPRC#API It feels like WebService, but after a closer look, it turns out it's not. That's when I noticed that XML-PRC is working. What is XML-RPC (don’t laugh at me for being ignorant), fortunately I only know googleXML-RPCIt turned out to be like this:

What’s XML-RPC?
It's a spec and a set of implementations that allow software running on disparate operating systems, 
running in different environments to make procedure calls over the Internet.
It's remote procedure calling using HTTP as the transport and XML as the encoding. XML-RPC is designed to be as simple as possible, 
while allowing complex data structures to be transmitted, processed and returned.
Copy after login


Simply put, it uses HTTP as the transmission protocol and XML as the data content to implement a standard for remote method invocation. (Very similar to WebService). For details, please refer to the standards of XML-PRC http://www.xmlrpc.com/ I won’t say more here .

Since it is a standard, someone will definitely implement it. Go to http://sourceforge.net/ I searched and it turned out to be the case, but unfortunately there is no implementation of .Net. Let’s take a look at the implementation of dudu. Found thisCookComputing.XmlRpc indudu#API , haha, it should be him. GoogleI love you so much, you helped me find it http://www.cookcomputing.com/blog/index.html , haha, it turns out that cookcomuting implemented XML-PRC under .Net . , let me experience itXML-PRC.

下载源代码后,运行里面的Math这个SampleVery Cool使用这个Liberry非常简单,感觉比Remoting还要简单,遗憾的是现在的版本由于.Net Framework的原因现在只支持Framework 1.1不支持Framework 2.0,在说明中会在以后版本支持 Framework 2.0

哈哈,大家赶快去体验吧。

体验之后发现XML-PRC.Net客户端实现代理模式挺有意思,决定研究一下。打开源代码发现使用的是动态创建Assembly的技术,也就是该技术导致了不支持Framework2.0的原故。


从上面的图(画的不好请见谅)看出客户端通过
XmlRpcProxyGenCreate方法创建了一个实现YourInterface的类,同时继承XmlRpcClientProtocol,在这里使用了AssemblyBuilder具体可以查看MSDN。然后把YourInterface的方法全部由XmlRpcClientProtocol的一个Invoke的方法代理,该函数的签名如下:

public object Invoke(string MethodName,params object[]Parameters)
Copy after login

哈哈,这回终于找到关键所在了,在Invoke方法里面就可以按照XML-RPC的标准通过WebRequest对象调用远程的方法了。

The above is the detailed content of XML-RPC experience detailed explanation. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Can I open an XML file using PowerPoint? Can I open an XML file using PowerPoint? Feb 19, 2024 pm 09:06 PM

Can XML files be opened with PPT? XML, Extensible Markup Language (Extensible Markup Language), is a universal markup language that is widely used in data exchange and data storage. Compared with HTML, XML is more flexible and can define its own tags and data structures, making the storage and exchange of data more convenient and unified. PPT, or PowerPoint, is a software developed by Microsoft for creating presentations. It provides a comprehensive way of

Solution to the inability to connect to the RPC server and the inability to enter the desktop Solution to the inability to connect to the RPC server and the inability to enter the desktop Feb 18, 2024 am 10:34 AM

What should I do if the RPC server is unavailable and cannot be accessed on the desktop? In recent years, computers and the Internet have penetrated into every corner of our lives. As a technology for centralized computing and resource sharing, Remote Procedure Call (RPC) plays a vital role in network communication. However, sometimes we may encounter a situation where the RPC server is unavailable, resulting in the inability to enter the desktop. This article will describe some of the possible causes of this problem and provide solutions. First, we need to understand why the RPC server is unavailable. RPC server is a

Convert XML data to CSV format in Python Convert XML data to CSV format in Python Aug 11, 2023 pm 07:41 PM

Convert XML data in Python to CSV format XML (ExtensibleMarkupLanguage) is an extensible markup language commonly used for data storage and transmission. CSV (CommaSeparatedValues) is a comma-delimited text file format commonly used for data import and export. When processing data, sometimes it is necessary to convert XML data to CSV format for easy analysis and processing. Python is a powerful

Handling errors and exceptions in XML using Python Handling errors and exceptions in XML using Python Aug 08, 2023 pm 12:25 PM

Handling Errors and Exceptions in XML Using Python XML is a commonly used data format used to store and represent structured data. When we use Python to process XML, sometimes we may encounter some errors and exceptions. In this article, I will introduce how to use Python to handle errors and exceptions in XML, and provide some sample code for reference. Use try-except statement to catch XML parsing errors When we use Python to parse XML, sometimes we may encounter some

Python parsing special characters and escape sequences in XML Python parsing special characters and escape sequences in XML Aug 08, 2023 pm 12:46 PM

Python parses special characters and escape sequences in XML XML (eXtensibleMarkupLanguage) is a commonly used data exchange format used to transfer and store data between different systems. When processing XML files, you often encounter situations that contain special characters and escape sequences, which may cause parsing errors or misinterpretation of the data. Therefore, when parsing XML files using Python, we need to understand how to handle these special characters and escape sequences. 1. Special characters and

How to handle XML and JSON data formats in C# development How to handle XML and JSON data formats in C# development Oct 09, 2023 pm 06:15 PM

How to handle XML and JSON data formats in C# development requires specific code examples. In modern software development, XML and JSON are two widely used data formats. XML (Extensible Markup Language) is a markup language used to store and transmit data, while JSON (JavaScript Object Notation) is a lightweight data exchange format. In C# development, we often need to process and operate XML and JSON data. This article will focus on how to use C# to process these two data formats, and attach

Using Python to implement data verification in XML Using Python to implement data verification in XML Aug 10, 2023 pm 01:37 PM

Using Python to implement data validation in XML Introduction: In real life, we often deal with a variety of data, among which XML (Extensible Markup Language) is a commonly used data format. XML has good readability and scalability, and is widely used in various fields, such as data exchange, configuration files, etc. When processing XML data, we often need to verify the data to ensure the integrity and correctness of the data. This article will introduce how to use Python to implement data verification in XML and give the corresponding

How to use PHP functions to process XML data? How to use PHP functions to process XML data? May 05, 2024 am 09:15 AM

Use PHPXML functions to process XML data: Parse XML data: simplexml_load_file() and simplexml_load_string() load XML files or strings. Access XML data: Use the properties and methods of the SimpleXML object to obtain element names, attribute values, and subelements. Modify XML data: add new elements and attributes using the addChild() and addAttribute() methods. Serialized XML data: The asXML() method converts a SimpleXML object into an XML string. Practical example: parse product feed XML, extract product information, transform and store it into a database.

See all articles