Re: Axis 1.2 WSDL2Java problem (probably)
Viktor Vojnovski wrote: Tim Gmane se proiznese na 25.11.2004 17:42: Please post the Java class you are trying to expose. I realize it may contain proprietary information, so you should try writing a simple example that reproduces the problem or posting snippets from the bean that has the CPF attribute ... Not a problem. Here it is.. Have you tried Axis 1.2RC2 (released on Nov 17 I think), or even a nightly build? This looks like an Axis bug and I would be surprised if it's not already fixed. You can look for a similar bug or file one if there isn't one already. Tim
one big service vs. a set of related modular services
Hi, Here's the dilemma that I am facing and I am looking for your experiences and recommendation. I need to expose a lot of methods (over 200 with over 20 custom types). The business logic on the server is implemented, very modular, such as SessionModule, FileModule, UserModule, etc. There are other in-process applications that call these API's directly. Now, for remoted clients I can do one of 2 things: 1) Have one huge interface/web service that lists all these methods and their implementation calls to the right module. 2) Create a set of modular interfaces/web services, one for each module. In this case, the client would have to authenticate and start a session via the SessionModule before it can make use of any of the other modules (same for #1 above, the client would have to call the right auth method before it can call any other methods). Authentication will NOT be done at the transport level (HTTP), but rather by calling a method in the session module to start a session and stuff it in the HttpSession (if using cookies to track the session) or something similar (if using SOAP header for session tracking). Session tracking will most likely be done via cookies (standard HttpSession stuff) because I may need the same session in a different servlet running in the same webapp, otherwise I could use SOAP headers. I know #1 will work, not hard to implement, but it will be VERY UGLY. #2 is more elegant ... Is it possible to even implement #2 from a client perspective (clients will be a Java Axis client and a .NET client)? If I expose what looks like multiple web services (related to each other) will I be able to pass the same session cookie from the Axis client side when I make calls to the various modules or the session tracking is done for me and it's buried somewhere deep so that I don't have access to the cookie on the client side? If I can get access, can you please tell me how? Custom handlers on the client side? Easier way to get access to the HttpRequest constructed on the client side and adding the session cookie to it (and other cookies from the load balancer, etc.)? The question boils down to the session sharing part between these modules and how I can achieve it, if possible. Thanks for your help. Tim
Re: exposing only parts of a Java Bean
[EMAIL PROTECTED] wrote: Tim, I've just come across the fact that the BeanSerializer does make use of a BeanInfo class. Have you tried using a BeanInfo class with your bean? I don't know if Java2WSDL makes use of it, but the bean serializer seems to, at run time. Give it a go and let us know. Tony I did not try the BeanInfo as it looks like I have to provide a lot of extra classes just to hide a couple of properties. I will rename the get/set methods that I don't want exposed instead and this way I am sure the WSDL will be correct too and I don't have to mess with it by hand. Thanks for all your help. Tim
Re: long vs. Long
I have a simple test method: Long foo(Long bar) Java2WSDL maps the Long to xsd:long and the client stub contains the method as: long foo(long bar) How does the WSDL look like ? The parameter and return value should have a nillable='true' attribute, otherwise I guess it's a bug in the WSDL-generation part (Java2WSDL). If it has this attribute, then the bug is in the client-side code (WSDL2Java). For a method: Long b(Long id) throws CustomException { ... } Here's the WSDL snippet generated by Java2WSDL: wsdl:message name=bRequest wsdl:part name=in0 type=xsd:long/ /wsdl:message wsdl:message name=bResponse wsdl:part name=bReturn type=xsd:long/ /wsdl:message So Long is mapped to xsd:long but it's NOT declaraed nillable. Is this the bug? I think so. Which version of Axis do you use ? Axis 1.2RC1 Or should the Long have been mapped to soapenc:long instead which is not compatible with .NET? xsd:long and soapenc:long should be the same thing (IIRC the soap encoding spec defines soapenc:long as xsd:long). Is xsd:long nillable=true compatible with .NET? I don't know :) It should but... I'll just use the primitive long, at least I know that works ... If anyone else has an example on how to get the Long stuff to work end-to-end and to interoperate with .NET I would love to see it (it has to be RPC not doc/lit) as it would be nice to make use of the nillable property ... Thanks. Tim
Re: hiding a property from Axis serializer?
Sheptunov, Bogdan wrote: Could you please elaborate a little more on that? In what way exactly? Have my class implement BeanInfo interface and describe the properties I'd like to see returned in getPropertyDescriptors() method? Read the Java Beans specification, in particular the sections that talk about BeanInfo: http://java.sun.com/products/javabeans/docs/spec.html Tim
Re: Problem with WSDL samples of user guide
I still see this next error, but the example runs now, and it's no longer complaining about not being able to find classes in the wsdl4.jar packages. - Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled. You need activation.jar and mail.jar in your CLASSPATH You can read more about the Java Mail API here: http://java.sun.com/products/javamail/FAQ.html I am not sure whether activation.jar is included or you need to get it from JAF: http://java.sun.com/products/javabeans/glasgow/jaf.html My app server includes both of them so I did not have to download the jars, they were added to the app server's CLASSPATH by default so no problem on the server, I just had to add them to the CLASSPATH for the client side. However, if you don't use attachments you don't need to have them in your CLASSPATH, just ignore the warnings. I hope this helps. Tim
Re: long vs. Long
If anyone else has an example on how to get the Long stuff to work end-to-end and to interoperate with .NET I would love to see it (it has to be RPC not doc/lit) as it would be nice to make use of the nillable property ... Thanks. Tim The long type in .NET is not nullable, so trying to send it as a nil over the wire is just going to result in headaches for the .NET folks. Cheers Simon Ah, thanks for clarifying it. I love .NET, how we have to bastardize our web services just to make them work with .NET ... Tim
Re: one big service vs. a set of related modular services
I am assuming that you could pass session tracking info in the SOAP Header.. Using SOAP headers may not be an option for me as I may have to share the same session between the Axis servlet and another plain HTTP servlet I have running for various reasons. Is there a way in Axis to get to the HTTP transport (in particular getting and setting the cookies) from the *client* side of Axis? The thing I'd like to consider is whether one server could handles all these 200 modular services on one box.. If not, you might want to host them under different AXIS instances on different boxes.. In other words, it might be favorable to host smaller several services instead. I do not have 200 modules, I have about 7 modules, with a total of about 200 methods across the 7 modules. Also, if these services are modular and thus not inter-dependent, then keeping them separate gives you the option to move it around independently of the others - such as hosting it to another server cause one particular modular service is used heavily by your users and need to boost it's performance or any other such needs in the future.. The modules will not depend on each other with the exception of the SessionModule which will have to be called first before any method in any other module can be used (authentication for an end user needed). Tim
How to get/set cookies from the Axis *client* side?
Is it possible to get and set cookies on the HTTP transport from the *client* side of Axis? If so, how? Are there any examples, please? Thank you. Tim
Re: Problem generating WSDL from Java
David Song wrote: Hi all, I am getting the following error from Java2WSDL. It was working before, I just changed some method signatures. Many thanks for the help! -David - The class org.apache.axis.MessageContext does not contain a default constructor, which is a requirement for a bean class. The class cannot be converted into an xml schema type. An xml schema anyType will be used to define this class in the wsdl file. - The class javax.servlet.ServletContext is defined in a java or javax package and cannot be converted into an xml schema type. An xml schema anyType will be used to define this class in the wsdl file. - The class javax.servlet.http.HttpServletRequest is defined in a java or javax package and cannot be converted into an xml schema type. An xml schema anyType will be used to define this class in the wsdl file. WSDLException: faultCode=OTHER_ERROR: Can't find prefix for 'http://http.servlet.javax'. Namespace prefixes must be set on the Definition object using the addNamespace(...) method.: My guess here is that you added some getMessageContext(), getServletContext() and getHttpServletRequest() methods somewhere in your beans and now Axis is trying to expose these bean properties and it doesn't know how to serialize these classes. If that's the case just rename your methods so that they don't start with set or get for the properties you do NOT want exposed. Double check the methods you changed or added ... Tim
Re: How to get/set cookies from the Axis *client* side?
John Walker wrote: Is it possible to get and set cookies on the HTTP transport from the *client* side of Axis? I tried using the MessageContext to get the HttpRequest object, and then set cookies there, but it seemed that when doing this from the AXIS client side, when the HTTP message got to the receiver, my cookies had been clobbered. I know this isnt an affirmation, but a warning about cookies and inconsistency. I think it may be an easier thing to utilize the standard AXIS APIs to transfer data about the client to the server. For example, there is a way to set the username and password for authentication. What data are you trying to hold onto that SOAP/AXIS doesnt handle natively? I have multiple module that I am thinking of deploying as individual web services running in the same web app rather than create a big interface and have one big monolithic service with 200+ methods in it. One of the modules is a SessionModule that the client needs to call to authenticate before using the other modules, so I need some sort of session tracking across the modules. I know I could use SOAP headers which would probably work OK across the modules, but I need to do the session tracking via cookies because there's another servlet in the same web app that needs to use the same session (complicated, I know). So I was thinking if it's possible to do something like this: 1. From the client call the SessionModule with the MAINTAIN_SESSION property or whatever it is which will establish a session (HttpSession) on the server and send a cookie back to the client which Axis will store. 2. From the client before calling another module, set the session cookie from #1 before making the call so that the same HttpSession as in #1 is recovered and used on the server side (this other module requires that the user is authenticated). 3. Continue doing #2 for all modules when they are needed. Maybe I'm complicating my life, is there an easier way to achieve this? Basically session tracking across a set of web services deployed in the same web app. Thanks for your help. Tim
Re: How to get/set cookies from the Axis *client* side?
Thanks Tony for your good replies on this list. I wonder if my approach is good in general. I suspect there will also be non-Axis clients like .NET and maybe other frameworks on the client side that will need to do the same. Does anyone have a different idea to achieve the same behavior? I think SOAP headers for session tracking should work and I suppose it is more portable, right? If I could get rid of the requirement to use cookie based tracking ... I am open to other suggestions :) Tim [EMAIL PROTECTED] wrote: In that case, as I mentioned in my first reply, extract the cookies from the message context, in the first reply and store them somewhere (for example, in a static variable or in system properties) that will be available in the next call. In that next call, add the cookies to the message context and they should get picked up by the Axis HTTPSender, if maintainSession is set to true. Provided the same host is called each time, this should work. Simple Axis handlers can be written to do this. Tony *Tim K. (Gmane)* wrote on 01/12/2004 16:45:06: John Walker wrote: Is it possible to get and set cookies on the HTTP transport from the *client* side of Axis? I tried using the MessageContext to get the HttpRequest object, and then set cookies there, but it seemed that when doing this from the AXIS client side, when the HTTP message got to the receiver, my cookies had been clobbered. I know this isnt an affirmation, but a warning about cookies and inconsistency. I think it may be an easier thing to utilize the standard AXIS APIs to transfer data about the client to the server. For example, there is a way to set the username and password for authentication. What data are you trying to hold onto that SOAP/AXIS doesnt handlenatively? I have multiple module that I am thinking of deploying as individual web services running in the same web app rather than create a big interface and have one big monolithic service with 200+ methods in it. One of the modules is a SessionModule that the client needs to call to authenticate before using the other modules, so I need some sort of session tracking across the modules. I know I could use SOAP headers which would probably work OK across the modules, but I need to do the session tracking via cookies because there's another servlet in the same web app that needs to use the same session (complicated, I know). So I was thinking if it's possible to do something like this: 1. From the client call the SessionModule with the MAINTAIN_SESSION property or whatever it is which will establish a session (HttpSession) on the server and send a cookie back to the client which Axis will store. 2. From the client before calling another module, set the session cookie from #1 before making the call so that the same HttpSession as in #1 is recovered and used on the server side (this other module requires that the user is authenticated). 3. Continue doing #2 for all modules when they are needed. Maybe I'm complicating my life, is there an easier way to achieve this? Basically session tracking across a set of web services deployed in the same web app. Thanks for your help. Tim
Re: Resolved: RE: Problem generating WSDL from Java
Vy Ho wrote: I wonder if you declare an interface for this service, then use it to generate wsdl. This shields you from how you implement your service. Right, that's the way to do it, just create an interface for only the methods you want exposed. The class can have a lot more stuff in it that won't be exposed. Tim
Re: Resolved: RE: Problem generating WSDL from Java
Which in effect does the same thing, it creates an interface for you with only those methods, right? Personally I prefer defining the interface myself rather than doing it via command line options, you get more compile time checking and catch mistakes early than deal with sometimes obscure Axis error messages. Tim [EMAIL PROTECTED] wrote: You can also specify the methods to expose, using the -m option. Tony Tim K. wrote on 01/12/2004 19:21:04: Vy Ho wrote: I wonder if you declare an interface for this service, then use it to generate wsdl. This shields you from how you implement your service. Right, that's the way to do it, just create an interface for only the methods you want exposed. The class can have a lot more stuff in it that won't be exposed. Tim
exposing multiple classes as part of the same web service
Hi, Let's assume that I already have a few interfaces and their implementation that follow all the web services rules and they are suitable of being exposed via Axis the way they are. Is it possible for Axis to combine all these interfaces/classes into one web service automatically or do I have to write one big interface that extends all the existing interfaces and its implementation class to call thru to the existing implementations? Thank you, Tim
Re: exposing multiple classes as part of the same web service
Yeah, it would be nice to keep them separate, I've posted a while ago on the same topic. My concern is that I am not controlling what WS toolkit clients will use on the client side and these modules have the concept of a common session for all of them to work together, so I am not sure whether various toolkits will be able to play games on the client side with the session cookie (I have to do session tracking via HTTP session cookies rather than SOAP headers), setting it on the various stubs before it makes the calls. The easy way out is to put everything in one WSDL which will take care of the session sharing and then the client can decide to split them via wrapper classes on the client side if it's possible (we may even provide this code for Java clients that use Axis for example). It seems to me that this would provide the highest level of compatibility, am I right? The other thing is that I don't know what extra resources I would need on the server side if I have 12 web services rather than 1 big one (in terms of additional objects that Axis may use internally to keep track and service the sessions for the deployed web services). Tim [EMAIL PROTECTED] wrote: I would guess that these different interfaces and their implementations are separate for a reason. If so, why not keep the web services separate, for the same reasons, plus the additional reason that you don't end up with a huge, incomprehensible WSDL? Incidentally, you don't have to create a combined interface. Axis isn't bothered with interfaces, it is concerned with implementations, since that is what is called by the engine (though Axis generates interfaces for client side code, with WSDL2Java). So, if you *have* to combine the services, just create an implementation of the different interfaces and route the calls as appropriate. Tony news [EMAIL PROTECTED] wrote on 20/12/2004 18:52:22: Hi, Let's assume that I already have a few interfaces and their implementation that follow all the web services rules and they are suitable of being exposed via Axis the way they are. Is it possible for Axis to combine all these interfaces/classes into one web service automatically or do I have to write one big interface that extends all the existing interfaces and its implementation class to call thru to the existing implementations? Thank you, Tim
Re: No Digest List?
I like to read this list as a newsgroup (NNTP) via gmane.org (or you can read it via a browser thru gmane's web site) It works quite well, I don't get bombarded with emails all day long, I read the newsgroup only when I feel like it (sort of like a digest if you read the newsgroup once a day): http://www.gmane.org/ News server: news.gmane.org Newsgroup: gmane.text.xml.axis.user Or you can get a RSS feed from http://rss.gmane.org/gmane.text.xml.axis.user and read it via an RSS reader (such as Thunderbird) or via Firefox LiveBookmarks. The possibilities are unlimited, you are not confined to email only. Gmane is great! Enjoy. Tim Tetsuya Kitahata wrote: Hi, I noticed that this mailing list ([EMAIL PROTECTED]) does not have digest mode as well as [EMAIL PROTECTED] Current digest subscribers: No digest available Digest Subscription means that you (we) can receive and read messages as threads once daily, rather than receiving a constant trickle (flow) of messages. http://www.ezmlm.org/faq-0.32/FAQ-4.html#ss4.22 Perhaps you folks might have already known, this user list is Top-10 most popular list in apache.org mailing lists. (wow) The mean posts per day are 25.16 (posts/day), high-traffic! Perhaps, someone can try to ask infrastructure@ (apmail@) to create digest mode of this list. If succeed, anyone will be able to subscribe -digest list via [EMAIL PROTECTED] Hope this helps. Cheers, - Tetsuya Kitahata -- Terra-International, Inc. E-mail: [EMAIL PROTECTED] http://www.terra-intl.com/
Axis logging to the servlet engine log
Hello, I do NOT have log4j in the CLASSPATH because of some conflicts and I do not want to use log4j or any other logging frameworks. I just want to: 1) Make Axis write to the servlet engine's log file which gets rotated and it also captures the messages from my web service server side implementation. 2) Be able to set higher log levels (debug level) so I can see more verbose messages, stack traces, etc. when something doesn't go as expected. Can you please tell me how I can do 1) and 2)? I just need a starting point and I can figure it out from there ... Thanks. -- Tim
[BUG] multiple cookies handling bug
Hello Axis Developers Users, I think I've discovered an Axis 1.2RC2 bug. Some servers use cookies to do load balancing, so in addition to the JSESSIONID session tracking cookie the load balancer may insert its own cookie in the HTTP response. There are 2 cases here: 1) The HTTP response will have 2 headers: Set-Cookie: JSESSIONID=..; path=/ Set-Cookie: LoadBalancer=; path=/ It looks like the last cookie wins, the rest are discarded by the client and they are not passed back to the server when maintain session is true, so the session is lost between requests. 2) The 2 cookies may appear in the same Set-Cookie header. From briefly looking at the Axis processing code it looks like it trims anything past the first ';' it encounters so in this case the first cookie would be the only one maintained. Please let me know if this is a bug and I will file it if you tell me where. If it's a known bug and possibly already fixed, please let me know. Thanks. -- Tim
Re: [BUG] multiple cookies handling bug
Correction: case 2) below is not valid, apparently one cannot set multiple cookies in the same Set-Cookie header, there needs to be a header per cookie (but when the cookies are sent back to the server multiple cookies can be in one Cookie header, that's where my confusion came from). Case 1) still looks like a bug though. Tim Tim K. (Gmane) wrote: Hello Axis Developers Users, I think I've discovered an Axis 1.2RC2 bug. Some servers use cookies to do load balancing, so in addition to the JSESSIONID session tracking cookie the load balancer may insert its own cookie in the HTTP response. There are 2 cases here: 1) The HTTP response will have 2 headers: Set-Cookie: JSESSIONID=..; path=/ Set-Cookie: LoadBalancer=; path=/ It looks like the last cookie wins, the rest are discarded by the client and they are not passed back to the server when maintain session is true, so the session is lost between requests. 2) The 2 cookies may appear in the same Set-Cookie header. From briefly looking at the Axis processing code it looks like it trims anything past the first ';' it encounters so in this case the first cookie would be the only one maintained. Please let me know if this is a bug and I will file it if you tell me where. If it's a known bug and possibly already fixed, please let me know. Thanks.
Re: [BUG] multiple cookies handling bug
Digging deeper into the code and trying to patch it to fix the bug I discovered another issue that needs to be addressed. The particular server that I am using doesn't send the load balancing cookie on all the responses, it refreshes it every few responses (I am not sure how it decides to refresh it or not), so for example: Response 1: has 2 cookies JSESSIONID and LoadBalancer cookies Response 2: has 1 cookie only JSESSIONID What happens is that after Response 2 is received by the Axis client, the LoadBalancer cookie is forgotten about, it's dropped and it's not sent on subsequent requests, hence the load balancing is messed up and the client request ends up on a different middle tier which cannot recover the session based on the JSESSIONID. The HTTP clients need to store cookies, add to them and only expire them when the cookie expiration time is reached (if they are session cookies, not persistent cookies then they are expired when the client process exits -- in memory cookies). Where are the cookies stored between requests? In the Service, Stub, Call or HTTPTransport? Tim Tim K. (Gmane) wrote: Correction: case 2) below is not valid, apparently one cannot set multiple cookies in the same Set-Cookie header, there needs to be a header per cookie (but when the cookies are sent back to the server multiple cookies can be in one Cookie header, that's where my confusion came from). Case 1) still looks like a bug though. Tim Tim K. (Gmane) wrote: Hello Axis Developers Users, I think I've discovered an Axis 1.2RC2 bug. Some servers use cookies to do load balancing, so in addition to the JSESSIONID session tracking cookie the load balancer may insert its own cookie in the HTTP response. There are 2 cases here: 1) The HTTP response will have 2 headers: Set-Cookie: JSESSIONID=..; path=/ Set-Cookie: LoadBalancer=; path=/ It looks like the last cookie wins, the rest are discarded by the client and they are not passed back to the server when maintain session is true, so the session is lost between requests. 2) The 2 cookies may appear in the same Set-Cookie header. From briefly looking at the Axis processing code it looks like it trims anything past the first ';' it encounters so in this case the first cookie would be the only one maintained. Please let me know if this is a bug and I will file it if you tell me where. If it's a known bug and possibly already fixed, please let me know. Thanks.
Axis as a client and multi-threading
Could someone who has more experience with the Axis client side clarify how it works in a multi-threaded environment? E.g. if I create a Service instane on the client and from that get a Stub instance, is it safe for mutliple threads to make calls on the Stub at the same time? If not, where are the thread boundaries? Do I need multiple Stub instances? Or multiple Service instances? Or is the whole Axis client single-threaded? Also, how does the HTTP session tracking (cookie-based) work in the Axis client environment? Can I have multiple sessions going at the same time? If so, do I need multiple Services? Stubs? I guess the question is where is the session cookie stored? In the Service instance? In the Stub instance? Statically in the JVM in which case it would only be possible to have only 1 session? Thank you for your help. I am sure other users have the same questions. -- Tim
Re: Tried to enter bugzilla bug on Axis JWS but not listed
http://issues.apache.org/jira/ I'm not sure though what the difference between Axis and Axis2 projects is. I think Axis is where you want to enter your bug. Tim Michael Oliver wrote: How do I go about entering a bugzilla bug for Axis Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(520)844-1036 *Note new email changed from [EMAIL PROTECTED]
Re: How to get HttpServletRequest from my call
Be aware that getRemoteAddr() may not be the address of the client sending the request but rather a proxy/caching server in between, load balancer, etc. As long as you are OK with it you can get the request like this: MessageContext context = MessageContext.getCurrentContext(); HttpServletRequest req = (HttpServletRequest) context.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); I hope this helps. Tim Alex Chen wrote: I need to inspect the message in the program, e.g. I want to know there the message comes from by calling the getRemoteAddr() method of the request. Flores, Raul wrote: If you only want to inspect the messages then use a monitor tool. tcpTrace is excellent for this (thank you simon and matt) Raul -Original Message- From: Alex Chen [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 3:39 PM To: [EMAIL PROTECTED] Subject: How to get HttpServletRequest from my call I am using AXIS as my SOAP server. I use WSDL2Java to generate the code stubs and only need to write the *Impl.java part.. Since everything else is handled by the AXIS servlet, I have no handle of the HTTP request and reply message. I would like to inspect that in my code. How do I get such information? Any help is appreciated.
Re: fillng the impl java file
I may not understand exactly what you are trying to do, but did you notice the -c option to wsdl2java where you can specify a class to use instead of the BindingImpl? Sorry if I am off topic with my answer. Tim Brian Davis wrote: I wrote an ant task to do this, you can use it if you like. It would be nice if they included something like this with Axis. I sent the jar to you, just put it on your classpath. If anyone else would like it, just email me. I couldnt attach it and send to the list. Youll need something like: taskdef name=fixwsdl2java classname=com.willyloman.anttasks.FixWSDL2JavaTask/ And then: fixwsdl2java filename=your filename classtocall=your fully qualified class extraarguments=, org.apache.axis.MessageContext.getCurrentContext() / The extra arguments go just inside the last ) Brian Davis Software Developer JMM Ventures *From:* Pritesh Damani [mailto:[EMAIL PROTECTED] *Sent:* Thursday, January 13, 2005 11:51 AM *To:* [EMAIL PROTECTED] *Subject:* fillng the impl java file Hello Everyone, I am relatively new to axis and I was wondering if someone can help me with the following problem, I have a big repository of methods that I need to expose to webservices. When i get the final stub files from the wsdl2Java , the BindingImpl.java file needs to be filled in for calling substitutions. Can anyone advise me if there is someway to automate this ? Thank You Pritesh Damani -- All Computers wait at the same speed !!
Re: Axis memory leak
Can you please file a bug for this at: http://issues.apache.org/jira/ for project Axis Thanks. Tim Vy Ho wrote: That does it. The memory no longer go up. The way I do it is inside the generated stub, I wrap the call with a try/catch/finally, and in that, I put your code below. I am not sure if this is the best way of doing it. However, I am just testing. I won't use this code though. In client-side stub code, look for the call object and try: Call.getMessageContext().getRequestMessage().getSOAPEnvelope().getRecorder().clear(); -- Lyndon Tiu
Re: Question about session scope
The scope (session, application, request) on the server side tells Axis how many instance of the server implementation classes to create, it doesn't have much to do with the session on the client side. The client is not aware of the session scope on the server side. So you can for example use sessions on the client even if the scope on the server is application (or request). Now, session tracking on the client side via HTTP cookies has a few issues. You may want to look at these bugs (some may or may not apply to your usage case but it's good to be aware of them): http://issues.apache.org/jira/browse/AXIS-1080 http://issues.apache.org/jira/browse/AXIS-986 http://issues.apache.org/jira/browse/AXIS-1754 Tim Shantha Kumar wrote: Hi, if the client doesn't call setMaintainSession(true) the JSessionID cookie doesn't get transported to the server. The server keeps creating a new session and also a new bean. thanks, sk - Original Message - From: Wiener, Zach [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 20, 2005 8:26 PM Subject: Question about session scope Hello. If I deploy a service with session scope, then why must the client call setMaintainSession(true)? It seems that the service, or Axis, should be responsible for maintaining the scope of the service as session. How is the scope of a service published to clients? What happens if a service is deployed as session scope, but the client doesn't call setMaintainSession(true)? Thanks.
Re: Maintain session when using stubs generated by WSDL2Java
On the generated FooServiceLocator call setMaintainSession(true) Or you can cast the generated Stub to javax.xml.rpc.Stub and then call stub._setProperty(Stub.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE) which is the JAX-RPC way. Both work in Axis, but the first one is Axis specific while the second one follows the JAX-RPC spec. Tim Praveen Peddi wrote: Hello all, I was using Apache SOAp on client side and Axis on server side. Since ouor soap services need enabling of cookies on client side, I was maintaining juts one Call object and calling Call.setMaintainSession(true). This enables cookies on client side. Now we are migrating our clients to use Axis generated stubs. I looked at the generated code and I see that the stub is creating a new Call object for every soap call. This way, how do I enable cookies on client side (other than URLRewriting)? Thanks Praveen ** Praveen Peddi Sr Software Engg, Context Media, Inc. email:[EMAIL PROTECTED] Tel: 401.854.3475 Fax: 401.861.3596 web: http://www.contextmedia.com ** Context Media- The Leader in Enterprise Content Integration
Re: Maintain session when using stubs generated by WSDL2Java
Btw, for the first case you need to call setMaintainSession(true) on the Service _before_ you get any Stubs from it. Something like this (assuming AxisTest is my web service): AxisTestServiceLocator ats = new AxisTestServiceLocator(); ats.setMaintainSession(true); // Axis specific AxisTest stub = ats.getAxisTest(URL); // This is the JAX-RPC way of setting it at the Stub level, // no need to do it if you called ats.setMaintainSession(true) // above ((javax.xml.rpc.Stub) stub)._setProperty(Stub.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE). Tim Tim K. (Gmane) wrote: On the generated FooServiceLocator call setMaintainSession(true) Or you can cast the generated Stub to javax.xml.rpc.Stub and then call stub._setProperty(Stub.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE) which is the JAX-RPC way. Both work in Axis, but the first one is Axis specific while the second one follows the JAX-RPC spec. Tim Praveen Peddi wrote: Hello all, I was using Apache SOAp on client side and Axis on server side. Since ouor soap services need enabling of cookies on client side, I was maintaining juts one Call object and calling Call.setMaintainSession(true). This enables cookies on client side. Now we are migrating our clients to use Axis generated stubs. I looked at the generated code and I see that the stub is creating a new Call object for every soap call. This way, how do I enable cookies on client side (other than URLRewriting)? Thanks Praveen ** Praveen Peddi Sr Software Engg, Context Media, Inc. email:[EMAIL PROTECTED] Tel: 401.854.3475 Fax: 401.861.3596 web: http://www.contextmedia.com ** Context Media- The Leader in Enterprise Content Integration
Re: Maintain session when using stubs generated by WSDL2Java
I have the same problem. Unfortuantely it's not possible without patching the Axis code. I will be working on that in the next couple of weeks because I need it for my project. I will submit the patch to Axis once completed, but that doesn't guarantee it will be accepted. You can contact me in private if you would like the patch in a few weeks (when I get around to doing it as I have other priorities right now). Btw, there's a bug for it: http://issues.apache.org/jira/browse/AXIS-986 Tim Praveen Peddi wrote: Thanks. But I have multiple services. On teh server side, I have 4 SOAP services and each has itw own WSDL. When I generated the code for each WSDL, it generated XXXServiceLocator for each service. Calling setMaintainSession(true) on all service locations maintains the same session? I need to enable cookies for the whole client not for just one service. Praveen - Original Message - From: Tim K. (Gmane) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 20, 2005 1:13 PM Subject: Re: Maintain session when using stubs generated by WSDL2Java On the generated FooServiceLocator call setMaintainSession(true) Or you can cast the generated Stub to javax.xml.rpc.Stub and then call stub._setProperty(Stub.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE) which is the JAX-RPC way. Both work in Axis, but the first one is Axis specific while the second one follows the JAX-RPC spec. Tim Praveen Peddi wrote: Hello all, I was using Apache SOAp on client side and Axis on server side. Since ouor soap services need enabling of cookies on client side, I was maintaining juts one Call object and calling Call.setMaintainSession(true). This enables cookies on client side. Now we are migrating our clients to use Axis generated stubs. I looked at the generated code and I see that the stub is creating a new Call object for every soap call. This way, how do I enable cookies on client side (other than URLRewriting)? Thanks Praveen ** Praveen Peddi Sr Software Engg, Context Media, Inc. email:[EMAIL PROTECTED] Tel: 401.854.3475 Fax: 401.861.3596 web: http://www.contextmedia.com ** Context Media- The Leader in Enterprise Content Integration
Re: Standalone Java web services server
Axis has a built-in minimal HTTP server from what I read, but I never used it so I don't know the details. Look into it a little bit and see if it will work for you. Tim Douglas Kunzman wrote: Hi, I am looking for a java based web services server that does not need tomcat or an http server to be hosted but could be easily integerated into an existing java application. thanks, Douglas Kunzman Sensor Systems Work 703-437-7651 x693 Mobile 571-228-1048
Link to wsdl file wrong, how do I fix it?
I mapped the Axis servlet to a custom URL (e.g. /app/ws) rather than the default /axis/services/ or whatever it is. Now if I simply go to: http://server:port/app/ws I see a bunch of links to the (wsdl) files for each service, but the link is wrong, it is of the form /app/services/Foo?wsdl which obviously doesn't work (should be ws instead of services). Is there any configuration option that I am missing or is this a bug in Axis where it doesn't get the servlet path right? Thanks. -- Tim
Securing an Axis deployment
Hello, How can I turn off these features for an Axis production deployment: 1) Disable the generation of WSDL when one goes to http://server:port/app/ws/ServiceName?wsdl 2) Turn off listing the available services and their methods by going to http://server:port/app/ws/ 3) Turn off all Admin services/servlets, etc. I would like to provide clients static WSDL files they can download from another (static) location and only allow my custom web services to be invoked, not the Axis built-in ones. This way I only have to worry about the security and exploits of my stuff rather than sweat over what could be exploited via the default Axis features (which for development are great, but not for production). Thank you for your help. -- Tim
Re: Securing an Axis deployment
Anyone out there who uses Axis on a production system and has disabled these features? Thanks. Tim Tim K. (Gmane) wrote: Hello, How can I turn off these features for an Axis production deployment: 1) Disable the generation of WSDL when one goes to http://server:port/app/ws/ServiceName?wsdl 2) Turn off listing the available services and their methods by going to http://server:port/app/ws/ 3) Turn off all Admin services/servlets, etc. I would like to provide clients static WSDL files they can download from another (static) location and only allow my custom web services to be invoked, not the Axis built-in ones. This way I only have to worry about the security and exploits of my stuff rather than sweat over what could be exploited via the default Axis features (which for development are great, but not for production). Thank you for your help.
Re: Securing an Axis deployment
OK, so it's not possible via Axis' configuration. That's what I wanted to know so I can look at alternatives. I guess one alternative is to patch the code, maybe even add an option so I can flip it between dev and production envs. Tim Mike Barton wrote: Tim, Yes, we have done something very similar to that by using custom Axis handlers and web app filters. Mike Tim K. (Gmane) wrote: Anyone out there who uses Axis on a production system and has disabled these features? Thanks. Tim Tim K. (Gmane) wrote: Hello, How can I turn off these features for an Axis production deployment: 1) Disable the generation of WSDL when one goes to http://server:port/app/ws/ServiceName?wsdl 2) Turn off listing the available services and their methods by going to http://server:port/app/ws/ 3) Turn off all Admin services/servlets, etc. I would like to provide clients static WSDL files they can download from another (static) location and only allow my custom web services to be invoked, not the Axis built-in ones. This way I only have to worry about the security and exploits of my stuff rather than sweat over what could be exploited via the default Axis features (which for development are great, but not for production). Thank you for your help.