Sessionless axis?
Hi! How do I make the axis servlet not spawn sessions? I am currently hosting some webservices that perform atomic actions, and might receive a high number of requests per minute. I don't need to keep sessions, and it would give my server some rest not to have a session spawn every time a hit arrives. Thank you, -- Javier Gonzalez Nicolini
Re: [axis] javac log4j error message
Check your classpath maybe? On 9/6/05, Thompson, Dave M. (IPG IT CP Arch) [EMAIL PROTECTED] wrote: Hi, A newbie question: I've installed axis and now every time I compile I get a log4j error. Example: Using: javac x.java Against source code: public class x { public static void main(String[] args) { } }; Results in error: Error reading c:\...(path to axis installation directory...\axis-1_2\lib\log4j.properties; java.util.zip.ZipException: error in opening zip file. Why does javac try and read anything from axis? Why is it concerned with log4j? Thanks, Dave -- Javier Gonzalez Nicolini
Re: accessing tomcat context in Axis service object
while I don't know how to access the context in the way you want, what I've done is encapsulate the data access stuff (the initialcontext, lookup datasource, etc) in a separate class, and when I need a connection I call a method from that class. Then I initialize that class on a servlet and bob's your uncle. On 9/2/05, sanugu [EMAIL PROTECTED] wrote: Hi, I am developing a web service, which has to insert the data into Oracle database. I am not able to get the datasource object created as a global resource. I also, created a resource link for 'AXIS' web module. My Server is tomcat 5.0, and I configured Axis on it, and its working fine with simple test services. My service object calls a DAO class, where I am creating an Initial context and loop up the datasource. But my service object throws an exception. Context ctx=new InitialContext(); DataSource ds = (DataSource)ctx.lookup(jdbc/axisDS); OR Thinking that axis has to create the server context with binding variables, I used the following code Properties props=new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY,org.apache.naming.java.javaURLContextFactory); props.put(Context.PROVIDER_URL, t3://localhost:80); (my server is running on port 80). Context ctx=new InitialContext(props); DataSource ds = (DataSource)ctx.lookup(jdbc/axisDS); When use this code, Exception is : jdbc is not bound in this Context Context envCtx = (Context) (new InitialContext()).lookup(java:comp/env); This code throw an exception is java:comp is not bound in this Context Could somebody give me the clear directioins of creating and calling the datasource from axis. -thanks -- Javier Gonzalez Nicolini
Re: Beginer site
http://ws.apache.org/axis/java/user-guide.html On 9/1/05, Dru Devore [EMAIL PROTECTED] wrote: I need to get some people up and running on developing web services with axis quickly and I don't have the time to teach them. Is there any suggestions of sites I can direct them to so they can do some quick learning? Thanks Dru Devore So many suggestions so little time. -- Javier Gonzalez Nicolini
Sending attachments to message-style service?
Anybody got a link to a guide for doing that? (had no luck with the wiki examples) Thanks in advance, -- Javier Gonzalez Nicolini
Re: NoClassDefFoundError while running a servlet, no problem while running as a program!
) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:711) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:687) at java.lang.Thread.run(Thread.java:534) Apache Tomcat/4.1.30-LE-jdk14 -- Javier Gonzalez Nicolini
Re: NoClassDefFoundError while running a servlet, no problem while running as a program!
) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:711) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:687) at java.lang.Thread.run(Thread.java:534) root cause java.lang.NoClassDefFoundError: org/apache/axis/client/Service at jdb.biogis.ENBI.BUFFIE.Client1.doGet(Client1.java:28) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at jdb.servlets.filters.XSLTFilter.doFilter(XSLTFilter.java:214) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:711) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:687) at java.lang.Thread.run(Thread.java:534) Apache Tomcat/4.1.30-LE-jdk14 -- Javier Gonzalez Nicolini -- Javier Gonzalez Nicolini
Using MimeBodyParts as attachments
Hi, Anybody got a pointer at how to implement a message-style axis web service that uses attachments (sends them to the service)? -- Javier Gonzalez Nicolini
Re: service url
Anyway, so now, my question is how to host two services, which are defined in two separate WSDL files, which can't be edited (obviously), and happen to literally share a port name. Deploy them using server-config.wsdd, and use your naming hierachy. service name=foo/bar/myFooBarService provider=java:MSG style=message use=literal ... /service and you will then have the url http://HOST/CONTEXT/services/foo/bar/myFooBarService for accesing your web service. Hope that helps, Javier. thanks, Deepak S Patwardhan. -- On Mon, 29 Aug 2005, Guy Rixon wrote: WS-I basic profile expects developers to define one port per service. I think the underlying philosphy is that each SOAP endpoint has one remote object and all the operations on that endpoint work as methods on that one object. I agree that this is limiting. It's often nice to aggregate ports. On Mon, 29 Aug 2005, Deepak S Patwardhan wrote: HI all, My question is about the way axis makes a service URL. Normally, you see a URL like the following : http://host:unix-port/axis/services/PORT-NAME where, PORT-NAME is a port defined in the service element. Is it possible that the service URL be like this : http://host:unix-port/axis/services/SERVICE-NAME/PORT-NAME where SERVICE-NAME is the name of the service ? (attribute name of service element) This would look more logical, especially when a service contains multiple ports. I tried specifying such URLs in the WSDL but axis overrides it. (please see the attached WSDL.) WHen I deploy my service (service Primality, two ports, a) Prime - to check whether a number is prime, b) CoPrime - to check whether two numbers are coprime), and when I see the list of deployed services, I expected a listing like this * Primality -Prime - isPrime -CoPrime - areCoPrime But, what is displayed is as if there are two services, Prime and CoPrime. * Prime - isPrime * CoPrimes - areCoPrime It seems as if axis elevates a PORT to a service. What's the design decision behind this ? (And if you tell me that AXIS expects developers to define one port per service, I would be pretty p***ed off) thanks, Deepak S Patwardhan. -- Javier Gonzalez Nicolini
Re: Axis 1.2.1 not calling my class!
Jeff, thank you very much! Turns out that my handler was ok, but I wasn't doing the configuration part right. Once I properly inserted the handler in the request flow it worked. Thanks again, Javier. On 8/25/05, Jeff Greif [EMAIL PROTECTED] wrote: Read the user guide. It explains how to put the handler in the request flow using the deployment descriptor (in a .wsdd file). Jeff Javier Gonzalez wrote: Jeff, thanks for your reply. I was thinking that I needed a Handler, too, but when it comes to handlers the documentation is pretty scant. Do you know how to put the handler before the axis engine drops my message as not understood? thanks again On 8/25/05, Jeff Greif [EMAIL PROTECTED] wrote: I believe, but am not certain, that some Handler must remove any headers marked mustUnderstand=1. This may have to be done before the pivot (that is before the implementation method is called in the server). I am not aware of any way to mark a header element as processed (but such a way might exist nonetheless). Jeff Javier Gonzalez wrote: Hi, I have a message service over axis 1.2.1, java 1.5, tomcat 5.5. But it seems like it isn't calling my published class at all - thus my code that marks mustUnderstand=1 HeaderElements as processed never gets executed, and the message is rejected with didn't understand MustUnderstand headers. The service is published like this: service name=MessageService provider=java:MSG style=message use=literal parameter name=scope value=request/ parameter name=className value=my.package.mms.mm7receiver.MessageService/ parameter name=allowedMethods value=echoElements/ ... class' own parameters ... /service How do I tell Axis that I understand the mustUnderstand header so it will let the message through? -- Javier Gonzalez Nicolini
NodeImpl not found?
Hi! I have a webservice that creates a soap response that must be sent to the caller - so, at a given time I have a SOAPBody object that must be set as the body of the response. But when I do resp.setBody(mySoapBody); I get this: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: org.w3c.dom.DOMException: NodeImpl Not found at org.apache.axis.message.SOAPBody.setParentElement(SOAPBody.java:91) at org.apache.axis.message.SOAPEnvelope.setBody(SOAPEnvelope.java:308) at my.package.mms.mm7receiver.MessageService.echoElements(MessageService.java:105) root cause being: Caused by: org.w3c.dom.DOMException: NodeImpl Not found at org.apache.axis.message.NodeImpl.removeChild(NodeImpl.java:515) at org.apache.axis.message.SOAPEnvelope.removeChild(SOAPEnvelope.java:616) at org.apache.axis.message.NodeImpl.detachNode(NodeImpl.java:660) at org.apache.axis.message.NodeImpl.appendChild(NodeImpl.java:493) at org.apache.axis.message.NodeImpl.setParent(NodeImpl.java:791) at org.apache.axis.message.NodeImpl.setParentElement(NodeImpl.java:632) ... 32 more This happened after switching the app from Axis 1.1 to axis 1.2, due to 1.1's misbehaviour while dealing with mustUnderstand headers (rejecting soap but passing message along the chain for further processing) Thanks in advance, -- Javier Gonzalez Nicolini
Axis 1.2.1 not calling my class!
Hi, I have a message service over axis 1.2.1, java 1.5, tomcat 5.5. But it seems like it isn't calling my published class at all - thus my code that marks mustUnderstand=1 HeaderElements as processed never gets executed, and the message is rejected with didn't understand MustUnderstand headers. The service is published like this: service name=MessageService provider=java:MSG style=message use=literal parameter name=scope value=request/ parameter name=className value=my.package.mms.mm7receiver.MessageService/ parameter name=allowedMethods value=echoElements/ ... class' own parameters ... /service How do I tell Axis that I understand the mustUnderstand header so it will let the message through? -- Javier Gonzalez Nicolini
how to indicate that I understand mustUnderstand-marked headers? (please help)
I have a service (Axis 1.2.1/Linux/Sun JVM 1.5/Tomcat 5.5.9) that is being fed this SOAP input: ?xml version=1.0 ? env:Envelope xmlns:env=http://schemas.xmlsoap.org/soap/envelope/; env:Header mm7:TransactionID xmlns:mm7=http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2; env:mustUnderstand=1[EMAIL PROTECTED]/mm7:TransactionID /env:Header env:Body DeliverReq xmlns=http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2; MM7Version5.3.0/MM7Version Sender Number5698559357/Number /Sender Recipients To Number6272/Number /To /Recipients SubjectMultimedia Message/Subject Content href=cid:mms_cid/ /DeliverReq /env:Body /env:Envelope The problem is that the Axis engine is rejecting the message on mustUnderstand grounds - before my own class that implements the service has a chance to even see the message: 2005-08-25 17:18:07,873 [apache.axis.EXCEPTIONS:org.apache.axis.transport.http.AxisServlet.processAxisFault(AxisServlet.java:386)] DEBUG - AxisFault: AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}MustUnderstand faultSubcode: faultString: Did not understand quot;MustUnderstandquot; header(s): faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace: at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:96) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) {http://xml.apache.org/axis/}hostname:desarrollo Durint the whole invocation my class isn't called. I tried implementing my own handler (subclassing BasicHandler) and add it to the service, but it didn't get there either. PLEASE help. Thanks in advance. -- Javier Gonzalez Nicolini
mustUnderstand fault even after setProcessed(true)
Hi. I have deployed a (message) web service with axis 1.1, but the service is answering http/500, mustUnderstand failed. I find this extremely weird, since I have marked the header as processed, like this: SOAPHeaderElement soapHeaderElement; try { Iterator it = req.getHeader().getChildElements(); while (it.hasNext()) { soapHeaderElement = (SOAPHeaderElement) it.next(); if (soapHeaderElement.getMustUnderstand()) { soapHeaderElement.setProcessed(true); } } } catch (Exception e) { log.error(Error al obtener el Header del mensaje recibido); throw new MM7Exception(MM7Exception.SERVER, The header from the received message couldn't be get., MM7_RES.SC_SERVERROR, e.getMessage()); } The code executes (there is no exception raised) but the service returns that it didn't understand the header with mustUnderstand=1. This is the incoming message: ?xml version=1.0 encoding=UTF-8? env:Envelope xmlns:env=http://schemas.xmlsoap.org/soap/envelope/; env:Header mm7:TransactionID env:mustUnderstand=1 xmlns:mm7=http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2;[EMAIL PROTECTED]/mm7:TransactionID /env:Header env:Body DeliverReq xmlns=http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2; MM7Version5.3.0/MM7Version Sender Number1234567890/Number /Sender Recipients To Number1234/Number /To /Recipients SubjectTest/Subject Content href=cid:mms_cid/ /DeliverReq /env:Body /env:Envelope And this is what is going back through the wire: ?xml version=1.0 encoding=UTF-8? soapenv:Envelope 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:Body soapenv:Fault faultcodesoapenv:MustUnderstand/faultcode faultstringDid not understand quot;MustUnderstandquot; header(s):/faultstring detail/ /soapenv:Fault /soapenv:Body /soapenv:Envelope This is Axis 1.1 running on Tomcat 5.5/Linux. Any help is appreciated. -- Javier Gonzalez Nicolini
Re: Is there any way to set up the Axis running without depending on any web server?
Be sure to read the line that says Not for production use twice ;) On 8/19/05, Chen, Donald [EMAIL PROTECTED] wrote: Jeff, thanks for this secret Standalone. Don -Original Message- From: Jeff Greif [mailto:[EMAIL PROTECTED] Sent: Thursday, August 18, 2005 4:32 PM To: axis-user@ws.apache.org Subject: Re: Is there any way to set up the Axis running without depending on any web server? http://wiki.apache.org/ws/FrontPage/Axis/Standalone Chen, Donald wrote: Hi, there. This may be a ridiculous question, but I can not help to wonder if Axis has to live with a web server like Tomcat or WebLogic to be functioning? If there is a way for Axis be functioning solely on its own feet, that will be great. -- Javier Gonzalez Nicolini
Re: How to get hold of current servlet context and session in axis 1.2
If I see it right, you are missing a step. This instruction: (HttpSession)messageContext.getProperty( HTTPConstants.MC_HTTP_SERVLETREQUEST); will return a HttpServletRequest object, not a HttpSessionObject. You need to do: HttpSession session =((HttpServletRequest)messageContext.getProperty( HTTPConstants.MC_HTTP_SERVLETREQUEST)).getSession(); On 8/17/05, shantanu chawla [EMAIL PROTECTED] wrote: my webservice running is axis1.2RC3 needs to access current servlet session and servletContext. I believe axis is running as a servlet so I can get hold of the session and servlet context. I am using this code: MessageContext messageContext = MessageContext.getCurrentContext(); HttpServlet servlet = (HttpServlet)messageContext.getProperty(HTTPConstants.MC_HTTP_SERVLET); ServletContext servletContext = (ServletContext)servlet.getServletContext(); HttpSession session =(HttpSession)messageContext.getProperty( HTTPConstants.MC_HTTP_SERVLETREQUEST); I am getting java.lang.ClassCastException on casting to HttpSession. I am doing the right thing Thanks Shantanu Chawla -- Graduate Student Department of Computer Science, San Diego State University -- Javier Gonzalez Nicolini
Re: adding elements to soap message?
I think I might need to add the element at a specific place in the soap xml. However, I can't find a method to insert a child element of a soapelement in a specific location in the javadocs. Any help please? On 8/12/05, Javier Gonzalez [EMAIL PROTECTED] wrote: Hi! I receive soap messages via a document axis webservice, and I'm trying to add an optional node to the soap message before relaying it to some other place for further processing. I'm trying this: SOAPElement attachid = ParentNodeOfOptional.addChildElement(NameOfOptionalNode); attachid.addTextNode(ValueOfOptionalNode); But when I print ParentNodeOfOptional.toString() the optional node isn't added. What am I doing wrong? Thanks in advance. -- Javier Gonzalez Nicolini -- Javier Gonzalez Nicolini
Re: RES: Error - java.lang.reflect.InvocationTargetException?
I'm not sure I'm understanding you two - calling all sorts of Java classes is possible with axis. Are you sure you have all the needed classes in the webapp classpath? Does your class need special parameters for its constructor? On 8/16/05, Fabrício [EMAIL PROTECTED] wrote: Hi Donald, In my case, I really need to have the call to method from another class. My web service is a kind of wrapper for a legacy application. And to do the call, it's necessary to escort stdin and stderr. And I'm doing this with two threads. As: cmd = d:\\programs\\cap3\\cap3 + newPath + my_seqs; process = Runtime.getRuntime().exec(cmd); StringBuffer inBuffer = new StringBuffer(); InputStream inStream = processo.getInputStream(); new InputStreamHandler( inBuffer, inStream ); StringBuffer errBuffer = new StringBuffer(); InputStream errStream = processo.getErrorStream(); new InputStreamHandler( errBuffer , errStream ); process.waitFor(); The InputStreamHandler is another java class. I really don't know how to solve it without the use of these threads (another class). :'-( -- Fabrício. -Mensagem original- De: Chen, Donald [mailto:[EMAIL PROTECTED] Enviada em: terça-feira, 16 de agosto de 2005 16:14 Para: [EMAIL PROTECTED]; axis-user@ws.apache.org Assunto: RE: Error - java.lang.reflect.InvocationTargetException? Yes, exactly. The moment I let the method in the WS call another class, I got the problem. Looks like we are on the same boat. Right now, I am trying to rewrite the service provider class to avoid the unnecessary calling. Also, I suspect the Tomcat is not able to find all the necessary jars to facilitating the call. Let me know what's your finding? Don -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 16, 2005 1:31 PM To: axis-user@ws.apache.org; Chen, Donald Subject: Re: Error - java.lang.reflect.InvocationTargetException? Hi, I'm having the same problem and in my case is because my web service needs to call a method from a common java class. I need to do this, but I think that isn't possible in Axis. Does your web service has a method call to another class to? -- Fabricio. Citando Chen, Donald [EMAIL PROTECTED]: Hi, there. I got a Error - java.lang.reflect.InvocationTargetException complain when I tried to invoke a web service. Any idea on how to find out what's going wrong? And what could be the reason(s)? Thanks. Don PS. Configure: WinXPPro Tomcat5.5/Axis1.2/JRE1.5 This message was sent using IMP, the Internet Messaging Program. -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.10/73 - Release Date: 15/8/2005 -- Javier Gonzalez Nicolini
Get IP address of axis webservice clients?
Hi, I have a document webservice made with axis, and I have this problem: One of the clients of said service isn't very reliable, they are supposed to provide a certain ID inside the soap message but they can't really counted on to provide it. I would like to have the IP address of the client as a backup measure if/when they do not provide the required ID. Is that posible using axis? -- Javier Gonzalez Nicolini
Re: Get IP address of axis webservice clients?
Thanks! Yes, it revolves around getting access to the HttpServletRequest object. Finally did it like this: String ipaddy = ((HttpServletRequest)MessageContext.getCurrentContext().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST)).getRemoteAddr(); On 8/11/05, Linus Kamb [EMAIL PROTECTED] wrote: Don't know if this is standard or even works in all cases (like when using proxy, or whatnot,) but I do: MessageContext ctxt = MessageContext.getCurrentContext(); logger.debug(ctxt: + ctxt ); logger.debug( transport: + ctxt.getTransportName()); javax.servlet.ServletRequest request = (javax.servlet.ServletRequest) ctxt.getProperty( transport.http.servletRequest ); logger.debug( caller: + request.getRemoteAddr() + [ + request.getRemoteHost() + ] ); This is from servlet stuff, I think. Javier Gonzalez wrote: Hi, I have a document webservice made with axis, and I have this problem: One of the clients of said service isn't very reliable, they are supposed to provide a certain ID inside the soap message but they can't really counted on to provide it. I would like to have the IP address of the client as a backup measure if/when they do not provide the required ID. Is that posible using axis? -- Javier Gonzalez Nicolini
Re: Happyaxis reports problems loading libraries, found but with problems
The first problem could be avoided by leaving xmlsec in the webapp lib dir. As for the second one... I do not know :( On 8/5/05, Thad Humphries [EMAIL PROTECTED] wrote: I have almost the problem as Jonathan. I'm running Tomcat 5.5.9 with Java 1.5 on Linux. My message reads: See http://xml.apache.org/security/ {4} The root cause was: org/apache/commons/logging/LogFactory This happens whether I put xmlsec-1.2.1.jar in $CATALINA_HOME/common/lib or $CATALINA_HOME/common/endorsed. When I put xmlsec-1.2.1.jar in $CATALINA_HOME/webapps/axis/WEB-INF/lib, the message was See http://xml.apache.org/security/ {4} The root cause was: {0} What does this mean? Should I be using an older version of xmlsec-1.2.1.jar? On Friday 05 August 2005 09:58, Javier Gonzalez wrote: Where are xmlsec.jar and activation.jar located? (the hint that the error message told you) IIRC, in Tomcat the classloaders are ordered like this: webapp - shared - common - system. The classloaders can look in that order and not in the reverse order. That is, if A.jar is on the webapp lib dir, B.jar is in shared/lib, and A depends on B, it's ok, since the webapp classloader can ask the next classloader for B. But if B depends on A, then you'll have an error because the shared classloader can't look back into the webapp classloader. On 8/5/05, Jonathan J. Vargas R. [EMAIL PROTECTED] wrote: Greets, I tried to install xmlsec into axis, but seems axis has problems doing this. The problem is with xmlsec, but I still don't know how to solve it or fix it. I am using tomcat, This is the happyaxis report: Optional Components Warning: could not find a dependency of class org.apache.xml.security.Init from file xmlsec.jar XML Security is not supported See http://xml.apache.org/security/ The root cause was: org/apache/xpath/compiler/FuncLoader This can happen e.g. if org.apache.xml.security.Init is in the 'common' classpath, but a dependency like activation.jar is only in the webapp classpath. Found Java Secure Socket Extension (javax.net.ssl.SSLSocketFactory) at an unknown location -- Javier Gonzalez Nicolini
Re: Application scope objects that retain data
To put it simply, it's a class of wich exactly one instance exists. In such class you keep your 'persistent' string. It's usually achieved by making the constructor private (so nobody but the class itself can call new SingletonClass(...)) and a static method to access a static field that holds the one instance. Something like: public final class MySingleton { // final to avoid multiple instances by subclassing private static MySingleton _instance = new MySingleton(); private MySingleton(){ // ... // } public static MySingleton getInstance(){ return _instance; } // your useful methods go here } that's the general idea. You can get more info here: http://www.javaworld.com/javaworld/jw-04-2003/jw-0425-designpatterns.html Or here: (complete, free as in beer, html book on java patterns) http://www.pythoncriticalmass.com/downloads/TIPatterns-0.9.zip On 8/4/05, J.W.F. Thirion [EMAIL PROTECTED] wrote: Thanks for your advice. I did try moving the temp= part to the top (static initializer) and the same thing happens. PS: What do you mean by following the Singleton pattern. I am more from a C/C++ background so the terminology is a bit strange to me. Thanks for the help! Derik -Original Message- From: James Wilson [mailto:[EMAIL PROTECTED] Sent: 04 August 2005 15:15 To: axis-user@ws.apache.org Subject: Re: Application scope objects that retain data This is interesting. I can't speak to the Axis internals. But what this shows me is that Axis is creating more than one service implementation class. Thus there is more than one instance of your Test class instanciated even though they will live to service many requests. This is what I would expect for Axis to support multiple user-request-threads coming in from the Servlet container. If you move the 'temp=' line out of the constructor and into a static initializer (static String temp=;) you will get the effect you are looking for. But to scale the example, you might want to implement a class following the Singleton pattern to maintain the application state. hope it helps, james Quoting J.W.F. Thirion [EMAIL PROTECTED]: Hi everyone, I appologise if this has been asked already, but I would like to know the following: Is it possible to have a Java class, e.g. Test in my Test.java, to keep the value of its static variables between calls to the service. E.g. I have a static variable temp, to which I just add string data and on each call to getValue the value returned should be the value I passed to the function concatenated to previous String values. So on the first call, if I pass Hello, I would get back Initial, Hello and on the second call, if I pass there, I would get back Initial, Hello there, and so on. The object must thus never go out of scope. I assumed that I needed to set the scope to application, but that didn't work (I just got back the string Initial, XXX where XXX is what I passed to getValue - thus the constructor was called on each call). Here is my deploy.wsdd file: deployment xmlns=http://xml.apache.org/axis/wsdd/; xmlns:java=http://xml.apache.org/axis/wsdd/providers/java; service name=Test provider=java:RPC parameter name=scope value=application / parameter name=className value=Test / parameter name=allowedMethods value=* / /service /deployment and here is my class: public class Test { static boolean bInitialised; static String temp; public Test() { bInitialised = false; temp = ; } public static synchronized boolean isInitialised() { return bInitialised; } public static synchronized void initialise() { temp = Initial, ; bInitialised = true; } public String getValue(String input) { if (!Test.isInitialised()) { Test.initialise(); } temp = temp + input; return temp; } } and I have deployed the service with the following: java org.apache.axis.client.AdminClient deploy.wsdd Any help would be greatly appreciated. Kind regards, J.W.F. Thirion (Dérik) E-mail: [EMAIL PROTECTED] -- Javier Gonzalez Nicolini
Re: can my .jws file have static inner classes in it?
emmm, nopes, it was intended for the list :D Well, there ya go: just make the top-level class implement methods that call all the inner classes and you are set. (As a rule I try to keep the classes that get published as web services as 'dumb' as possible, and try to keep all the important work isolated for the web service provider, with the top-level class just logging, validating the input and then passing along the input for proper action to other classes) On 8/4/05, John M. Gabriele [EMAIL PROTECTED] wrote: Ahh... I think that's where I was going wrong Javier. I was expecting folks to just be able to access those inner classes and use them like the instance methods. BTW, not sure you meant to, but you sent this to me off-list. Feel free to post this reply to the list. :) ---John --- Javier Gonzalez [EMAIL PROTECTED] wrote: As far as I understand, the web service actually does know only about the top-level class. Every method that you specify on the wsdd file should appear as an operation under that web service port. All these methods should be declared in the top-level class. The top level class is then free to delegate all the work to any class or classes, but the initial request will be handled by the top-level class. I'm not sure I understand what you want to do. Could you clarify please? On 8/4/05, John M. Gabriele [EMAIL PROTECTED] wrote: --- Javier Gonzalez [EMAIL PROTECTED] wrote: Using the wsdd approach lets you use almost any class for providing services, and no restrictions to using inner types. Plus it's easier to develop and test in an IDE and then pack it in a .jar and put it in the axis-enabled servlet engine. Thanks. But, how do I have multiple classes for just one web service? Can you point me to an example wsdd that shows how to do this? Right now, the WSDL looks like it only knows about that one top-level class. Thanks, ---John On 8/3/05, John M. Gabriele [EMAIL PROTECTED] wrote: I changed it from using a .jws file to using the sample deploy.wsdd file from samples/userguide/example3, then deployed it with the AdminClient as described in the User's Guide, and now can get it to give me its wsdl using that ?wsdl appended to the URL. Still have to test to see how things work with those inner classes though. ---John --- John M. Gabriele [EMAIL PROTECTED] wrote: I'm having trouble getting a .jws file working as a web service when it contains inner classes. I can navigate my browser to the .jws file, but when I try and get its wsdl, I get: AXIS error Sorry, something seems to have gone wrong... here are the details: Exception - java.lang.NoClassDefFoundError: MyWebService$MyInnerClass Can I use static inner classes inside my .jws files and have it work? I've tried moving my .class files around in axis/WEB-INF/jwsClasses (into subfolders matching my package declaration in the .jws file), and it axis/WEB-INF/classes but it hasn't helped. Thanks, ---John -- Javier Gonzalez Nicolini Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs -- Javier Gonzalez Nicolini Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs -- Javier Gonzalez Nicolini
Multivalued parameters in server-config.wsdd?
Hi, I'm deploying a web service using the server-config.wsdd file, and pass to the service a number of parameters. There's a parameter that can have one or more values (files that must be opened and loaded). The problem is that, for every file, I have to create a new parameter name. Is there a way to pass multiple values for a single parameter name? (other than entering the value as a string with a known separator to be parsed inside the code) -- Javier Gonzalez Nicolini
Re: can my .jws file have static inner classes in it?
You could put your inner classes in a separate jar file and import them in your jws. Using the wsdd approach lets you use almost any class for providing services, and no restrictions to using inner types. Plus it's easier to develop and test in an IDE and then pack it in a .jar and put it in the axis-enabled servlet engine. On 8/3/05, John M. Gabriele [EMAIL PROTECTED] wrote: I changed it from using a .jws file to using the sample deploy.wsdd file from samples/userguide/example3, then deployed it with the AdminClient as described in the User's Guide, and now can get it to give me its wsdl using that ?wsdl appended to the URL. Still have to test to see how things work with those inner classes though. ---John --- John M. Gabriele [EMAIL PROTECTED] wrote: I'm having trouble getting a .jws file working as a web service when it contains inner classes. I can navigate my browser to the .jws file, but when I try and get its wsdl, I get: AXIS error Sorry, something seems to have gone wrong... here are the details: Exception - java.lang.NoClassDefFoundError: MyWebService$MyInnerClass Can I use static inner classes inside my .jws files and have it work? I've tried moving my .class files around in axis/WEB-INF/jwsClasses (into subfolders matching my package declaration in the .jws file), and it axis/WEB-INF/classes but it hasn't helped. Thanks, ---John Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs -- Javier Gonzalez Nicolini
Re: serialVersionUID?
you can tell eclipse to ignore that warning in preferences-java-compiler-Errors/Warnings-Potential Programming Problems. If you don't want to ignore, then you'll have to hit quick fix like crazy on your problems list :D On 7/19/05, Kador, Daniel [EMAIL PROTECTED] wrote: Hi, I've noticed that Axis-generated classes don't have a private static final long serialVersionUID member. This isn't an error, but Eclipse reports it with a compile warning. I've researched a little and found out that having this member is not required, but is highly recommended to ensure interopability while serializing on different platforms. I'd like to get rid of the warnings. Eclipse will generate it for me, but I have well over 100 classes with this problem, so it'd be great if I could find an automatic fix. Thanks, Dan -- Javier Gonzalez Nicolini
Re: java.lang.NoClassDefFoundError: javax/xml/rpc/Service
You have classpath issues. You must explicitly name all the jars in your classpath declaration (having them in the same directory isn't enough) in the command line (java -classpath ...) or set the classpath env variable before running java -jar. A better idea would be to create a shell script (.bat in your windows case) that invokes the proper classpath when running your jar. That way you don't have to define the classpath env variable or write the whole classpath every time you want to run your jar. On 7/19/05, Dipty Maybhate [EMAIL PROTECTED] wrote: Hi Everyone, I have implements a web services client using AXIS. I am trying to make a jar file with all the jars and classes needed to run the client. When I run the jar it throws the following exception C:\Program Files\Java\jdk1.5.0\binjava -jar API.jar Exception in thread main java.lang.NoClassDefFoundError: javax/xml/rpc/Se rvice at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.ja= va:12 4) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) I have included all the axis - jar files along with my class files and those generated using WSDL2Java c:/axis/axis-1_2_1/lib/axis-ant.jar c:/axis/axis-1_2_1/lib/axis.jar c:/axis/axis-1_2_1/lib/commons-discovery-0.2.jar c:/axis/axis-1_2_1/lib/commons-logging-1.0.4.jar c:/axis/axis-1_2_1/lib/jax-qname.jar c:/axis/axis-1_2_1/lib/jaxrpc-1_1-fr-spec-api.jar c:/axis/axis-1_2_1/lib/jaxrpc.jar c:/axis/axis-1_2_1/lib/log4j-1.2.8.jar c:/axis/axis-1_2_1/lib/saaj.jar c:/axis/axis-1_2_1/lib/wsdl4j-1.5.1.jar c:/axis/axis-1_2_1/lib/xmlsec-1.2.1.jar Does anyone have an idea why there is a problem? Thank you very much! Dipty -- Javier Gonzalez Nicolini
Webservice works deployed as .jws but not deployed with server-config.wsdd?
Hi! I have this class, that exposes a single method that returns a string. It doesn't do anything fancy but log the parameters received and return 0 (it's a mock service for development of apps that will connect to a webservice with the same interface that does do fancy things ;)) The problem is, the service fails with a SAXException if I deploy it using server-config.wsdd, but works fine when deployed as a .jws file. The only difference I could see was that the wsdd-deployed version exposed wsdl that used soapenc:string for the parameters (parameters are just Strings and a byte[] that is currently sent null) and the jws one uses xsd:string. (using parameter name=dotNetSoapEncFix value=true/ on the wsdd file changed the wsdl to xsd:string but the error is the same). Thanks in advance for any light shed on this subject ;) Method signature, server stack trace, clien stack trace and soapbody sent to the service follow: # METHOD SIGNATURE public String send(String destination_address, String customer_id, String service_id, String climsg_id, String deliv_ack, String password, String service_class, String call_back, String call_back_type, String validity_period, String source_address, String sm_class, String data_coding, String text_data, byte[] bin_data, String code, String description) ## SERVER SIDE STACK TRACE ## 2005-06-17 11:38:34,693 DEBUG org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(toAxisFault00) 2005-06-17 11:38:34,693 DEBUG org.apache.axis.enterprise - Mapping Exception to AxisFault org.xml.sax.SAXException: Found character data inside an array element while deserializing at org.apache.axis.encoding.ser.ArrayDeserializer.characters(ArrayDeserializer.java:502) at org.apache.axis.encoding.DeserializationContext.characters(DeserializationContext.java:966) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:177) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384) at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:148) at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at