|
Slade Christensen
Liquid Heat CTO
Join date: 25 Dec 2005
Posts: 31
|
01-08-2008 08:01
I am deploying an Asp.net/VB.net version of the web site to xmlrpc in SL portal. So far my prim gets the request from the site and announces the items it received successfully (after many hours of hair pulling), but it then does a respond back to the website which causes an error. I am using the CookComputing.XMLRPC dll fyi. The xmlrpcStruct is what is throwing the errors, the reply sends back 4 components even though the site only sends 3. Anyone have experience with this?
|
|
Slade Christensen
Liquid Heat CTO
Join date: 25 Dec 2005
Posts: 31
|
01-08-2008 08:49
The exact error is : System.InvalidCastException: Unable to cast object of type 'CookComputing.XmlRpc.XmlRpcStruct' to type 'SLXMLRPC'. at RPCXML_ENGINE.Page_Load(Object sender, EventArgs e) in D:\Inetpub\wwwroot\RPCXML_ENGINE.aspx.vb:line 62 Line 62 is the call to the function that executes the XMLRPC method. The method looks like so: <XmlRpcMethod("llRemoteData")> Function llRemoteData(ByVal retPacket As CookComputing.XmlRpc.XmlRpcStruct) As CookComputing.XmlRpc.XmlRpcStruct
|
|
Slade Christensen
Liquid Heat CTO
Join date: 25 Dec 2005
Posts: 31
|
01-08-2008 13:04
Nevermind I figured it out. Although now on every other call to the script I get the following back from SL. System.Net.WebException: The server committed a protocol violation. Section=ResponseStatusLine at System.Net.HttpWebRequest.GetResponse() at CookComputing.XmlRpc.XmlRpcClientProtocol.GetWebResponse(WebRequest request) at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(Object clientObj, MethodInfo mi, Object[] parameters) at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(MethodInfo mi, Object[] Parameters) at XmlRpcProxy6a7a08c6-28b8-4f1f-890f-b9b0ff27da9a.llRemoteData(XmlRpcStruct ) at RPCXML_ENGINE.Page_Load(Object sender, EventArgs e) in D:\Inetpub\wwwroot\RPCXML_ENGINE.aspx.vb:line 63 
|
|
Broesel Oh
Registered User
Join date: 7 Feb 2007
Posts: 2
|
01-10-2008 09:00
I use CookComputing.XMLRPC, too. This class is extracted from what I use. Use it like: rpc AS RPC rpc.Channel = ... rpc.Message("Test"  Some things to note: RPC to Linden is not reliable. This Code tries to send it 5 times. In my Web-Service I use a queue for RPC which runs in a own Thread, to avoid overlapping RPCs (Not Included here). When an incoming llhttprequest arives, i discard the rpc and send it back via llhttprequest instead. (Not Included here). But i hope this code-snipet should get you started:
Public Class RPC
Private m_Channel As String Public Structure llPacket Public Channel As String Public StringValue As String Public IntValue As Integer End Structure
<XmlRpcUrl("http://xmlrpc.secondlife.com/cgi-bin/xmlrpc.cgi")> _ Public Interface SLInterface Inherits IXmlRpcProxy
<XmlRpcMethod()> _ Function llRemoteData(ByVal p As llPacket) As llPacket
<XmlRpcBegin()> _ Function BeginllRemoteData(ByVal p As llPacket) As IAsyncResult
<XmlRpcBegin()> _ Function BeginllRemoteData(ByVal p As llPacket, ByVal acb As AsyncCallback) As IAsyncResult
<XmlRpcBegin()> _ Function BeginllRemoteData(ByVal p As llPacket, ByVal acb As AsyncCallback, ByVal state As Object) As IAsyncResult
<XmlRpcEnd()> _ Function EndllRemoteData(ByVal iasr As IAsyncResult) As llPacket
End Interface Public Sub New()
m_proxy = CType(XmlRpcProxyGen.Create(GetType(SLInterface)), SLInterface) m_proxy.KeepAlive = False m_proxy.Timeout = 90000
End Sub Public WriteOnly Property Channel() As String Set(ByVal st As String) If st <> m_Channel Then m_Channel = st End If End Set End Property Private Sub SendMessage(ByVal msg As String)
Dim p As llPacket p.Channel = m_Channel p.StringValue = msg p.IntValue = 0
Dim Anz As Integer Anz = 1
Dim ok As Boolean ok = False
Dim st As String Dim r As llPacket
Do
st = ""
Dim asr As IAsyncResult asr = m_proxy.BeginllRemoteData(p)
Do Until ok Or asr.IsCompleted Threading.Thread.Sleep(1000) Loop
If Not ok Then Try r = m_proxy.EndllRemoteData(asr) ok = True Catch ex As XmlRpcServerException st = "XmlRpcServerException " & ex.Message Catch ex As XmlRpcFaultException st = "XmlRpcFaultException " & ex.FaultCode & ": " & ex.FaultString Catch ex As XmlRpcException st = "XMLRPCException: " & ex.Message Catch ex As Exception st = "XML-RPC-Error: " & ex.Message End Try End If
If Not ok Then Anz += 1 If Anz > 5 Then Exit Sub End If End If
Loop Until ok
End Sub
End Class
|