Skip to search.
XMLRPCNET · XML-RPC.NET

Group Information

  • Members: 437
  • Category: Open Source
  • Founded: Apr 3, 2002
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

  Messages Help
Advanced
How to connect to a stand-alone XML-RPC server   Message List  
Reply Message #68 of 1389 |
All,

I am trying to build an XML-RPC client in VB.NET and I want to know
how it is possible to connect to a stand-alone server. By stand-alone
server I mean a server not hosted on a web server. In fact the
XML-RPC server is a Perl script running under Linux (see
http://radio.weblogs.com/0111823/categories/mySoft
ware/2002/09/09.html#a47).
When I set the URI property (proxy.Url = "192.168.0.51:1234"), which
is not an URL, of the proxy, then run the program I get this error
message: "XML-RPC server exception: Invalid URI: The URI scheme is
not valid".
How should I set this property?

Here is the relevant snippet of code:

Imports CookComputing.XmlRpc
Imports System.Net

Public Class Form1
Inherits System.Windows.Forms.Form
Dim XmlRpcClient As CookComputing.XmlRpc.XmlRpcClientProtocol
Public Class GetPostProxy
Inherits XmlRpcClientProtocol
<XmlRpcMethod("getpost")> Public Function getpost(ByVal
NNTPServer As String, ByVal groupname As String, ByVal number As
String) As String
Return Invoke("getpost", New Object() {NNTPServer,
groupname, number})
End Function
End Class
Private Function HandleException(ByVal ex As Exception)
Dim msgBoxTitle As String = "Error"
Try
Throw ex
Catch fex As XmlRpcFaultException
MessageBox.Show("Fault response: " + fex.FaultCode + " "
+ fex.FaultString, msgBoxTitle, MessageBoxButtons.OK,
MessageBoxIcon.Error)
Catch webex As WebException
MessageBox.Show("Web exception: " + webex.Message,
msgBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Error)
Catch xmlrpcex As XmlRpcServerException
MessageBox.Show("XML-RPC server exception: " +
xmlrpcex.Message, msgBoxTitle, MessageBoxButtons.OK,
MessageBoxIcon.Error)
Catch defex As Exception
MessageBox.Show("XML-RPC server exception: " +
defex.Message, msgBoxTitle, MessageBoxButtons.OK,
MessageBoxIcon.Error)
End Try
End Function

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Cursor = Cursors.WaitCursor
Try
Dim proxy As New GetPostProxy()
proxy.Url = "192.168.0.51:1234"
Dim NNTPServer As String = Convert.ToString(TextBox1.Text)
Dim GroupName As String = Convert.ToString(TextBox2.Text)
Dim Number As String = Convert.ToString(TextBox4.Text)

TextBox3.Text = proxy.getpost(NNTPServer, GroupName,
Number)
Cursor = Cursors.Default
Catch ex As Exception
HandleException(ex)
End Try
End Sub
End Class

I am aware that more bugs may creep off this code which isn't finished
yet. I am writing this code to get to know VB.NET and Charles XML-RPC
library.
Thanks for your help

Charles Nadeau
http://radio.weblogs.com/0111823/





Mon Oct 28, 2002 1:21 pm

charlesnadeau
Offline Offline
Send Email Send Email

Message #68 of 1389 |
Expand Messages Author Sort by Date

All, I am trying to build an XML-RPC client in VB.NET and I want to know how it is possible to connect to a stand-alone server. By stand-alone server I mean a...
Charles Nadeau
charlesnadeau Offline Send Email
Oct 28, 2002
1:22 pm

Try changing the relevant line to: proxy.Url = "http://192.168.0.51:1234" - Charles ... alone ... (TextBox1.Text) ... (TextBox2.Text) ... finished ... RPC...
charlescookuk Offline Send Email Oct 28, 2002
1:36 pm

... Charles, It works but I have now a different error message popping up. I'll work on it tomorrow or Thursday; I have some hardware to install today. Charles...
Charles Nadeau
charlesnadeau Offline Send Email
Oct 29, 2002
6:55 am
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help