You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by DBDavide <db...@gmail.com> on 2007/01/19 15:34:13 UTC

xsi:nil='1' Null what is wrong with this soap body?

Newbie question:

Why I'm getting this exception from Axis2 server when I send null values?
WSDL states nillable='true'.
Clients should omit or send NULL values with xsi:nil='1' ?

This is the WSDL fragment:

      <xs:element name="updateModel">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="code" nillable="true" type="xs:int"/>
            <xs:element name="des" nillable="true" type="xs:string"/>
            <xs:element name="link" nillable="true" type="xs:int"/>
            <xs:element name="date" nillable="true" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>

This is the SOAP envelope (that to me appears to be correct) sent from JBoss
1.0.4WS:

2007-01-18 21:18:33,118 TRACE [jbossws.SOAPMessage] Outgoing SOAPMessage 

<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
 <env:Header/>
 <env:Body>
  <ns1:updateModel xmlns:ns1='http://core.xx.yyy.zzz.com/xsd'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
   <ns1:code xsi:nil='1'/>
   <ns1:des>DUMMY</ns1:des>
   <ns1:link xsi:nil='1'/>
   <ns1:date xsi:nil='1'/>
  </ns1:updateModel>
 </env:Body>
</env:Envelope>

Axis2 throws an exception and reply with a fault:

<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>
 <soapenv:Header/>
 <soapenv:Body>
  <env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
   <faultcode>soapenv:Client</faultcode>
   <faultstring>Exception occurred while trying to invoke service method
updateModel</faultstring>
   <detail/>
  </env:Fault>
 </soapenv:Body>
</soapenv:Envelope>

On my console I see this Exception:

ERROR org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver - 
Exception occurred while trying to invoke service method updateModel 
java.lang.IllegalArgumentException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:118)
at
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:493)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:319)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:247)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453)
at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
at org.mortbay.jetty.Server.handle(Server.java:303)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:735)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:636)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:320)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)


Thanks

--
Davide



-- 
View this message in context: http://www.nabble.com/xsi%3Anil%3D%271%27-Null-what-is-wrong-with-this-soap-body--tf3040150.html#a8449923
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: xsi:nil='1' Null what is wrong with this soap body?

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
I just tried it a couple of times, without any problems. What happens 
when you try it?

Please just respond to me directly, rather than keeping this going on 
the axis-user list.

  - Dennis

Franz Fehringer wrote:
> Hello Dennis,
>
> The link
> http://www.sosnoski.com/jibx-wiki/space/axis2-jibx/soa-for-devs/soa-for-developers.pdf 
>
> on this page does not work.
> Can you have a look at it?
>
> Thanks
>
> Franz
>
>
> Dennis Sosnoski schrieb:
>> Bad specifications are a major part of the issue with 
>> interoperability problems. In the case of SOAP itself, the people who 
>> wrote the specification left too much unspecified and too many 
>> options. In the case of XML Schema, the specification is long, 
>> complex, and confusing - and also provides too many options.
>>
>> WS-I helped a lot with the basic SOAP features, but didn't address 
>> Schema - and Schema is increasingly where the interoperability 
>> problems originate (both directly, when applications use Schema 
>> constructs that don't work well across frameworks, and indirectly, 
>> when the framework itself has problems - as in this case). I give 
>> some recommendations in this area as part of some of my 
>> presentations. I just posted the slides from my "SOA for Developers" 
>> workshop, which includes a fairly extensive chunk on schema, at 
>> http://www.sosnoski.com/jibx-wiki/space/axis2-jibx/soa-for-devs
>>
>> There is an effort in progress to come up with a sort of WS-I for 
>> Schema equivalent, through the W3C "XML Schema Patterns for 
>> Databinding Working Group" (http://www.w3.org/2002/ws/databinding/). 
>> It looks like the working group is doing a good job on this. I 
>> especially like the way they're defining patterns that can easily be 
>> tested in Schema instances. Hopefully within a year or so everyone 
>> will be able to use the basic patterns and know that they'll be 
>> handled properly by all the major data binding frameworks (or use 
>> some of the advanced ones, and know that they'll be limiting 
>> themselves to selected frameworks).
>>
>>  - Dennis
>>
>> DBDavide wrote:
>>> ...
>>>
>>> <ranting>
>>> Too many interoperability issues in real world... everything works 
>>> smootly
>>> only if both end points uses the same product or I'm really really 
>>> lucky.
>>> - If I'm implementing both server and client I don't see the 
>>> advantage of
>>> using a so complicated technology.
>>> - If I'm implementing just one side, the automagically generated 
>>> wsdl or
>>> automagically generated client stubs from wsdl it's really a dicer's 
>>> oath
>>> :-) 99% of the time you finish digging into wsdl editing or on the wire
>>> analisys...
>>>
>>> I was caught in between :-) I'm implementing both sides and I have two
>>> products: Axis on the server side and JBossWS on client side. I 
>>> wouldn't
>>> wish it upon my worst enemy: time spent on this technology is becoming
>>> nearly the same time spent implementing the real business logic.
>>> I think that sometime we lose sight of our real targets. I think 
>>> that WS-*
>>> are what I call a "tool" technology, They are a help for our 
>>> applications.
>>> Using a screwdriver shouldn't be harder than building a car. How 
>>> many times, deployng and managing an applications into an application
>>> server is far more complicated than application itself? If it's happen,
>>> probably we missed something.
>>> </ranting>
>>>
>>> Bye
>>>
>>> -- 
>>> Davide
>>>   
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: xsi:nil='1' Null what is wrong with this soap body?

