Found this JIRA:

http://jira.codehaus.org/browse/XFIRE-845

which looks exactly like what I'm seeing. The line of code,

ms.writeXsiNil()

is exactly where I'm getting the exception from. I'll try upgrading to 1.2.6
and see if I still get the problem, but as I said earlier, another team in
my company uses 1.2.2 with JDK5 and they have no problems with sending null.
I inspected their SOAP request and they have a proper parameter XML tag with
the attribute xsi:nil set to true.

-Terry


dontspamterry wrote:
> 
> I'm using XFire 1.2.2. Funny thing is another team here is also using
> XFire 1.2.2, but not with Spring remoting and they're able to send
> null-valued parameters without any problems. Any takers?
> 
> Thanks,
> -Terry
> 
> 
> Frank Hemer wrote:
>> 
>> On Wednesday 30 May 2007 01:29, dontspamterry wrote:
>>> Hi all,
>>>
>>> Newbie here, so please excuse if this is trivial or have been covered
>>> before. I've inherited some web service code which uses Spring remoting
>>> for
>>> XFire setup. I have an API which accepts, let's say, class A as a
>>> parameter. When I invoke this API with an instance of A, everything is
>>> fine
>>> and dandy. However, when I invoke this same API with a null value, I get
>>> the following exception:
>>>
>>> Caused by: javax.xml.stream.XMLStreamException: Trying to write an
>>> attribute when there is no open start element.
>>>     at
>>> com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:139
>>>6) at
>>> com.ctc.wstx.sw.SimpleNsStreamWriter.writeAttribute(SimpleNsStreamWriter.ja
>>>va:94) at
>>> org.codehaus.xfire.aegis.stax.AttributeWriter.writeValue(AttributeWriter.ja
>>>va:45) ... 18 more
>>>
>>> The call doesn't even reach my implementation method on the server host.
>>> Has anyone seen this before? I'm guessing this is a configuration(?)
>>> problem so if you need to see what my config files are like, I can post
>>> them as well. One thing I forgot to mention - the parameter of class A
>>> is a
>>> simple POJO where I've added the @XmlElement annotation to each
>>> attribute
>>> with the nillable property set to "true". I thought that setting these
>>> attributes to nillable would enable me to pass a null value parameter,
>>> but
>>> that didn't work either. Any pointers for the newbie?
>> 
>> I have experienced the same when passing 'null' to a 'java.util.Date'
>> 
>> Frank
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>> 
>>     http://xircles.codehaus.org/manage_email
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Passing-null-parameter-tf3837307.html#a10880317
Sent from the XFire - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to