Sue, Looking at your types you seem to be looking for some message with attributes, reading SOAP section 5 encoding says (among other thing) that everything is sent along as elements. Because of that rule I am not using "attribute" in my complexType definition.
If you can simply change that attribute to an element and your fine... Sylvain. -----Original Message----- From: Susan Reuland [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 16, 2002 4:06 PM To: [EMAIL PROTECTED] Subject: How to get complex type attributes to work? I'm having a heck of a time getting a complex type attribute from my WSDL schema to be correctly recognized by axis. The simple example below shows what I'd like to do - be able to define an attribute on a complex type. <complexType name="CallRequest"> <sequence> <element name="parm1" type="string" use="required"/> <element name="parm2" type="string" minOccurs="0"/> </sequence> <attribute name="testAttr" type="string" /> </complexType> I can generate all the appropriate stubs and client programs required, i.e., the getter and setter for the attribute are generated in my CallRequest java class and there's even a comment in the java code to indicate that testAttr is an attirbute, but when I invoke my service, I always receive a NullPointerException java.lang.NullPointerException at org.apache.axis.message.SOAPFaultBuilder.endElement(Unknown Source) at org.apache.axis.encoding.DeserializationContextImpl.endElement(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.jav a:559) Looking at the SOAP messages through tcpmon, my request message looks like: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle ="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV ="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:runSvc xmlns:ns1="WebSvcIFPort"> <body xsi:type="ns2:CallRequest" testAttr="MyAttr" xmlns:ns2 ="http://oneParmReal/types"> <parm1 xsi:type="xsd:string">PARM1VAL</programName> <parm2 xsi:type="xsd:string">PARM2VAL</machineName> </body> </ns1:runPgm> </SOAP-ENV:Body> </SOAP-ENV:Envelope> where I've set parm1, parm2 and the attribute value in my client program. This looks OK to me, but the response message has the following fault info: <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode xmlns:ns1 ="http://xml.apache.org/axis/">ns1:Server.userException</faultcode> <faultstring>java.lang.NullPointerException</faultstring> <detail> <ns2:stackTrace xmlns:ns2 ="http://xml.apache.org/axis/">java.lang.NullPointerException
 at org.xml.sax.helpers.AttributesImpl.getValue(Unknown Source)
 at org.apache.axis.message.RPCHandler.onStartChild(Unknown Source)
 at org.apache.axis.encoding.DeserializationContextImpl.startElement(Unknown Source)
 at org.apache.axis.message.SAX2EventRecorder.replay(Unknown Source)
 at org.apache.axis.message.MessageElement.publishToHandler(Unknown Source) 
 at org.apache.axis.message.RPCElement.deserialize(Unknown Source)
 at org.apache.axis.message.RPCElement.getParams(Unknown Source)
 at org.apache.axis.providers.java.RPCProvider.processMessage(Unknown Source)
 at org.apache.axis.providers.java.JavaProvider.invoke(Unknown Source)
 at org.apache.axis.strategies.InvocationStrategy.visit(Unknown Source) 
 at org.apache.axis.SimpleChain.doVisiting(Unknown Source)
 at org.apache.axis.SimpleChain.invoke(Unknown Source)
 at org.apache.axis.server.AxisServer.invoke(Unknown Source)
 at org.apache.axis.transport.http.AxisServlet.doPost(Unknown Source)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) #xd; at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) #xd; at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:243) #xd; at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) #xd; ... </ns2:stackTrace> </detail> </SOAP-ENV:Fault> Axis seems to not be able to figure out the type or value of the attribute. Is there something special that I need to do to get attributes like this to work? Sorry if this is a dumb question, but I've been struggling with this for quite awhile now and decided it was time to ask for help. I'm using the very latest nightly drop axis code, plus the latest xerces jar files also. Thanks! Sue Susan Reuland Dept 48T Phone 507-253-2089 Tie 553-2089 Mail on Lotus Notes: Sue Reuland/Rochester/IBM Mail on Internet: [EMAIL PROTECTED] This message may contain privileged and/or confidential information. If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate or distribute it; do not open any attachments, delete it immediately from your system and notify the sender promptly by e-mail that you have done so. Thank you.