Posted by Franz Fehringer <fe...@isogmbh.de>.
Hello Dennis,

The link
http://www.sosnoski.com/jibx-wiki/space/axis2-jibx/soa-for-devs/soa-for-developers.pdf
on this page does not work.
Can you have a look at it?

Thanks

Franz


Dennis Sosnoski schrieb:
> Bad specifications are a major part of the issue with interoperability 
> problems. In the case of SOAP itself, the people who wrote the 
> specification left too much unspecified and too many options. In the 
> case of XML Schema, the specification is long, complex, and confusing 
> - and also provides too many options.
>
> WS-I helped a lot with the basic SOAP features, but didn't address 
> Schema - and Schema is increasingly where the interoperability 
> problems originate (both directly, when applications use Schema 
> constructs that don't work well across frameworks, and indirectly, 
> when the framework itself has problems - as in this case). I give some 
> recommendations in this area as part of some of my presentations. I 
> just posted the slides from my "SOA for Developers" workshop, which 
> includes a fairly extensive chunk on schema, at 
> http://www.sosnoski.com/jibx-wiki/space/axis2-jibx/soa-for-devs
>
> There is an effort in progress to come up with a sort of WS-I for 
> Schema equivalent, through the W3C "XML Schema Patterns for 
> Databinding Working Group" (http://www.w3.org/2002/ws/databinding/). 
> It looks like the working group is doing a good job on this. I 
> especially like the way they're defining patterns that can easily be 
> tested in Schema instances. Hopefully within a year or so everyone 
> will be able to use the basic patterns and know that they'll be 
> handled properly by all the major data binding frameworks (or use some 
> of the advanced ones, and know that they'll be limiting themselves to 
> selected frameworks).
>
>  - Dennis
>
> DBDavide wrote:
>> ...
>>
>> <ranting>
>> Too many interoperability issues in real world... everything works 
>> smootly
>> only if both end points uses the same product or I'm really really 
>> lucky.
>> - If I'm implementing both server and client I don't see the 
>> advantage of
>> using a so complicated technology.
>> - If I'm implementing just one side, the automagically generated wsdl or
>> automagically generated client stubs from wsdl it's really a dicer's 
>> oath
>> :-) 99% of the time you finish digging into wsdl editing or on the wire
>> analisys...
>>
>> I was caught in between :-) I'm implementing both sides and I have two
>> products: Axis on the server side and JBossWS on client side. I wouldn't
>> wish it upon my worst enemy: time spent on this technology is becoming
>> nearly the same time spent implementing the real business logic.
>> I think that sometime we lose sight of our real targets. I think that 
>> WS-*
>> are what I call a "tool" technology, They are a help for our 
>> applications.
>> Using a screwdriver shouldn't be harder than building a car. How many 
>> times, deployng and managing an applications into an application
>> server is far more complicated than application itself? If it's happen,
>> probably we missed something.
>> </ranting>
>>
>> Bye
>>
>> -- 
>> Davide
>>   
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


