Changes between Version 2 and Version 3 of XmlRpcPlugin/DotNet
- Timestamp:
- Jul 20, 2015, 4:03:10 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
XmlRpcPlugin/DotNet
v2 v3 1 = Accessing XmlRpcPlugin from C# =1 = Accessing XmlRpcPlugin from C# 2 2 3 It is possible to access Trac via the XmlRpcPlugin plug-in from Microsoft's .NET framework. This should work for any .NET language (including Visual Basic).The steps below are written in C#.3 It is possible to access Trac via the XmlRpcPlugin plug-in from Microsoft's .NET framework. This should work for any .NET language (including Visual Basic). The steps below are written in C#. 4 4 5 == Step 1. Install the Trac XmlRpcPlugin ==5 == Step 1. Install the Trac XmlRpcPlugin 6 6 7 see XmlRpcPlugin7 See XmlRpcPlugin 8 8 9 10 == Step 2. Download and compile XML-RPC.NET == 9 == Step 2. Download and compile XML-RPC.NET 11 10 12 11 [http://xml-rpc.net XML-RPC.NET] 13 12 14 15 == Step 3. Create a .NET project == 13 == Step 3. Create a .NET project 16 14 17 15 To your new project, add the library you just compiled (above) as a reference. 18 16 17 == Step 4. Create the interface 19 18 20 == Step 4. Create the interface == 19 It would be nice to have the complete WikiRPC described; for now, you can just piece together the methods you need as you need them. Create an interface that extends IXmlRpcProxy. In this example, the interface is named "Trac". Then declare methods that are tagged as XmlRpcMethod as shown below. 21 20 22 Some day it would be nice to have the complete WikiRPC described; for now, you can just piece together the methods you need as you need them. Create an interface that extends IXmlRpcProxy. In this example, the interface is named "Trac". Then, declare methods that are tagged as XmlRpcMethod as below. 23 24 I have included two examples. The first returns a list of all the pages on your wiki. The second posts a new page (or a new revision to an existing page) to the wiki. 21 I have included two examples. The first returns a list of all the pages on your wiki. The second posts a new page (or a new revision to an existing page) to the wiki. 25 22 26 23 {{{ … … 45 42 }}} 46 43 44 == Step 5. Application Code 47 45 48 == Step 5. Application Code == 49 50 Here's an example of how to use this. For simplicity, we'll just add a Main to the above 46 Here is an example of how to use this. For simplicity, we'll just add a Main to the above: 51 47 52 48 {{{ … … 80 76 }}} 81 77 78 == Step 6. Handling Certificate Problems (if any) 82 79 83 == Step 6. Handling Certificate Problems (if any) == 80 If your Trac uses https, make sure it has a valid, verifyable certificate. If you use a self-signed or expired certificate, all is not lost, but you have to take a few additional steps. 84 81 85 If your trac uses https, make sure it has a valid, verifyable certificate. If you use a self-signed or expired certificate, all is not lost, but you have to take a few additional steps. 86 87 First, you need to create a server certificate validation callback that always says the certificate is OK, even if it's really not. Example: 82 First, you need to create a server certificate validation callback that always says the certificate is OK, even if it's really not: 88 83 89 84 {{{