axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James M Snell" <jasn...@us.ibm.com>
Subject Re: SOAPBodyElement serialization bug
Date Tue, 04 Dec 2001 17:36:47 GMT
David, this is just a guess, but check to make sure that the find_business 
element is being created using createElementNS(...) and not 
createElement(...). 

- James M Snell/Fresno/IBM
    Web services architecture and strategy
    Internet Emerging Technologies, IBM
    544.9035 TIE line
    559.587.1233 Office
    919.486.0077 Voice Mail
    jasnell@us.ibm.com
=================================================================
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 wherever you 
go.  
- Joshua 1:9

Please respond to axis-dev@xml.apache.org 
To:     axis-dev@xml.apache.org
cc: 
Subject:        Re: SOAPBodyElement serialization bug



Fixed the problem I reported, but still getting an error. Not sure why. If
constructing a SOAPBodyElement from an input stream it works, but if
constructing from a DOM element, generates an exception: "Cannot invoke
Call with null namespace URI for method find_business"

Code is as follows:
         Service  service = new Service();
         Call     call    = (Call) service.createCall();

         call.setTargetEndpointAddress( url );
         call.setProperty(HTTPConstants.MC_HTTP_SOAPACTION, "");

         Vector result = null ;

         /* START HACK!!!
         String str = null ;

         str = org.apache.axis.utils.XMLUtils.ElementToString(el);
         SOAPBodyElement body = new SOAPBodyElement(new
java.io.ByteArrayInputStream(str.getBytes()));

         // END HACK!!!! */

         SOAPBodyElement body = new SOAPBodyElement(el);

         Object[] params = new Object[] { body };

         if (debug) {
            System.err.println("\nRequest message:\n" + params[0]);
         }

         result = (Vector) call.invoke( params );


Request message:
<find_business generic="2.0" maxRows="5" xmlns
="urn:uddi-org:api_v2"><findQualif
iers><findQualifier>caseSensitiveMatch</findQualifier></findQualifiers><name>S</
name></find_business>
org.uddi4j.transport.TransportException: Cannot invoke Call with null
namespace
URI for method find_business
        at org.uddi4j.transport.ApacheAxisTransport.send(Unknown Source)
        at org.uddi4j.transport.TransportBase.send(TransportBase.java:53)
        at org.uddi4j.client.UDDIProxy.send(UDDIProxy.java:1658)
        at org.uddi4j.client.UDDIProxy.find_business(UDDIProxy.java:400)
        at FindBusinessExample.run(FindBusinessExample.java:72)
        at FindBusinessExample.main(FindBusinessExample.java:44)

Nested exception:
Cannot invoke Call with null namespace URI for method find_business
        at org.apache.axis.client.Call.invoke(Call.java:1221)
        at org.apache.axis.client.Call.invoke(Call.java:658)
        at org.uddi4j.transport.ApacheAxisTransport.send(Unknown Source)
        at org.uddi4j.transport.TransportBase.send(TransportBase.java:53)
        at org.uddi4j.client.UDDIProxy.send(UDDIProxy.java:1658)
        at org.uddi4j.client.UDDIProxy.find_business(UDDIProxy.java:400)
        at FindBusinessExample.run(FindBusinessExample.java:72)
        at FindBusinessExample.main(FindBusinessExample.java:44)

David Melgar
Web Services Toolkit Development
Emerging Technologies
dmelgar@us.ibm.com


Davanum Srinivas <dims@yahoo.com> on 12/04/2001 11:20:04 AM

Please respond to axis-dev@xml.apache.org

To:   axis-dev@xml.apache.org
cc:
Subject:  Re: SOAPBodyElement serialization bug



Fixed problem, Added test case.

Thanks,
dims