Re: xsi:nil='1' Null what is wrong with this soap body?

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
DBDavide wrote:
> ...
>
> I've seen your and Ajith comments on
> http://issues.apache.org/jira/browse/AXIS2-2007.
> Yes I'm using ADB, pratically just modifying a service.xml to expose my
> existing pojo class. So exceuse my newbie questions:
>
> Is there any way to set up Axis2 to use by default xmlbeans databinding
> instead of ADB?
>   
You can do this with a -d xmlbeans parameter passed to WSDL2Java when 
you generate the code.
> Give that I already have a ready pojo class to expose, my step should be:
>
> #1 Save the Axis automagically generated wsdl for my pojo
>
> #2 Use the wsdl as input to WSDL2Java specifying that I want serverside
> skeletons and xmlbeans databinding
>
> #3 Fill the skeleton with my old pojo business logic or better delegate the
> methods 1 to 1 from the skeleton to my pojo.
>
> #4 jar everything and deploy again.
>
> Regarding the #1 could I modify the wsdl before running WSDL2Java? I ask
> this because, right now to get rid of this quirk (
> http://issues.apache.org/jira/browse/AXIS2-1931 ) I recompiled Axis sources.
>   
You can definitely modify the WSDL generated by Axis2 Java2WSDL. I 
recommend to anyone using this that they at least clean up the generated 
schema, since it's a very basic form that doesn't represent things very 
efficiently.

There are some quirks when using XMLBeans, in terms of how you construct 
and populate the data objects. I'll try to add both XMLBeans and ADB 
versions to the sample I provided for JiBX on the wiki site within the 
next day or two, so that people can see how the three work out in 
practice. The Quick Start guide at 
http://ws.apache.org/axis2/1_1_1/quickstartguide.html gives you a 
trivial example now.

If you're working with several services based on existing pojo code you 
may also want to consider using JiBX (my data binding creation), which 
lets you work directly with your existing classes. The downside is that 
you need to create a binding definition for JiBX, and although that's 
pretty well documented on the JiBX site (http://www.jibx.org) it can be 
a little overwhelming if you're just doing a simple one-off project. 
There is a tool to generate a simple default binding for you, and 
another that generates a schema from the binding + code, but these are 
both out of date and you end up needing to do a fair amount of hand 
modification. I'm working on getting these tools updated now.

  - Dennis

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: xsi:nil='1' Null what is wrong with this soap body?

Posted by DBDavide <db...@gmail.com>.

Dennis Sosnoski wrote:
> 
> Bad specifications are a major part of the issue with interoperability
> problems....
> 

On this topic I'm really a beginner. I've been working in the IT market for
nearly twenty years nad thsi is the first time I'm facing serious problem to
understand everithing. Specs and framework are moving so fast. For example:
we use JBoss AS in many environments. On their list, some JBoss guys
commenting some issues stated that "...Most efforts are put into JAX-WS at
the moment, that's why wstools for JAX-RPC is a little weak in some
areas...".
So you'll end never having a solid rock stack becouse you development effort
are running behind new specs and so on. Of course I hope that we will soon
have a good set of specs/raccomandations to work on.


Dennis Sosnoski wrote:
> 
> I give some recommendations in 
> this area as part of some of my presentations. I just posted the slides 
> from my "SOA for Developers" workshop, which includes a fairly extensive 
> chunk on schema, at 
> http://www.sosnoski.com/jibx-wiki/space/axis2-jibx/soa-for-devs
> 

Thank you, nice slideshow indeed.
It gives you the big picture around so many concepts.

I've seen your and Ajith comments on
http://issues.apache.org/jira/browse/AXIS2-2007.
Yes I'm using ADB, pratically just modifying a service.xml to expose my
existing pojo class. So exceuse my newbie questions:

Is there any way to set up Axis2 to use by default xmlbeans databinding
instead of ADB?

Give that I already have a ready pojo class to expose, my step should be:

#1 Save the Axis automagically generated wsdl for my pojo

#2 Use the wsdl as input to WSDL2Java specifying that I want serverside
skeletons and xmlbeans databinding

#3 Fill the skeleton with my old pojo business logic or better delegate the
methods 1 to 1 from the skeleton to my pojo.

#4 jar everything and deploy again.

Regarding the #1 could I modify the wsdl before running WSDL2Java? I ask
this because, right now to get rid of this quirk (
http://issues.apache.org/jira/browse/AXIS2-1931 ) I recompiled Axis sources.

Thank you in advance.

--
Davide

-- 
View this message in context: http://www.nabble.com/xsi%3Anil%3D%271%27-Null-what-is-wrong-with-this-soap-body--tf3040150.html#a8475508
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: xsi:nil='1' Null what is wrong with this soap body?

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Bad specifications are a major part of the issue with interoperability 
problems. In the case of SOAP itself, the people who wrote the 
specification left too much unspecified and too many options. In the 
case of XML Schema, the specification is long, complex, and confusing - 
and also provides too many options.

WS-I helped a lot with the basic SOAP features, but didn't address 
Schema - and Schema is increasingly where the interoperability problems 
originate (both directly, when applications use Schema constructs that 
don't work well across frameworks, and indirectly, when the framework 
itself has problems - as in this case). I give some recommendations in 
this area as part of some of my presentations. I just posted the slides 
from my "SOA for Developers" workshop, which includes a fairly extensive 
chunk on schema, at 
http://www.sosnoski.com/jibx-wiki/space/axis2-jibx/soa-for-devs

There is an effort in progress to come up with a sort of WS-I for Schema 
equivalent, through the W3C "XML Schema Patterns for Databinding Working 
Group" (http://www.w3.org/2002/ws/databinding/). It looks like the 
working group is doing a good job on this. I especially like the way 
they're defining patterns that can easily be tested in Schema instances. 
Hopefully within a year or so everyone will be able to use the basic 
patterns and know that they'll be handled properly by all the major data 
binding frameworks (or use some of the advanced ones, and know that 
they'll be limiting themselves to selected frameworks).

  - Dennis

DBDavide wrote:
> ...
>
> <ranting>
> Too many interoperability issues in real world... everything works smootly
> only if both end points uses the same product or I'm really really lucky.
> - If I'm implementing both server and client I don't see the advantage of
> using a so complicated technology.
> - If I'm implementing just one side, the automagically generated wsdl or
> automagically generated client stubs from wsdl it's really a dicer's oath
> :-) 99% of the time you finish digging into wsdl editing or on the wire
> analisys...
>
> I was caught in between :-) I'm implementing both sides and I have two
> products: Axis on the server side and JBossWS on client side. I wouldn't
> wish it upon my worst enemy: time spent on this technology is becoming
> nearly the same time spent implementing the real business logic.
> I think that sometime we lose sight of our real targets. I think that WS-*
> are what I call a "tool" technology, They are a help for our applications.
> Using a screwdriver shouldn't be harder than building a car. 
> How many times, deployng and managing an applications into an application
> server is far more complicated than application itself? If it's happen,
> probably we missed something.
> </ranting>
>
> Bye
>
> --
> Davide
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: xsi:nil='1' Null what is wrong with this soap body?

Posted by DBDavide <db...@gmail.com>.

Dennis Sosnoski wrote:
> 
> This looks to me to be an error in Axis2. The schema spec says the 
> xsi:nil attribute is of type boolean, and boolean allows "0" as 
> equivalent to "false" and "1" as equivalent to "true". 
> 

This morning I had the time to dig into w3c raccomandations. It tooks a
while and I think you are right, both representations are correct:
true/false 1/0

At first reading from http://www.w3.org/TR/xmlschema-1/#xsi_nil it seems
that the correct value is "true": 

"...An element may be ·valid· without content if it has the attribute
xsi:nil with the value true..."

But reading the datatypes spec for boolean
(http://www.w3.org/TR/xmlschema-2/#boolean) I found:


> "...3.2.2.1 Lexical representation
> 
> An instance of a datatype that is defined as ·boolean· can have the
> following legal literals {true, false, 1, 0}.
> 3.2.2.2 Canonical representation
> 
> The canonical representation for boolean is the set of literals {true,
> false}..."
> 

I think that the misunderstanding started from this example taken from XML
Schema Part 0: Primer Second Edition
(http://www.w3.org/TR/xmlschema-0/#Nils): 


> Example
> 
> <xsd:element name="shipDate" type="xsd:date" nillable="true"/>
> 
> <shipDate xsi:nil="true"></shipDate>
> 

So I'll create a Jira.


Dennis Sosnoski wrote:
> 
> Yet another of 
> those nice little quirks that makes schema so much fun for both users 
> and implementors.
> 

Actually, day by day, WS-* are becoming more frustrating than funny for me
;-)

<ranting>
Too many interoperability issues in real world... everything works smootly
only if both end points uses the same product or I'm really really lucky.
- If I'm implementing both server and client I don't see the advantage of
using a so complicated technology.
- If I'm implementing just one side, the automagically generated wsdl or
automagically generated client stubs from wsdl it's really a dicer's oath
:-) 99% of the time you finish digging into wsdl editing or on the wire
analisys...

I was caught in between :-) I'm implementing both sides and I have two
products: Axis on the server side and JBossWS on client side. I wouldn't
wish it upon my worst enemy: time spent on this technology is becoming
nearly the same time spent implementing the real business logic.
I think that sometime we lose sight of our real targets. I think that WS-*
are what I call a "tool" technology, They are a help for our applications.
Using a screwdriver shouldn't be harder than building a car. 
How many times, deployng and managing an applications into an application
server is far more complicated than application itself? If it's happen,
probably we missed something.
</ranting>

Bye

--
Davide
-- 
View this message in context: http://www.nabble.com/xsi%3Anil%3D%271%27-Null-what-is-wrong-with-this-soap-body--tf3040150.html#a8466219
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: xsi:nil='1' Null what is wrong with this soap body?

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
This looks to me to be an error in Axis2. The schema spec says the 
xsi:nil attribute is of type boolean, and boolean allows "0" as 
equivalent to "false" and "1" as equivalent to "true". Yet another of 
those nice little quirks that makes schema so much fun for both users 
and implementors.

Can you create a Jira for this, Davide?

  - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Anne Thomas Manes wrote:
> It should say xsi:nil="true", not xsi:nil="1".
>
> On 1/19/07, DBDavide <db...@gmail.com> wrote:
>>
>> Newbie question:
>>
>> Why I'm getting this exception from Axis2 server when I send null 
>> values?
>> WSDL states nillable='true'.
>> Clients should omit or send NULL values with xsi:nil='1' ?
>>
>> This is the WSDL fragment:
>>
>>       <xs:element name="updateModel">
>>         <xs:complexType>
>>           <xs:sequence>
>>             <xs:element name="code" nillable="true" type="xs:int"/>
>>             <xs:element name="des" nillable="true" type="xs:string"/>
>>             <xs:element name="link" nillable="true" type="xs:int"/>
>>             <xs:element name="date" nillable="true" type="xs:string"/>
>>           </xs:sequence>
>>         </xs:complexType>
>>       </xs:element>
>>
>> This is the SOAP envelope (that to me appears to be correct) sent 
>> from JBoss
>> 1.0.4WS:
>>
>> 2007-01-18 21:18:33,118 TRACE [jbossws.SOAPMessage] Outgoing SOAPMessage
>>
>> <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
>>  <env:Header/>
>>  <env:Body>
>>   <ns1:updateModel xmlns:ns1='http://core.xx.yyy.zzz.com/xsd'
>> xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
>>    <ns1:code xsi:nil='1'/>
>>    <ns1:des>DUMMY</ns1:des>
>>    <ns1:link xsi:nil='1'/>
>>    <ns1:date xsi:nil='1'/>
>>   </ns1:updateModel>
>>  </env:Body>
>> </env:Envelope>
>>
>> Axis2 throws an exception and reply with a fault:
>>
>> <soapenv:Envelope 
>> xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>
>>  <soapenv:Header/>
>>  <soapenv:Body>
>>   <env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
>>    <faultcode>soapenv:Client</faultcode>
>>    <faultstring>Exception occurred while trying to invoke service method
>> updateModel</faultstring>
>>    <detail/>
>>   </env:Fault>
>>  </soapenv:Body>
>> </soapenv:Envelope>
>>
>> On my console I see this Exception:
>>
>> ERROR org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver -
>> Exception occurred while trying to invoke service method updateModel
>> java.lang.IllegalArgumentException
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>> at java.lang.reflect.Method.invoke(Method.java:585)
>> at
>> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:118) 
>>
>> at
>> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39) 
>>
>> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:493)
>> at
>> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:319) 
>>
>> at 
>> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:247)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
>> at 
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
>> at 
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
>> at 
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
>> at 
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
>> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453)
>> at
>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149) 
>>
>> at
>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123) 
>>
>> at 
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
>> at org.mortbay.jetty.Server.handle(Server.java:303)
>> at 
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
>> at
>> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:735) 
>>
>> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:636)
>> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
>> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349)
>> at
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:320) 
>>
>> at
>> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475) 
>>
>>
>>
>> Thanks
>>
>> -- 
>> Davide
>>
>>
>>
>> -- 
>> View this message in context: 
>> http://www.nabble.com/xsi%3Anil%3D%271%27-Null-what-is-wrong-with-this-soap-body--tf3040150.html#a8449923 
>>
>> Sent from the Axis - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: xsi:nil='1' Null what is wrong with this soap body?

