Re: Consume XML using Axis2 without creating Java objects

2009-10-07 Thread Amila Suriarachchi
On Tue, Oct 6, 2009 at 7:27 PM, mule_user s...@aol.com wrote:


 Please advise what are my choices for the situation below:

 I receive XML as the input. I have no need (nor, have any intention) of
 creating any Java object out of the incoming XML. Could you please explain
 how can the incoming XML be consumed using using Axis 2? I may want to
 apply
 XSLT on the XML. But I have no need (nor have any desire) to create any
 Java
 object.

 Following are my questions:
 1. What do I have to do to just consume the incoming XML? Please explain
 the
 steps needed for doing so using Axis2. In other words, I have no need (nor
 any desire) to convert the XML into a corresponding Java object. I just
 want
 to process the XML object as it comes. I may run XSLT on the incoming XML.
 I
 just want to consume that XML without going through the overhead of
 creating
 additional Java objects.

 2. Or, do I still have to execute wsdl2Java and use the generated
 client/stub Java classes for processing the XML?


Have a look at here to  understand how you can write a custom message
receiver[1]. At your message
receiver you can get the xmlstream without building the message using this
method

inMessage.getEnvelope().getBody().getFirstElement().getXMLStreamReaderWithoutCaching()

thanks,
Amila.


[1] http://wso2.org/library/articles/extending-axis2



 --
 View this message in context:
 http://www.nabble.com/Consume-XML-using-Axis2-without-creating-Java-objects-tp25769238p25769238.html
 Sent from the Axis - User mailing list archive at Nabble.com.




-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/


Disable wsdl url

2009-10-07 Thread Darshana ®
Hello,

I want to disable people accessing the wsdl. Currently any one can access
wsdl of the my axis2 project through
home_url:9002/web/services/Axis2WS?wsdl.

I just want to restrict people accessing the wsdl, simply I want to disable
the wsdl url.

But I couldnt find a way to do this, it'll be a great help if any body can
give me a solution for this.

Thanks


Class-cast exception - SOAPBodyElement

2009-10-07 Thread Chris Mannion
Hi All

I have an issue with one deployment of a piece of software I've
written using Axis.  I have a web-service client that retrieves a
javax.xml.soap.SOAPMessage as the service response, pulls out a
javax.xml.soap.SOAPBody from that response and then gets the first
body element from that to return as the service response.  The code
for processing the response is as follows -

SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
SOAPConnection con = scf.createConnection();
SOAPMessage response = con.call(message, endpointAddress);

SOAPBody responseBody = response.getSOAPBody();
Iterator it = responseBody.getChildElements();
if(it.hasNext())
{
  org.apache.axis.message.SOAPBodyElement next =
(org.apache.axis.message.SOAPBodyElement)it.next();
  StringWriter writer = new StringWriter();
  next.output(new SerializationContext(writer));
  String outputted = writer.toString();
  return outputted;
}

So, as you can see, the code assumed that Axis is the underlying
implementation of the javax.xml.soap interfaces, so we can class-cast
to an Axis SOAPBodyElement.  This usually works well because we deploy
with Axis on the classpath so that it is picked up as the
implmentation.  However, on one system the class-cast fails because
the underlying object is
com.sun.xml.internal.messaging.saaj.soap.ver1_1.BodyElement_1Impl.

So, my questions are
1) Am I right in thinking that this is likely down to either the Axis
jar being missing from the classpath, or another jar that implements
javax.xml.soap has a higher priority on the classpath?
2) Does anyone know what jar file the
com.sun.xml.internal.messaging.saaj.soap.ver1_1.BodyElement_1Impl
class is likely to be being picked up from?  The saaj jar files I have
on my own system don't include it, though I haven't had chance to
investigate the problem system yet.
3) This is deployed in a Tomcat environment, are there any places in
Tomcat or the JVM I should concentrate on looking for a jar file that
is overriding the Axis jar (which should be in
tomcat/webapps/web-app/WEB-INF/lib/)?

Thanks so much for any help.

-- 
Chris Mannion


Stop SimpleHttpServer

2009-10-07 Thread Lorenzo Carnevale

Hello everybody
I have an ant task that starts the standalone axis2 server:

target name=start.server 
   java classname=org.apache.axis2.transport.http.SimpleHTTPServer 
fork=true

   classpath refid=axis2.class.path/
   /java
/target

I run this task from eclipse. The problem is that pressing the red button 
on the console doesn't really stop the service (I think this is because of 
the 'fork' option), so if I execute this task 5 times, I have 5 different 
processes running!!
Is there a way to STOP the standalone axis server from an ant task OR 
inovking an URL?

Thanks
   Lorenzo 



Re: Class-cast exception - SOAPBodyElement

2009-10-07 Thread Mike Rheinheimer
Hi Chris,

1)  yes, sort of
2)  in rt.jar from the Sun JVM
3)  maybe

:)  Sorry for the ambiguous answers.  The SAAJ factory implementations
that get picked up are defined by the META-INF/services/* files in the
axis2-saaj-1.5.jar library in the axis2 distribution, with the JVM
deciding who the default is if these services/* files don't get picked
up.  So, presumably that means this axis2-saaj-1.5.jar is not on the
classpath, or as you said, is being usurped by another jar that does
have the services/* files that points to the Sun SAAJ implementation.

mike

On Wed, Oct 7, 2009 at 6:24 AM, Chris Mannion
chris.mann...@nonstopgov.com wrote:

 Hi All

 I have an issue with one deployment of a piece of software I've
 written using Axis.  I have a web-service client that retrieves a
 javax.xml.soap.SOAPMessage as the service response, pulls out a
 javax.xml.soap.SOAPBody from that response and then gets the first
 body element from that to return as the service response.  The code
 for processing the response is as follows -

 SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
    SOAPConnection con = scf.createConnection();
    SOAPMessage response = con.call(message, endpointAddress);

    SOAPBody responseBody = response.getSOAPBody();
    Iterator it = responseBody.getChildElements();
    if(it.hasNext())
    {
      org.apache.axis.message.SOAPBodyElement next =
 (org.apache.axis.message.SOAPBodyElement)it.next();
      StringWriter writer = new StringWriter();
      next.output(new SerializationContext(writer));
      String outputted = writer.toString();
      return outputted;
    }

 So, as you can see, the code assumed that Axis is the underlying
 implementation of the javax.xml.soap interfaces, so we can class-cast
 to an Axis SOAPBodyElement.  This usually works well because we deploy
 with Axis on the classpath so that it is picked up as the
 implmentation.  However, on one system the class-cast fails because
 the underlying object is
 com.sun.xml.internal.messaging.saaj.soap.ver1_1.BodyElement_1Impl.

 So, my questions are
 1) Am I right in thinking that this is likely down to either the Axis
 jar being missing from the classpath, or another jar that implements
 javax.xml.soap has a higher priority on the classpath?
 2) Does anyone know what jar file the
 com.sun.xml.internal.messaging.saaj.soap.ver1_1.BodyElement_1Impl
 class is likely to be being picked up from?  The saaj jar files I have
 on my own system don't include it, though I haven't had chance to
 investigate the problem system yet.
 3) This is deployed in a Tomcat environment, are there any places in
 Tomcat or the JVM I should concentrate on looking for a jar file that
 is overriding the Axis jar (which should be in
 tomcat/webapps/web-app/WEB-INF/lib/)?

 Thanks so much for any help.

 --
 Chris Mannion