You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rpc-dev@xml.apache.org by Rogers Cadenhead <ro...@cadenhead.org> on 2002/10/24 19:58:07 UTC
Off-spec XML-RPC
I'm writing a Java application that uses Apache XML-RPC to call
methods on Advogato's XML-RPC interface. Advogato's diary.getDates()
method bombs out with a NullPointerException every time it is run.
After bouncing around your source code for a while (nice work!), I
found that the cause appears to be some off-spec XML-RPC in
Advogato's response:
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<array>
<data>
<value>
<dateTime.iso8601>20020707T11:25:37</dateTime.iso8601>
</value>
<value>
<dateTime.iso8601>20020707T11:37:12</dateTime.iso8601>
</value>
</data>
</array>
</param>
</params>
</methodResponse>
As you can see, the array element is not enclosed within a value
element. This causes the startElement() method of XmlRpc to throw a
NullPointerException here:
else if ("array".equals (name))
{
currentValue.setType (ARRAY);
}
currentValue is null at this point because startElement() does not
set up the currentValue object until it encounters a value element,
and Advogato's response doesn't contain one outside of the array
element.
I don't know how (or if) you want to deal with off-spec XML-RPC.
However, since this NullPointerException provides so little user
feedback on the cause of the problem, I thought it might be worth
mentioning here.
--
Rogers Cadenhead, rogers@cadenhead.org on 10/24/2002
Weblog: http://www.pycs.net/workbench
Re: Off-spec XML-RPC
Posted by josh lucas <jo...@stonecottage.com>.
Rogers -
Sorry for the delay in responding. I'm not sure how one could handle a
non-conforming response, I'll have to look at that.
I'd also drop a note to the folks working on the Advogato code..
http://www.advogato.net/proj/mod_virgule/
http://zork.net/mailman/listinfo/virgule-dev
josh
On Thursday, October 24, 2002, at 10:58 AM, Rogers Cadenhead wrote:
> I'm writing a Java application that uses Apache XML-RPC to call
> methods on Advogato's XML-RPC interface. Advogato's diary.getDates()
> method bombs out with a NullPointerException every time it is run.
>
> After bouncing around your source code for a while (nice work!), I
> found that the cause appears to be some off-spec XML-RPC in
> Advogato's response:
>
> <?xml version="1.0"?>
> <methodResponse>
> <params>
> <param>
> <array>
> <data>
> <value>
> <dateTime.iso8601>20020707T11:25:37</dateTime.iso8601>
> </value>
> <value>
> <dateTime.iso8601>20020707T11:37:12</dateTime.iso8601>
> </value>
> </data>
> </array>
> </param>
> </params>
> </methodResponse>
>
> As you can see, the array element is not enclosed within a value
> element. This causes the startElement() method of XmlRpc to throw a
> NullPointerException here:
>
> else if ("array".equals (name))
> {
> currentValue.setType (ARRAY);
> }
>
> currentValue is null at this point because startElement() does not
> set up the currentValue object until it encounters a value element,
> and Advogato's response doesn't contain one outside of the array
> element.
>
> I don't know how (or if) you want to deal with off-spec XML-RPC.
> However, since this NullPointerException provides so little user
> feedback on the cause of the problem, I thought it might be worth
> mentioning here.
> --
> Rogers Cadenhead, rogers@cadenhead.org on 10/24/2002
> Weblog: http://www.pycs.net/workbench
>
>
>
Re: Off-spec XML-RPC
Posted by josh lucas <jo...@stonecottage.com>.
Rogers -
Sorry for the delay in responding. I'm not sure how one could handle a
non-conforming response, I'll have to look at that.
I'd also drop a note to the folks working on the Advogato code..
http://www.advogato.net/proj/mod_virgule/
http://zork.net/mailman/listinfo/virgule-dev
josh
On Thursday, October 24, 2002, at 10:58 AM, Rogers Cadenhead wrote:
> I'm writing a Java application that uses Apache XML-RPC to call
> methods on Advogato's XML-RPC interface. Advogato's diary.getDates()
> method bombs out with a NullPointerException every time it is run.
>
> After bouncing around your source code for a while (nice work!), I
> found that the cause appears to be some off-spec XML-RPC in
> Advogato's response:
>
> <?xml version="1.0"?>
> <methodResponse>
> <params>
> <param>
> <array>
> <data>
> <value>
> <dateTime.iso8601>20020707T11:25:37</dateTime.iso8601>
> </value>
> <value>
> <dateTime.iso8601>20020707T11:37:12</dateTime.iso8601>
> </value>
> </data>
> </array>
> </param>
> </params>
> </methodResponse>
>
> As you can see, the array element is not enclosed within a value
> element. This causes the startElement() method of XmlRpc to throw a
> NullPointerException here:
>
> else if ("array".equals (name))
> {
> currentValue.setType (ARRAY);
> }
>
> currentValue is null at this point because startElement() does not
> set up the currentValue object until it encounters a value element,
> and Advogato's response doesn't contain one outside of the array
> element.
>
> I don't know how (or if) you want to deal with off-spec XML-RPC.
> However, since this NullPointerException provides so little user
> feedback on the cause of the problem, I thought it might be worth
> mentioning here.
> --
> Rogers Cadenhead, rogers@cadenhead.org on 10/24/2002
> Weblog: http://www.pycs.net/workbench
>
>
>