Posted by Anne Thomas Manes <at...@gmail.com>.
It should say xsi:nil="true", not xsi:nil="1".

On 1/19/07, DBDavide <db...@gmail.com> wrote:
>
> Newbie question:
>
> Why I'm getting this exception from Axis2 server when I send null values?
> WSDL states nillable='true'.
> Clients should omit or send NULL values with xsi:nil='1' ?
>
> This is the WSDL fragment:
>
>       <xs:element name="updateModel">
>         <xs:complexType>
>           <xs:sequence>
>             <xs:element name="code" nillable="true" type="xs:int"/>
>             <xs:element name="des" nillable="true" type="xs:string"/>
>             <xs:element name="link" nillable="true" type="xs:int"/>
>             <xs:element name="date" nillable="true" type="xs:string"/>
>           </xs:sequence>
>         </xs:complexType>
>       </xs:element>
>
> This is the SOAP envelope (that to me appears to be correct) sent from JBoss
> 1.0.4WS:
>
> 2007-01-18 21:18:33,118 TRACE [jbossws.SOAPMessage] Outgoing SOAPMessage
>
> <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
>  <env:Header/>
>  <env:Body>
>   <ns1:updateModel xmlns:ns1='http://core.xx.yyy.zzz.com/xsd'
> xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
>    <ns1:code xsi:nil='1'/>
>    <ns1:des>DUMMY</ns1:des>
>    <ns1:link xsi:nil='1'/>
>    <ns1:date xsi:nil='1'/>
>   </ns1:updateModel>
>  </env:Body>
> </env:Envelope>
>
> Axis2 throws an exception and reply with a fault:
>
> <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>
>  <soapenv:Header/>
>  <soapenv:Body>
>   <env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
>    <faultcode>soapenv:Client</faultcode>
>    <faultstring>Exception occurred while trying to invoke service method
> updateModel</faultstring>
>    <detail/>
>   </env:Fault>
>  </soapenv:Body>
> </soapenv:Envelope>
>
> On my console I see this Exception:
>
> ERROR org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver -
> Exception occurred while trying to invoke service method updateModel
> java.lang.IllegalArgumentException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:118)
> at
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39)
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:493)
> at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:319)
> at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:247)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453)
> at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
> at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
> at org.mortbay.jetty.Server.handle(Server.java:303)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:735)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:636)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349)
> at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:320)
> at
> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
>
>
> Thanks
>
> --
> Davide
>
>
>
> --
> View this message in context: http://www.nabble.com/xsi%3Anil%3D%271%27-Null-what-is-wrong-with-this-soap-body--tf3040150.html#a8449923
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org