Hi I'm writing my first web service with axis. I wrote a WSDL, ran
wsdl2java.bat to generate server side code. Compiled. Build the aar and
deployed it in tomcat.I then sent it a couple sample soap files and got
unexpected results. This makes me think that some of the xsd features I used
are not supported by Axis, namely the abstract attribute and inheiritance of
complex types. Can someone confirm my suspicions or tell me where I'm going
wrong?The first message I sent was:<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:m0="http://consumermgr.sss.com/consumermgr"> <SOAP-ENV:Body>
<m:addDevice xmlns:m="http://consumermgr.sss.com"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<addDeviceInputParam> <m0:header>
<m0:timestamp>2001-12-17T09:30:47.0Z</m0:timestamp>
<m0:fromId>0</m0:fromId> </m0:header>
<m0:deviceId> <m0:idType/> <m0:id/>
</m0:deviceId> <m0:attributes></m0:attributes>/>
</addDeviceInputParam> </m:addDevice>
</SOAP-ENV:Body></SOAP-ENV:Envelope>The response I got was:<?xml version="1.0"
encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body>
<soapenv:Fault> <faultcode>soapenv:Client</faultcode>
<faultstring>Please implement
com.sss.consumermgr.consumermgr.ConsumerMgrServiceSkeleton#addDevice</faultstring>
<detail/> </soapenv:Fault>
</soapenv:Body></soapenv:Envelope>apparently meaning that the soap message was
validated. How can this be?! m0:attributes is defined as a complextype for
which abstract="true". That means that it is invalid for it to appear in an
actual instance! Is the abstract attribute not supported by Axis???The second
soap message I sent was:<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:m0="http://consumermgr.sss.com/consumermgr"> <SOAP-ENV:Body>
<m:addDevice xmlns:m="http://consumermgr.sss.com"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<addDeviceInputParam> <m0:header>
<m0:timestamp>2001-12-17T09:30:47.0Z</m0:timestamp>
<m0:fromId>0</m0:fromId> </m0:header>
<m0:deviceId> <m0:idType/> <m0:id/>
</m0:deviceId> <m0:attributes
xsi:type="STBAttributeSetType"><m0:password>MyPW</m0:password></m0:attributes>/>
</addDeviceInputParam> </m:addDevice>
</SOAP-ENV:Body></SOAP-ENV:Envelope>The Response was:<?xml version="1.0"
encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body>
<soapenv:Fault> <faultcode>soapenv:Client</faultcode>
<faultstring>java.lang.RuntimeException: Unsupported type null
STBAttributeSetType</faultstring> <detail/> </soapenv:Fault>
</soapenv:Body></soapenv:Envelope>Now in my schema STBAttributeSetType is
defined as extending an abstract complex type. <attributes> is of type that
abstract type. Therefore the axis-generated server code should like
STBAttributeSetType. Does the "Unsupported type" error it returns mean that
axis doesn't support complextype inheiritance?Thanks,Raine
_________________________________________________________________
Make every IM count. Download Windows Live Messenger and join the i’m
Initiative now. It’s free.
http://im.live.com/messenger/im/home/?source=TAGWL_June07