Wrong number of arguments or invalid property assignment

Wrong number of arguments or invalid property assignment

am 20.01.2008 07:41:47 von vunet.us

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.

Re: Wrong number of arguments or invalid property assignment

am 20.01.2008 15:20:59 von reb01501

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"

Re: Wrong number of arguments or invalid property assignment

am 20.01.2008 16:02:39 von vunet.us

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

Re: Wrong number of arguments or invalid property assignment

am 20.01.2008 16:30:20 von Anthony Jones

"vunet" wrote in message
news:aa1cf067-ae04-45a5-afef-98ecbaa50959@i12g2000prf.google groups.com...
> 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

Re: Wrong number of arguments or invalid property assignment

am 20.01.2008 17:04:05 von vunet.us

On Jan 20, 9:30 am, "Anthony Jones" wrote:
> "vunet" wrote in message
>
> news:aa1cf067-ae04-45a5-afef-98ecbaa50959@i12g2000prf.google groups.com...
>
>
>
> > 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)

Re: Wrong number of arguments or invalid property assignment

am 20.01.2008 17:04:28 von reb01501

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"

Re: Wrong number of arguments or invalid property assignment

am 20.01.2008 21:19:38 von daddywhite

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

Re: Wrong number of arguments or invalid property assignment

am 20.01.2008 23:34:47 von reb01501

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"

Re: Wrong number of arguments or invalid property assignment

am 21.01.2008 04:48:19 von vunet.us

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

Re: Wrong number of arguments or invalid property assignment

am 21.01.2008 12:56:04 von reb01501

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"

Re: Wrong number of arguments or invalid property assignment

am 21.01.2008 15:21:27 von vunet.us

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

Re: Wrong number of arguments or invalid property assignment

am 21.01.2008 17:36:00 von vunet.us

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 ""&key&" - "&typename(myresp(key))&"
"
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

Re: Wrong number of arguments or invalid property assignment

am 21.01.2008 17:55:58 von reb01501

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 ""&key&" - "&typename(myresp(key))&"
"
> 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.

Re: Wrong number of arguments or invalid property assignment

am 21.01.2008 18:37:05 von vunet.us

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 ""&key&" - "&typename(myresp(key))&"
"
> > 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