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 Volker Honds <Vo...@de.ibm.com> on 2007/04/16 11:43:59 UTC
[Axis2] Complex types with extension base and generated Axis2 classes
Hi there,
I hope you can help me.
I am using Axis2 1.1.1. and running into problems using the generated Axis2
classes from my xml schema:
1. xml schema (snippet):
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
...
<xsd:complexType name="MyType">
<xsd:complexContent>
<xsd:extension base="xsd:anyType">
<xsd:attribute name="id" type="xsd:anyURI"
use="required"/>
<xsd:anyAttribute processContents="lax"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
...
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2. the generated Java class has a getter and setter for the named attribute
"id".
public class MyType implements org.apache.axis2.databinding.ADBBean {
...
protected org.apache.axis2.databinding.types.URI localId ;
/**
* field for Id This was an Attribute!
*/
protected org.apache.axis2.databinding.types.URI localId;
/**
* Auto generated getter method
*
* @return org.apache.axis2.databinding.types.URI
*/
public org.apache.axis2.databinding.types.URI getId() {
return localId;
}
/**
* Auto generated setter method
*
* @param param
* Id
*/
public void setId(org.apache.axis2.databinding.types.URI param) {
this.localId = param;
}
...
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3. But I am missing a getter and setter to handle the content (of type
anyType). There is no other setter at all.
What I am doing wrong? Thank a lot in advance,
Volker
Volker Honds IBM Deutschland GmbH
IT Specialist Gustav Heinemann Ufer
AS Delivery Application 120-122
Innovation 50968 Köln
Global Business Services Deutschland
(GBS)
IBM Deutschland GmbH
Vorsitzender des
Aufsichtsrats: Hans Ulrich
Maerki , Geschäftsführung:
Martin Jetter
(Vorsitzender), Rudolf
Bauer, Christian Diedrich,
Christoph Grandpierre,
Matthias Hartmann, Andreas
Kerstan
Sitz der Gesellschaft:
Stuttgart -
Registergericht:
Amtsgericht Stuttgart, HRB
14562 - WEEE-Reg.-Nr. DE
99369940
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
[AXIS2] NumberFormatException on parsing null date with hot deployed RPC service
Posted by Nicolae Marasoiu <nm...@kepler-rominfo.com>.
Hi;
In the auto-generated wsdl, I have such a type entry inside a
xs:complexType:
<xs:element name="createdDate" type="xs:dateTime" />
I get:
java.lang.NumberFormatException: badDateTime00
at
org.apache.axis2.databinding.typemapping.SimpleTypeMapper.makeCalendar(Simpl
eTypeMapper.java:214)
at
org.apache.axis2.databinding.typemapping.SimpleTypeMapper.getSimpleTypeObjec
t(SimpleTypeMapper.java:93)
at
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:291)
at
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:299)
at
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:247)
at
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:296)
at
org.apache.axis2.databinding.utils.BeanUtil.processObject(BeanUtil.java:557)
at
org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(BeanUtil.java:507
)
at
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:446)
at
org.apache.axis2.rpc.receivers.RPCUtil.processRequest(RPCUtil.java:109)
at
org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver.invokeBusinessLogic(
RPCInOnlyMessageReceiver.java:84)
How can I make axis generate nillable="true" on these elements also? Or is
it part of xs:dateTime definition?
The exception above is given precisely at asserting not null and not empty
value.
On the wire:
<modifiedDate xmlns:nil="http://www.w3.org/2001/XMLSchema-instance"
nil:nil="true" />.
Another problem I get with hot deployed RPC service is when I have null
array properties. For these nillable=true is generated in wsdl, but still:
org.apache.axiom.om.OMException: java.lang.NullPointerException
at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:194)
at org.apache.axiom.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:318)
at
org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:632)
at
org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:599)
at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:117)
at
org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:249)
at
org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:202)
at org.apache.axis2.rpc.receivers.RPCUtil.processResponse(RPCUtil.java:97)
at org.apache.axis2.rpc.receivers.RPCUtil.processResponse(RPCUtil.java:192)
at
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMes
sageReceiver.java:136)
at
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(Abstract
InOutSyncMessageReceiver.java:39)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:497)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HT
TPTransportUtils.java:328)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:254)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1
212)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1
173)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.
java:92)
at CatchFilter.doFilter(CatchFilter.java:21)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstance
Wrapper.java:142)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.
java:77)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.
java:626)
at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServl
etWrapper.java:80)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(Ht
tpInboundLink.java:421)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(Ht
tpInboundLink.java:367)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.j
ava:276)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscrimin
aters(NewConnectionInitialReadCallback.java:201)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewCon
nectionInitialReadCallback.java:103)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManage
r.java:548)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java
:601)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java
:934)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.jav
a:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Caused by: java.lang.NullPointerException
at
org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:135)
at
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.processProp
erties(ADBXMLStreamReaderImpl.java:948)
at
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.next(ADBXML
StreamReaderImpl.java:821)
at org.apache.axis2.util.StreamWrapper.next(StreamWrapper.java:68)
at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:111)
The workaround I currently use is to make sure there are no null arrays, by
putting empty arrays instead.
Thenk you,
Nicu Marasoiu
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org