Wrong number of arguments or invalid property assignment

Discussion in 'ASP General' started by vunet, Jan 20, 2008.

  1. vunet

    vunet Guest

    Hello,
    I've just installed ASPXMLRPC library and testing their main function:

    xmlRPC ("URL", "command_name", params)

    The function converts all parameters to XML, sends a request to third-
    party server and receives XML response. It seems to be getting
    response fine. But when I call the function like this:

    myresp = xmlRPC ("http://someurl.com", "get", paramList)

    I get error on this line:

    "Wrong number of arguments or invalid property assignment"

    All code details are:

    dim myresp
    ReDim paramList(1)
    set dict=Server.createObject("Scripting.Dictionary")
    dict.add "key_id", "SOME_ID"
    dict.add "area", "blah"
    set paramList(0)=dict
    myresp = xmlRPC ("http://someurl.com", "get", paramList)
    response.write(myresp)

    Please recommend a fix. Thank you.
     
    vunet, Jan 20, 2008
    #1
    1. Advertising

  2. vunet wrote:
    > Hello,
    > I've just installed ASPXMLRPC library and testing their main function:
    >
    > xmlRPC ("URL", "command_name", params)
    >
    > The function converts all parameters to XML, sends a request to third-
    > party server and receives XML response. It seems to be getting
    > response fine. But when I call the function like this:
    >
    > myresp = xmlRPC ("http://someurl.com", "get", paramList)
    >
    > I get error on this line:
    >
    > "Wrong number of arguments or invalid property assignment"


    Without access to the API documentation for that library, I'm afraid we are
    not going to be able to help with this. I suggest you delve into that
    documentation yourself, and if that fails you, contact the writer of the
    class library for help.

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Jan 20, 2008
    #2
    1. Advertising

  3. vunet

    vunet Guest

    On Jan 20, 8:20 am, "Bob Barrows [MVP]" <>
    wrote:
    > vunet wrote:
    > > Hello,
    > > I've just installed ASPXMLRPC library and testing their main function:

    >
    > > xmlRPC ("URL", "command_name", params)

    >
    > > The function converts all parameters to XML, sends a request to third-
    > > party server and receives XML response. It seems to be getting
    > > response fine. But when I call the function like this:

    >
    > > myresp = xmlRPC ("http://someurl.com", "get", paramList)

    >
    > > I get error on this line:

    >
    > > "Wrong number of arguments or invalid property assignment"

    >
    > Without access to the API documentation for that library, I'm afraid we are
    > not going to be able to help with this. I suggest you delve into that
    > documentation yourself, and if that fails you, contact the writer of the
    > class library for help.
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"


    I thought it has something to do with syntax. Does this appear to be
    correct calling the function

    myresp = xmlRPC ("http://someurl.com", "get", paramList)

    where returned result is a XML object response
     
    vunet, Jan 20, 2008
    #3
  4. "vunet" <> wrote in message
    news:...
    > Hello,
    > I've just installed ASPXMLRPC library and testing their main function:
    >
    > xmlRPC ("URL", "command_name", params)
    >
    > The function converts all parameters to XML, sends a request to third-
    > party server and receives XML response. It seems to be getting
    > response fine. But when I call the function like this:
    >
    > myresp = xmlRPC ("http://someurl.com", "get", paramList)
    >
    > I get error on this line:
    >
    > "Wrong number of arguments or invalid property assignment"
    >
    > All code details are:
    >
    > dim myresp
    > ReDim paramList(1)
    > set dict=Server.createObject("Scripting.Dictionary")
    > dict.add "key_id", "SOME_ID"
    > dict.add "area", "blah"
    > set paramList(0)=dict
    > myresp = xmlRPC ("http://someurl.com", "get", paramList)
    > response.write(myresp)
    >
    > Please recommend a fix. Thank you.


    I don't know the xmlRPC product, however, I would hazard a guess that you
    can't pass a reference to a dictionary object to a remote location in the
    manner you appear to be attempting.

    I suspect its not expecting any element of the paramList array to be an
    object (or at least any object should have a default property that isn't an
    object).


    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Jan 20, 2008
    #4
  5. vunet

    vunet Guest

    On Jan 20, 9:30 am, "Anthony Jones" <> wrote:
    > "vunet" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > Hello,
    > > I've just installed ASPXMLRPC library and testing their main function:

    >
    > > xmlRPC ("URL", "command_name", params)

    >
    > > The function converts all parameters to XML, sends a request to third-
    > > party server and receives XML response. It seems to be getting
    > > response fine. But when I call the function like this:

    >
    > > myresp = xmlRPC ("http://someurl.com", "get", paramList)

    >
    > > I get error on this line:

    >
    > > "Wrong number of arguments or invalid property assignment"

    >
    > > All code details are:

    >
    > > dim myresp
    > > ReDim paramList(1)
    > > set dict=Server.createObject("Scripting.Dictionary")
    > > dict.add "key_id", "SOME_ID"
    > > dict.add "area", "blah"
    > > set paramList(0)=dict
    > > myresp = xmlRPC ("http://someurl.com", "get", paramList)
    > > response.write(myresp)

    >
    > > Please recommend a fix. Thank you.

    >
    > I don't know the xmlRPC product, however, I would hazard a guess that you
    > can't pass a reference to a dictionary object to a remote location in the
    > manner you appear to be attempting.
    >
    > I suspect its not expecting any element of the paramList array to be an
    > object (or at least any object should have a default property that isn't an
    > object).
    >
    > --
    > Anthony Jones - MVP ASP/ASP.NET


    I tested the function and it runs perfectly fine: it takes dictionary
    object, builds XML correctly, sends XML and I get responseText and
    responseXML successfully.
    But calling the function produces that error in that same line where I
    call it:

    Wrong number of arguments or invalid property assignment

    line: myresp = xmlRPC ("http://someurl.com", "get", paramList)
     
    vunet, Jan 20, 2008
    #5
  6. vunet wrote:
    > I thought it has something to do with syntax. Does this appear to be
    > correct calling the function
    >
    > myresp = xmlRPC ("http://someurl.com", "get", paramList)
    >
    > where returned result is a XML object response


    No. Use Set to set object variables.

    Set myresp = xmlRPC ("http://someurl.com", "get", paramList)

    But I don't think that's what the error message is referring to. it could
    be, but i don't think it is.

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Jan 20, 2008
    #6
  7. vunet

    daddywhite Guest

    On 20 Jan, 16:04, "Bob Barrows [MVP]" <>
    wrote:
    > vunet wrote:
    > > I thought it has something to do with syntax. Does this appear to be
    > > correct calling the function

    >
    > > myresp = xmlRPC ("http://someurl.com", "get", paramList)

    >
    > > where returned result is a XML object response

    >
    > No. Use Set to set object variables.
    >
    > Set myresp = xmlRPC ("http://someurl.com", "get", paramList)
    >
    > But I don't think that's what the error message is referring to. it could
    > be, but i don't think it is.
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"


    Have you tried this without the brackets? so just:

    Set myresp = xmlRPC "http://someurl.com", "get", paramList
     
    daddywhite, Jan 20, 2008
    #7
  8. daddywhite wrote:
    >> Have you tried this without the brackets? so just:

    >
    > Set myresp = xmlRPC "http://someurl.com", "get", paramList


    That will definitely raise an error
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Jan 20, 2008
    #8
  9. vunet

    vunet Guest

    On Jan 20, 10:04 am, "Bob Barrows [MVP]" <>
    wrote:
    > vunet wrote:
    > > I thought it has something to do with syntax. Does this appear to be
    > > correct calling the function

    >
    > > myresp = xmlRPC ("http://someurl.com", "get", paramList)

    >
    > > where returned result is a XML object response

    >
    > No. Use Set to set object variables.
    >
    > Set myresp = xmlRPC ("http://someurl.com", "get", paramList)
    >
    > But I don't think that's what the error message is referring to. it could
    > be, but i don't think it is.
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"


    Using Set myresp = xmlRPC ("http://someurl.com", "get", paramList) is
    fine but it then generates the same error in the next line where I am
    using response.write:

    response.write(myresp) ' ===> error Wrong number of arguments or
    invalid property assignment

    How do I display that result once I set "myresp"? If this is an XML
    file...
    Thank you
     
    vunet, Jan 21, 2008
    #9
  10. vunet wrote:
    > On Jan 20, 10:04 am, "Bob Barrows [MVP]" <>
    > wrote:
    >> vunet wrote:
    >>> I thought it has something to do with syntax. Does this appear to be
    >>> correct calling the function

    >>
    >>> myresp = xmlRPC ("http://someurl.com", "get", paramList)

    >>
    >>> where returned result is a XML object response

    >>
    >> No. Use Set to set object variables.
    >>
    >> Set myresp = xmlRPC ("http://someurl.com", "get", paramList)
    >>
    >> But I don't think that's what the error message is referring to. it
    >> could be, but i don't think it is.
    >>

    >
    > Using Set myresp = xmlRPC ("http://someurl.com", "get", paramList) is
    > fine but it then generates the same error in the next line where I am
    > using response.write:
    >
    > response.write(myresp) ' ===> error Wrong number of arguments or
    > invalid property assignment
    >
    > How do I display that result once I set "myresp"? If this is an XML
    > file...
    > Thank you


    Obviously, myresp is an object that does not have a default property that is
    implicilty convertible to a string. I suspect myresp is an xml document (you
    can use "response.write typename(myresp)" to be sure). If it is, you can
    response.write its xml property:
    response.write myresp.xml

    If it isn't, we're still in the dark. Don't you have any documentation for
    this library?

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Jan 21, 2008
    #10
  11. vunet

    vunet Guest

    On Jan 21, 5:56 am, "Bob Barrows [MVP]" <>
    wrote:
    > vunet wrote:
    > > On Jan 20, 10:04 am, "Bob Barrows [MVP]" <>
    > > wrote:
    > >> vunet wrote:
    > >>> I thought it has something to do with syntax. Does this appear to be
    > >>> correct calling the function

    >
    > >>> myresp = xmlRPC ("http://someurl.com", "get", paramList)

    >
    > >>> where returned result is a XML object response

    >
    > >> No. Use Set to set object variables.

    >
    > >> Set myresp = xmlRPC ("http://someurl.com", "get", paramList)

    >
    > >> But I don't think that's what the error message is referring to. it
    > >> could be, but i don't think it is.

    >
    > > Using Set myresp = xmlRPC ("http://someurl.com", "get", paramList) is
    > > fine but it then generates the same error in the next line where I am
    > > using response.write:

    >
    > > response.write(myresp) ' ===> error Wrong number of arguments or
    > > invalid property assignment

    >
    > > How do I display that result once I set "myresp"? If this is an XML
    > > file...
    > > Thank you

    >
    > Obviously, myresp is an object that does not have a default property that is
    > implicilty convertible to a string. I suspect myresp is an xml document (you
    > can use "response.write typename(myresp)" to be sure). If it is, you can
    > response.write its xml property:
    > response.write myresp.xml
    >
    > If it isn't, we're still in the dark. Don't you have any documentation for
    > this library?
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"


    typename(myresp) is a dictionary object. I guess I have to loop
    through the object and display all its key-values.
    Thanks for your help
     
    vunet, Jan 21, 2008
    #11
  12. vunet

    vunet Guest

    On Jan 21, 5:56 am, "Bob Barrows [MVP]" <>
    wrote:
    > vunet wrote:
    > > On Jan 20, 10:04 am, "Bob Barrows [MVP]" <>
    > > wrote:
    > >> vunet wrote:
    > >>> I thought it has something to do with syntax. Does this appear to be
    > >>> correct calling the function

    >
    > >>> myresp = xmlRPC ("http://someurl.com", "get", paramList)

    >
    > >>> where returned result is a XML object response

    >
    > >> No. Use Set to set object variables.

    >
    > >> Set myresp = xmlRPC ("http://someurl.com", "get", paramList)

    >
    > >> But I don't think that's what the error message is referring to. it
    > >> could be, but i don't think it is.

    >
    > > Using Set myresp = xmlRPC ("http://someurl.com", "get", paramList) is
    > > fine but it then generates the same error in the next line where I am
    > > using response.write:

    >
    > > response.write(myresp) ' ===> error Wrong number of arguments or
    > > invalid property assignment

    >
    > > How do I display that result once I set "myresp"? If this is an XML
    > > file...
    > > Thank you

    >
    > Obviously, myresp is an object that does not have a default property that is
    > implicilty convertible to a string. I suspect myresp is an xml document (you
    > can use "response.write typename(myresp)" to be sure). If it is, you can
    > response.write its xml property:
    > response.write myresp.xml
    >
    > If it isn't, we're still in the dark. Don't you have any documentation for
    > this library?
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"


    When I loop though dictionary the type of value is Variant(). See
    below:

    For Each key In myresp
    response.write "<b>"&key&"</b> - "&typename(myresp(key))&"<br>"
    Next

    produces:
    items - Variant()
    total - Long

    I do not think this library explains or gives the samples. I think I
    am left alone with dictionary object which probably looks like multi-
    dictionary object created from XML file.
    How would you recommend looping further with Variant()?
    Thank you very much
     
    vunet, Jan 21, 2008
    #12
  13. vunet wrote:
    >>
    >> Obviously, myresp is an object that does not have a default property
    >> that is implicilty convertible to a string. I suspect myresp is an
    >> xml document (you can use "response.write typename(myresp)" to be
    >> sure). If it is, you can response.write its xml property:
    >> response.write myresp.xml
    >>
    >> If it isn't, we're still in the dark. Don't you have any
    >> documentation for this library?
    >>

    >
    > When I loop though dictionary the type of value is Variant(). See
    > below:
    >
    > For Each key In myresp
    > response.write "<b>"&key&"</b> - "&typename(myresp(key))&"<br>"
    > Next
    >
    > produces:
    > items - Variant()
    > total - Long
    >
    > I do not think this library explains or gives the samples. I think I
    > am left alone with dictionary object which probably looks like multi-
    > dictionary object created from XML file.
    > How would you recommend looping further with Variant()?
    > Thank you very much


    It's a Variant array. Loop through it as you would any other array.
    Either

    for each itm in myresp("items")
    response.write typename(itm)
    next

    or

    ar=myresp("items")
    for i = 0 to ubound(myresp("items"))
    response.write typename(ar(i))
    next

    If the typename results are datatypes that can be converted to strings,
    you are there.


    Does the "total" item contain any relevant information in its value?

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Jan 21, 2008
    #13
  14. vunet

    vunet Guest

    On Jan 21, 10:55 am, "Bob Barrows [MVP]" <>
    wrote:
    > vunet wrote:
    >
    > >> Obviously, myresp is an object that does not have a default property
    > >> that is implicilty convertible to a string. I suspect myresp is an
    > >> xml document (you can use "response.write typename(myresp)" to be
    > >> sure). If it is, you can response.write its xml property:
    > >> response.write myresp.xml

    >
    > >> If it isn't, we're still in the dark. Don't you have any
    > >> documentation for this library?

    >
    > > When I loop though dictionary the type of value is Variant(). See
    > > below:

    >
    > > For Each key In myresp
    > > response.write "<b>"&key&"</b> - "&typename(myresp(key))&"<br>"
    > > Next

    >
    > > produces:
    > > items - Variant()
    > > total - Long

    >
    > > I do not think this library explains or gives the samples. I think I
    > > am left alone with dictionary object which probably looks like multi-
    > > dictionary object created from XML file.
    > > How would you recommend looping further with Variant()?
    > > Thank you very much

    >
    > It's a Variant array. Loop through it as you would any other array.
    > Either
    >
    > for each itm in myresp("items")
    > response.write typename(itm)
    > next
    >
    > or
    >
    > ar=myresp("items")
    > for i = 0 to ubound(myresp("items"))
    > response.write typename(ar(i))
    > next
    >
    > If the typename results are datatypes that can be converted to strings,
    > you are there.
    >
    > Does the "total" item contain any relevant information in its value?
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.


    Perfect! It was a multidictionary object and I just used your
    suggested
    ar=myresp("items")
    for i = 0 to ubound(myresp("items"))
    response.write typename(ar(i))
    next
    to loop though each deeper and deeper if array's element is dictionary
    again.
    I really appreciate. Thanks
     
    vunet, Jan 21, 2008
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page