--- David Melgar <dmelgar@us.ibm.com> wrote:
> Updated testcase that still fails. Attribute name ends up as null.
>
> import javax.xml.parsers.DocumentBuilder;
> import javax.xml.parsers.DocumentBuilderFactory;
> import org.w3c.dom.Element;
>
> import org.apache.axis.message.SOAPBodyElement;
>
> public class Testcase1 {
>    public static void main (String args[]) {
>       try {
>          DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance
> ().newDocumentBuilder();
>          Element base = docBuilder.newDocument().createElement("tmp");
>          base.setAttribute("attrib", "foo");
>          SOAPBodyElement body = new SOAPBodyElement(base);
>          System.out.println("Body:" + body);
>       } catch (Exception e) {
>          e.printStackTrace();
>       }
>    }
> }
>
> Example: should be
> <tmp attrib="foo"/>
>
> ends up as
> <tmp null="foo"/>
>
> David Melgar
> Web Services Toolkit Development
> Emerging Technologies
> dmelgar@us.ibm.com
>
> >
> > Davanum Srinivas <dims@yahoo.com> on 12/04/2001 08:51:32 AM
> >
> > Please respond to dims@yahoo.com
> >
> > To:   David Melgar/Raleigh/IBM@IBMUS, Sam Ruby/Raleigh/IBM@IBMUS
> > cc:
> > Subject:  Re: UDDI4J & Axis
> >
> >
> >
> > David,
> > Fixed this bug, please try latest Axis from CVS. I also added a test
case
> > for this problem.
> >
> > Please let me know when you update UDDI4J cvs. We will test things
after
> > that.
> >
> > Thanks,
> > dims
> >
> > --- David Melgar <dmelgar@us.ibm.com> wrote:
> > > I've committed the changes that allow UDDI4J to work with the latest
> > > version of Axis. The release has not been updated.
> > >
> > > There's a hack in the code due to the bug reported below. This still
> > fails
> > > for me. Seems like a pretty basic bug. Would be nice if someone 
could
> fix
> > > this before alpha3 although not critical. Would it get more response
if
> I
> > > open a bug report?
> > >
> > > David Melgar
> > > Web Services Toolkit Development
> > > Emerging Technologies
> > > dmelgar@us.ibm.com
> > > ---------------------- Forwarded by David Melgar/Raleigh/IBM on
> > 12/03/2001
> > > 09:02 PM ---------------------------
> > >
> > > David Melgar/Raleigh/IBM@IBMUS on 11/02/2001 02:48:14 PM
> > >
> > > Please respond to axis-dev@xml.apache.org
> > >
> > > To:   axis-dev@xml.apache.org
> > > cc:
> > > Subject:  SOAPBodyElement serialization bug
> > >
> > >
> > >
> > > I am writing a client that works with DOM elements. This was working
> with
> > > alpha 2. It is no longer working. The problem I'm running into is
when
> a
> > > SOAPBodyElement is created from a DOM element, then serialized to a
> > string,
> > > the element names all end up as null.
> > >
> > > The testcase below is very simple illustration of the problem.
> > > SOAPBodyElement converted to a string shows up as "<null/>".
> > >
> > >
> > > import javax.xml.parsers.DocumentBuilder;
> > > import javax.xml.parsers.DocumentBuilderFactory;
> > > import org.w3c.dom.Element;
> > > import org.apache.axis.message.SOAPBodyElement;
> > >
> > > public class Testcase1 {
> > >    public static void main (String args[]) {
> > >       try {
> > >          DocumentBuilder docBuilder =
> DocumentBuilderFactory.newInstance
> > > ().newDocumentBuilder();
> > >          Element base = docBuilder.newDocument().createElement
("tmp");
> > >          SOAPBodyElement body = new SOAPBodyElement(base);
> > >          System.out.println("Body:" + body);
> > >       } catch (Exception e) {
> > >          e.printStackTrace();
> > >       }
> > >    }
> > > }
> > >
> > > David Melgar
> > > Web Services Toolkit Development
> > > Emerging Technologies
> > > dmelgar@us.ibm.com
> > >
> > >
> > >
> >
> >
> > =====
> > Davanum Srinivas - http://jguru.com/dims/
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Buy the perfect holiday gifts at Yahoo! Shopping.
> > http://shopping.yahoo.com
> >
> >
>
>
> =====
> Davanum Srinivas - http://jguru.com/dims/
>
> __________________________________________________
> Do You Yahoo!?
> Buy the perfect holiday gifts at Yahoo! Shopping.
> http://shopping.yahoo.com
>
>
>
>
>
>


=====
Davanum Srinivas - http://jguru.com/dims/

__________________________________________________
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com





Mime
View raw message