Hi,
The test example I mentioned in this mail also related to Bean Mapping Issues.
In my test, the bean mapping example amples/userguide/example5) works well in 1.0, but fails with (all) 1.1 beta version.
I tested this example on Tomcat 4.1.* and jdk 1.4.1. The XML parser is provided by Tomcat.
Here is the tested result:
The example5/deploy.wsdd contains the following beanMapping:
<beanMapping qName="myNS:Order" xmlns:myNS="urn:BeanService" languageSpecificType="java:samples.userguide.example5.Order"/>
However, after deployment, the sercer-config.wsdd contains this:
<beanMapping languageSpecificType="java:samples.userguide.example5.Order" qname=""/>
The value of qname is invalid.
The example5/Client then gives a null pointer exception when it is run. Trying to extract wsdl also dumps exception in Tomcat.
shawn
>From: James M Snell <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>CC: Doug Davis <[EMAIL PROTECTED]>
>Subject: RE: Bean Mapping Issues
>Date: Fri, 10 Jan 2003 15:09:31 -0800
>
>ok... I merged the two WSDL documents into one WSDL document and the code
>worked. It appears as if there might be some kind of bug with the Axis
>code that consumes WSDL's with imports. The bug was introduced post Axis
>1.0.
>
>- James Snell
> IBM Emerging Technologies
> [EMAIL PROTECTED]
> (559) 587-1233 (office)
> (700) 544-9035 (t/l)
> Programming Web Services With SOAP
> O'Reilly & Associates, ISBN 0596000952
>
> Have I not commanded you? Be strong and courageous.
> Do not be terrified, do not be discouraged, for the Lord your
> God will be with you whereever you go. - Joshua 1:9
>
>
>
>Glen Daniels <[EMAIL PROTECTED]>
>01/09/2003 08:30 PM
>Please respond to axis-dev
>
>
>To
>"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>cc
>Doug Davis/Raleigh/IBM@IBMUS
>bcc
>
>Subject
>RE: Bean Mapping Issues
>
>
>
>
>James:
>
>I made a couple of small changes to your WSDL, notably compressed it into
>one file and corrected the address to match the service on my machine ("
>http://localhost:8080/axis/services/quote"). Then I ran it through
>WSDL2Java, creating a server-side implementation, stubs, and the data
>classes.
>
>Used this impl:
>
>public NasdaqQuotes_types.NasdaqQuote getPrice(java.lang.String symbol)
>throws java.rmi.RemoteException {
>NasdaqQuote nq = new NasdaqQuote();
>nq.setSymbol(symbol);
>nq.setLastSalePrice(45.5D);
>return nq;
>}
>
>Then I ran this:
>
>public class NQTest {
>public static void main(String[] args) throws Exception {
>QName svcQName = new QName("http://NasdaqQuotes-Interface",
>"NasdaqQuotesService");
>QName portQName = new QName("http://NasdaqQuotes-Interface", "quote");
>QName typeQName = new QName("urn:NasdaqQuotes-types", "NasdaqQuote");
>
>Service service = new Service("NasdaqQuotes.wsdl", svcQName);
>Call call = (Call)service.createCall(portQName, "getPrice");
>call.registerTypeMapping(NasdaqQuote.class, typeQName,
>BeanSerializerFactory.class,
>BeanDeserializerFactory.class);
>call.setReturnType(typeQName);
>NasdaqQuote nq = (NasdaqQuote)call.invoke(new Object [] { "foo" });
>System.out.println(nq.toString());
>}
>}
>
>And when I had the debugger stop at the println at the end, the
>NasdaqQuote was filled in correctly. So I don't know what's going on for
>you - it could be that something weird is happening with the import, since
>I did squash it into one WSDL, but that seems unlikely. I'm using the
>latest codebase, btw.
>
>Did you figure anything more out after you were fortified by your snack?
>:)
>
>--Glen
>
> > -----Original Message-----
> > From: James M Snell [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, January 09, 2003 7:18 PM
> > To: [EMAIL PROTECTED]
> > Cc: Doug Davis
> > Subject: RE: Bean Mapping Issues
> >
> >
> > Ok, there definitely *appears* to be a problem.
> >
> > I'm initializing the client using the following code (the
> > WSDL file is
> > attached)
> >
> > private static final QName NQqName =
> > new QName("urn:NasdaqQuotes-types", "NasdaqQuote");
> >
> > QName serviceQN = new QName("http://" + NQ, NQ + "Service" );
> > QName portQN = new QName("http://" + NQ, "quote");
> > Service service = new Service(new URL(wsdlURL), serviceQN );
> > Call call = (Call)service.createCall(portQN, "getPrice");
> > call.registerTypeMapping(
> > NasdaqQuote.class,
> > NQqName,
> > BeanSerializerFactory.class,
> > BeanDeserializerFactory.class);
> > call.setReturnType(NQqName);
> > return (NasdaqQuote)call.invoke( new Object[] { symbol } );
> >
> > When running this, I'm getting the following error while parsing the
> > response.
> >
> > org.xml.sax.SAXException: Bad types (class
> > NasdaqQuote -> class
> > java.lang.String)
> > at
> > org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:309)
> >
> > Digging in, I added a couple of lines of code to RPCHandler
> > to see what
> > was going on and came up with this:
> >
> > Starting at line 215, there is code to retrieve the
> > ParameterDesc for the
> > current element. This lookup is done using the QName of the current
> > element:
> >
> > if (isResponse) {
> > paramDesc = operation.getOutputParamByQName(qname);
> > } else {
> > paramDesc = operation.getInputParamByQName(qname);
> > }
> >
> > Anyway, the code properly serializes the request, sends it to
> > the server,
> > the server processes it right, sends a proper response, then boom, it
> > blows up. The problem appears to be that the paramDesc
> > returned by the
> > above operation is wrong given the qname.
> >
> > isResponse == true
> > qname == getPriceReturn
> > paramDesc ==
> > name: symbol
> > typeEntry: null
> > mode: IN
> > isReturn: false
> > typeQName: {http://schemas.xmlsoap.org/soap/encoding/}string
> > javaType: class java.lang.String
> > inHeader: false
> > outHeader: false
> >
> > In other words, even though a) we're in the response and b) qname ==
> > getPriceReturn, the method operation.getOutputParamByQName is
> > returning an
> > IN only parameter from the request message, not the response.
> >
> > This is making the RPCHandler think it needs to deserialize
> > the data as a
> > string rather than a NasdaqQuote object. This makes it mad
> > and it spits
> > at me. That's not nice and I want it to stop. I've told it to stop
> > spitting at me and it's not listening. That's not nice either.
> >
> > There's either a) something wrong with my WSDL (possible, but
> > unlikely
> > since the code works perfectly with Axis 1.0) or b) something
> > wrong with
> > the code that initializes the call/parameters/etc from the
> > WSDL document.
> > In either case, it's pissing me off. :-) I'm going to grab a
> > snack and
> > keep digging.
> >
> >
> >
> > - James Snell
> > IBM Emerging Technologies
> > [EMAIL PROTECTED]
> > (559) 587-1233 (office)
> > (700) 544-9035 (t/l)
> > Programming Web Services With SOAP
> > O'Reilly & Associates, ISBN 0596000952
> >
> > Have I not commanded you? Be strong and courageous.
> > Do not be terrified, do not be discouraged, for the Lord your
> > God will be with you whereever you go. - Joshua 1:9
> >
> >
> >
> > Glen Daniels <[EMAIL PROTECTED]>
> > 01/09/2003 02:20 PM
> > Please respond to axis-dev
> >
> >
> > To
> > "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> > cc
> >
> > bcc
> >
> > Subject
> > RE: Bean Mapping Issues
> >
> >
> >
> >
> > Hm. Well, to potentially belabor the obvious... why don't
> > you send us the
> > WSDL? :)
> >
> > --Glen
> >
> > > -----Original Message-----
> > > From: James M Snell [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, January 09, 2003 5:09 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: RE: Bean Mapping Issues
> > >
> > >
> > > Starting with a WSDL. This is definitely being caused by a post 1.0
> > > change in the axis code. I just tested again with Axis 1.0
> > > and it works
> > > perfectly.
> > >
> > > - James Snell
> > > IBM Emerging Technologies
> > > [EMAIL PROTECTED]
> > > (559) 587-1233 (office)
> > > (700) 544-9035 (t/l)
> > > Programming Web Services With SOAP
> > > O'Reilly & Associates, ISBN 0596000952
> > >
> > > Have I not commanded you? Be strong and courageous.
> > > Do not be terrified, do not be discouraged, for the Lord your
> > > God will be with you whereever you go. - Joshua 1:9
> > >
> > >
> > >
> > > Glen Daniels <[EMAIL PROTECTED]>
> > > 01/09/2003 01:48 PM
> > > Please respond to axis-dev
> > >
> > >
> > > To
> > > "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> > > cc
> > >
> > > bcc
> > >
> > > Subject
> > > RE: Bean Mapping Issues
> > >
> > >
> > >
> > >
> > > The type mapping defines "NasdaqQuote" as the local part of
> > > the *type*
> > > QName.
> > >
> > > The "getPriceReturn" element name has nothing to do with the
> > > type mapping,
> > > that's the default (operationName + "Return") for operations with no
> > > "returnQName" specified in the WSDD. You can change it by
> > > adding to the
> > > WSDD:
> > >
> > >
> > > xmlns:ns="whatever"/>
> > >
> > > This hasn't changed since 1.0. Are you starting from a
> > WSDL here, or
> > > coding manually? If the former, something may have changed wrt the
> > > WSDL2Java handling....?
> > >
> > > --Glen
> > >
> > > > -----Original Message-----
> > > > From: James M Snell [mailto:[EMAIL PROTECTED]]
> > > > Sent: Thursday, January 09, 2003 3:27 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Bean Mapping Issues
> > > >
> > > >
> > > > Hmm.. I'm trying to chase down a problem I'm having with a
> > > > bean mapping
> > > > declaration and want to see if anyone else can spot the
> > > problem right
> > > > away.
> > > >
> > > > The service worked perfectly with Axis 1.0 and doesn't work now.
> > > >
> > > > Here's the deploy.wsdd
> > > >
> > > > > > xmlns="http://xml.apache.org/axis/wsdd/"
> > > >
> > xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> > > >
> > > >
> > > >
> > > >
> > > > > > > > xmlns:nq="urn:NasdaqQuotes-types"
> > > > languageSpecificType="java:NasdaqQuote"
> > > > qname="nq:NasdaqQuote"/>
> > > >
> > > >
> > > > The "quote" service's "getPrice" method returns a NasdaqQuote
> > > > object that
> > > > has been mapped to the "urn:NasdaqQuotes-types" namespace
> > > > using the qname
> > > > "NasdaqQuote".... however, below is the SOAP message that I'm
> > > > getting in
> > > > response:
> > > >
> > > >
> > > > > > > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> > > >
> > > > > > > > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > > xmlns:ns1="http://NasdaqQuotes-Interface">
> > > > > > > > xmlns:ns2="urn:NasdaqQuotes-types">
> > > > 55.25
> > > > > > xsi:type="xsd:double">55.25
> > > > ACTIVE
> > > > XXX
> > > > 100
> > > > NYSE
> > > > 55.25
> > > > none
> > > >
> > > > 55.25
> > > > 55.25
> > > > 0
> > > > 10
> > > > 0.0
> > > > > > > > xsi:type="xsd:double">55.25
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > The problem should be obvious. Instead of the expected qname
> > > > "NasdaqQuote", the return value is called "getPriceReturn".
> > > > The type is
> > > > right, but the qname is wrong. Under Axis 1.0, the qname was
> > > > NasdaqQuote.
> > > > What changed?
> > > >
> > > > The reason I started having to look into this is that I'm
> > > getting the
> > > > following error when serializing the response:
> > > >
> > > > faultCode:
> > > > {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
> > > > faultSubcode:
> > > > faultString: org.xml.sax.SAXException: Bad types (class
> > > > NasdaqQuote ->
> > > > class java.lang.String)
> > > > faultActor: null
> > > > faultNode: null
> > > >
> > > > Thoughts?
> > > >
> > > > - James Snell
> > > > IBM Emerging Technologies
> > > > [EMAIL PROTECTED]
> > > > (559) 587-1233 (office)
> > > > (700) 544-9035 (t/l)
> > > > Programming Web Services With SOAP
> > > > O'Reilly & Associates, ISBN 0596000952
> > > >
> > > > Have I not commanded you? Be strong and courageous.
> > > > Do not be terrified, do not be discouraged, for the Lord your
> > > > God will be with you whereever you go. - Joshua 1:9
> > > >
> > >
> >
MSN 8 helps eliminate e-mail viruses.