Loading ...
Sorry, an error occurred while loading the content.

newbie: help needed

Expand Messages
  • jb902003
    I m trying to write an xmlrpc client but I m not sure if I have this ... An unhandled exception of type CookComputing.XmlRpc.XmlRpcNullReferenceException
    Message 1 of 2 , May 22, 2003
    View Source
    • 0 Attachment
      I'm trying to write an xmlrpc client but I'm not sure if I have this
      right when I invoke the method I get the following error:
      ------------------------------------------------------------------
      An unhandled exception of
      type 'CookComputing.XmlRpc.XmlRpcNullReferenceException' occurred in
      cookcomputing.xmlrpc.dll

      Additional information: Attempt to serialize data containing null
      reference
      ------------------------------------------------------------------

      Here's my code:

      (proxy Class)

      <XmlRpcUrl("http://xxx")> _
      Public Class Danger
      Inherits XmlRpcClientProtocol
      Public SessionID As String
      <XmlRpcMethod("create_session")> _
      Public Function CreateSession(ByVal partner As String,_
      ByVal username As String,_
      ByVal password As String) As String
      Return Invoke("CreateSession", New Object() {sessionid})
      End Function
      End Class

      (code that invokes class)

      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
      System.EventArgs) Handles Button1.Click
      Dim session As New Danger
      Label1.Text = session.CreateSession("xxx", "xxx", "xxx")
      End Sub
      ---------------------------------------------------

      the function takes three string values and returns a string; any
      ideas/help would be greatly appreciated.
    • charlescookuk
      Public Function CreateSession(ByVal partner As String,_ ByVal username As String,_ ByVal password As String) As String ... Return Invoke( CreateSession , New
      Message 2 of 2 , May 23, 2003
      View Source
      • 0 Attachment
        Public Function CreateSession(ByVal partner As String,_
        ByVal username As String,_
        ByVal password As String) As String
        ...
        Return Invoke("CreateSession", New Object() {sessionid})

        CreateSession takes 3 parameters but when you invoke it you only pass
        a single parameter. Use XmlRpcProxyGen to create the proxy. It makes
        life much easier.

        - Charles



        --- In XMLRPCNET@yahoogroups.com, "jb902003" <jason@f...> wrote:
        > I'm trying to write an xmlrpc client but I'm not sure if I have
        this
        > right when I invoke the method I get the following error:
        > ------------------------------------------------------------------
        > An unhandled exception of
        > type 'CookComputing.XmlRpc.XmlRpcNullReferenceException' occurred
        in
        > cookcomputing.xmlrpc.dll
        >
        > Additional information: Attempt to serialize data containing null
        > reference
        > ------------------------------------------------------------------
        >
        > Here's my code:
        >
        > (proxy Class)
        >
        > <XmlRpcUrl("http://xxx")> _
        > Public Class Danger
        > Inherits XmlRpcClientProtocol
        > Public SessionID As String
        > <XmlRpcMethod("create_session")> _
        > Public Function CreateSession(ByVal partner As String,_
        > ByVal username As String,_
        > ByVal password As String) As String
        > Return Invoke("CreateSession", New Object() {sessionid})
        > End Function
        > End Class
        >
        > (code that invokes class)
        >
        > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
        As
        > System.EventArgs) Handles Button1.Click
        > Dim session As New Danger
        > Label1.Text = session.CreateSession("xxx", "xxx", "xxx")
        > End Sub
        > ---------------------------------------------------
        >
        > the function takes three string values and returns a string; any
        > ideas/help would be greatly appreciated.
      Your message has been successfully submitted and would be delivered to recipients shortly.