RE: Axis 2 deployment as part of existing web application
Jason, Thanks for your solution. Sounded like fun! I did my own form of experimentation and got it going. Basically I just did this: 1) copy the web.xml that was in the book example 2) copy the WEB-INF/conf/axis2.xml file from the axis2.war file 3) put my services.xml and wsdl file in WEB-INF/services/MyService/META-INF 4) added a WEB-INF/module directory and added the appropriate changes to axis2.xml (I use the logging module so I can see the Soap calls) 5) added all of the jars from the axis2-min-1.0-bin.zip distribution That seemed to do it. Really I just needed to make sure I had all the right jars. I still think theres some I can remove. Plus I used xmlbeans to create my service using WSDL2JAVA and have even more jars to add, which may cause me to switch that later to something less dependent. But alls well now! Whats documentation? ;) Brian Russell www.closerware.com -Original Message- From: Jason N [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 4:25 PM To: axis-user@ws.apache.org Subject: Re: Axis 2 deployment as part of existing web application Brian, I ran into the same problems as I tried to do both an embedded axis2 deploy and get Axis2-Spring up and running. Undoubtedly this is the wrong way to do it, and I'm sure there's a better way. However I couldn't find it. Chime in if you know a better way! Here's what I did: Starting with the axis2 war file I combined the lines from the axis2.war web.xml file with my project's web.xml file where they were relevant. I copied the conf directory from axis2.war over to web-inf\ of my project copied the modules directory from axis2.war over to web-inf\ of my project I created a services directory set up similar to the one that ws02 example gives however I just put services.xml, and the wsdl file in /web-inf/services/findService/META-INF I use a limited version of Maven and I did it this way so I could have a web service module that could be popped into the lib directory of the web app if I ever decided to move the web service code base out of the project. So basically all of the generated class files are in the web-inf/lib directory. I copied most of the axis2 lib files into the web-inf/lib directory. I can't really list them all right here, but off the top of my head: Please keep in mind this is coming straight from my lib directory so there may be things in here that you won't need. (xmlbeans, etc...) Annogen, axiom all, asm, axis2-*, backport, commons-config, commonds-dbcp, commons-digester, commons-httpclient, commons-logging, commons-pool, jaxen, jibx, neethi, stax-api, wstx-asl, xbean, xmlschema Anyway once all of that is in place and everything deploys ok, you should be able to acccess the web service by ip/webservicename/services/servicename Again this is just how I was able to get it up and running. I don't think it's a great solution, but I had to move on to writing documentation wooho! Good luck! j On 6/26/06, Brian Russell [EMAIL PROTECTED] wrote: I tried using the example referenced below [1] (http://www.wso2.net/kb/90)but was unable to get the mvn install to work. I'm not familiar with maven and therefore troubleshooting will be pretty tough. I followed the instructions of downloading the book.zip and then running the mvn install war:war command, but it fails while trying to execute the command. I'm simply trying to use it to figure out how to include axis2 as part of a current webapp so that I can run a web service from it. This is much more attractive (and necessary) than to have an axis2 app running to do hot deploys, etc. Really I just want to know what jars I need from axis2 and how it needs to be configured. That is why I was hoping to get this book example working. Here is my stack trace when running $ mvn install war:war : C:\projects\jakarta\axis\axis2-1_0\samples\bookmvn -e install war:war + Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'war'. [INFO] [INFO] Building Book Example [INFO]task-segment: [install, war:war] [INFO] Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-model/2.0/maven-mod el-2.0.pom 2K downloaded Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven/2.0/maven-2.0.pom 8K downloaded Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.0.4/ple xus-utils-1.0.4.pom 6K downloaded Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-project/2.0/maven-p roject-2.0.pom 1K downloaded Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-container-defau lt/1.0-alpha-8/plexus-container-default-1.0-alpha-8.pom 7K downloaded Downloading: http://repo1.maven.org/maven2/classworlds/classworlds/1.1-alpha-2/classw orlds-1.1-alpha-2.pom 3K
RE: Axis 2 deployment as part of existing web application
ltArtifactResolver.java:140) at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(Defau ltArtifactResolver.java:63) at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromReposit ory(DefaultMavenProjectBuilder.java:467) ... 27 more Caused by: org.apache.maven.wagon.TransferFailedException: Error transferring file at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData (LightweightHttpWagon.java:99) at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:68) at org.apache.maven.artifact.manager.DefaultWagonManager.verifyChecksum(Def aultWagonManager.java:520) at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(Defa ultWagonManager.java:380) at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(Defaul tWagonManager.java:282) at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(Defaul tWagonManager.java:244) at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(Defau ltArtifactResolver.java:124) ... 29 more Caused by: java.io.IOException: Server returned HTTP response code: 503 for URL: http://repo1.maven.org/maven2/org/apache/maven/maven-plugin -api/2.0/maven-plugin-api-2.0.pom.sha1 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnec tion.java:1149) at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData (LightweightHttpWagon.java:85) ... 35 more [INFO] [INFO] Total time: 8 seconds [INFO] Finished at: Mon Jun 26 13:32:07 EDT 2006 [INFO] Final Memory: 3M/6M [INFO] If anyone has gotten this example going (or has successfully included axis2 in their current app), your help will be much appreciated. Thanks in advance! [1] http://www.wso2.net/kb/90 Brian Russell www.closerware.com -Original Message- From: Davanum Srinivas [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 20, 2006 3:55 PM To: axis-user@ws.apache.org Subject: Re: Axis 2 deployment as part of existing web application Yes. See [1] for a POJO sample. You can similarly embed a WSDL2Java generated service as well. -- dims [1] http://www.wso2.net/kb/90 On 6/20/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I was wondering if Asix 2 can be deployed as part of an existing application war, just like original Axis was able to? Thanks, Ahmed This mail sent through www.mywaterloo.ca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Davanum Srinivas : http://wso2.com/blogs/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Axis2] Debugging the SOAP call
I want to be able to simply see the call that is made by the client to my web service for debugging purposes. I have no control over the client program and no way of setting up any debugging on that end, so I just want to have Axis2 print out the actual call to my service to a log. Can anyone point me in the right direction? Brian Russell www.closerware.com
[Axis2] WSDL2Java Data Binding
Is there a preferred method out of xmlbeans, adb, or jaxme? I know the default is adb. XmlBeans seems to give some decent code, but theres a lot of extra classes and schemas that have to be included along with it. Im not really sure how adb compares. Brian Russell www.closerware.com
RE: [Axis2] Maintaining Session Ticket
Seems your interaction goes beyond a simple IN-OUT MEP. So if you want to maintain this you can either define a custom MEP or use WS-Addressing replyTo mechanism to pass your ticket here and there. It looks as though I will have to come up with something custom for passing tickets back and forth. This ticket is just some made up string that would allow me to track that this is the same communication session (along with some other things I can check) so that I can verify that I'm talking to the same client, and where I am in the communication process. As I had mentioned, I had hoped to do this using HttpSession, but I don't think it's possible. I really have no knowledge of SOAP or any of the guts of Axis.. so really want to just use it to serve my Web Service while I worry about the business logic of what the service actually is supposed to do. I will have to look at WS-Adressing but as you said, I think my implementation goes beyond just a simple IN-OUT MEP. The client is going to make specific method calls (which contain this ticket string) to my WS which I cannot change, so that's all I have to work with. Is your client also uses Axis2 as the client. setting options.setManageSession(true), Axis2 client will automatically do it without client being worried about it. But if the clients are using some other clients, then they have to explicitly do this. No. This is Intuit's client program that they developed and I have no control over. In Axis2 we do not have static methods in MessageContext. If you wanna access message context within your skeleton, read this : http://www.wso2.net/kb/106.; Thanks! This will likely be useful as I learn more of what my capabilities are in Axis2. Brian Russell www.closerware.com -Original Message- From: Eran Chinthaka [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 14, 2006 1:04 AM To: axis-user@ws.apache.org Subject: Re: [Axis2] Maintaining Session Ticket Brian Russell wrote: 1.Has anyone worked with maintaining session specifically with regard to the Quickbooks Web Connector v.1.0.52 and Axis2 v.1.0 on Tomcat 5 (I'm using v.5.5.15)? a.If not, does anyone have any suggestions for implementing this session maintenance by passing this ticket (which is just a String) back to the client, who sends it back to the server on subsequent calls until the final closing call? Before I answer this questions, let explain two concepts. 1. Using WS-Addressing, if some one gets reference parameters within replyTo header, then he needs to send out thr reference parameters back to the place in his response. 2. Depending on the number and direction of messages happening, we define a message exchange pattern (MEP). Seems your interaction goes beyond a simple IN-OUT MEP. So if you want to maintain this you can either define a custom MEP or use WS-Addressing replyTo mechanism to pass your ticket here and there. Is your client also uses Axis2 as the client. setting options.setManageSession(true), Axis2 client will automatically do it without client being worried about it. But if the clients are using some other clients, then they have to explicitly do this. 2.I will most likely be needing to access the HttpSession in the skeleton class for my web service, based on what I've read in the archives, that would look something like this: MessageContext messageContext = MessageContext.getCurrentContext(); In Axis2 we do not have static methods in MessageContext. If you wanna access message context within your skeleton, read this : http://www.wso2.net/kb/106. -- Chinthaka - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Axis2] Maintaining Session Ticket
Your ticket is handled at the application level where the ticket is passed to the application (the service class) and then the business logic code checks for the compatibility of the ticket ? Yes.. true. I have to implement specific method calls on my web service. The first method called by the client authenticates them.. then I give them back a ticket string. Then the client calls a possible 5 other methods which are always receiving the ticket string which I sent to the client. I have no control over the client as it was developed by Intuit and I'm just implementing my Web Service to fit their wsdl. If so you would not be able to use the addressing reference properties to make it work. Addressing reference properties are a means of handling sessions and other stuff without the application being aware! Unfortunately I guess this seems to be the case. Because of the requirements of the methods that the client is expecting to call, I will have to handle the session maintenance and ticket tracking within the application itself. Attached is the wsdl I have to implement for my Web Service, but here is a basic breakdown of the methods that the client calls, so you can see why I have to handle everything in the app: - public java.lang.String[] authenticate(java.lang.String strUserName, java.lang.String strPassword) - public java.lang.String sendRequestXML(java.lang.String ticket, java.lang.String strHCPResponse, java.lang.String strCompanyFileName, java.lang.String qbXMLCountry, int qbXMLMajorVers, int qbXMLMinorVers) - public int receiveResponseXML(java.lang.String ticket, java.lang.String response, java.lang.String hresult, java.lang.String message) - public java.lang.String connectionError(java.lang.String ticket, java.lang.String hresult, java.lang.String message) - public java.lang.String getLastError(java.lang.String ticket) - public java.lang.String closeConnection(java.lang.String ticket) Brian Russell www.closerware.com -Original Message- From: Ajith Ranabahu [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 14, 2006 1:55 AM To: axis-user@ws.apache.org; [EMAIL PROTECTED] Subject: Re: [Axis2] Maintaining Session Ticket Hi, Lemme get your problem first :) Your ticket is handled at the application level where the ticket is passed to the application (the service class) and then the business logic code checks for the compatibility of the ticket ? If so you would not be able to use the addressing reference properties to make it work. Addressing reference properties are a means of handling sessions and other stuff without the application being aware! Ajith On 6/14/06, Eran Chinthaka [EMAIL PROTECTED] wrote: Brian Russell wrote: 1.Has anyone worked with maintaining session specifically with regard to the Quickbooks Web Connector v.1.0.52 and Axis2 v.1.0 on Tomcat 5 (I'm using v.5.5.15)? a.If not, does anyone have any suggestions for implementing this session maintenance by passing this ticket (which is just a String) back to the client, who sends it back to the server on subsequent calls until the final closing call? Before I answer this questions, let explain two concepts. 1. Using WS-Addressing, if some one gets reference parameters within replyTo header, then he needs to send out thr reference parameters back to the place in his response. 2. Depending on the number and direction of messages happening, we define a message exchange pattern (MEP). Seems your interaction goes beyond a simple IN-OUT MEP. So if you want to maintain this you can either define a custom MEP or use WS-Addressing replyTo mechanism to pass your ticket here and there. Is your client also uses Axis2 as the client. setting options.setManageSession(true), Axis2 client will automatically do it without client being worried about it. But if the clients are using some other clients, then they have to explicitly do this. 2.I will most likely be needing to access the HttpSession in the skeleton class for my web service, based on what I've read in the archives, that would look something like this: MessageContext messageContext = MessageContext.getCurrentContext(); In Axis2 we do not have static methods in MessageContext. If you wanna access message context within your skeleton, read this : http://www.wso2.net/kb/106. -- Chinthaka -- Ajith Ranabahu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] QBWebConnectorSvc.wsdl Description: Binary data - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Axis2] Maintaining Session Ticket
I am trying to implement a stateful web service using HttpSession from my Axis2/Tomcat server. The clients calls to my web service always contain a ticket that I need to pass back to them upon authorization, and check during each call until the connectionClosed method is called. Specifically, I am implementing a Web Service to interact with Quickbooks by using their Web Connector client application. What I want to do, is take advantage of session handling by Tomcat in order to properly pass a ticket back to the client, which they will send back to me each time they make a request after the initial authorization. Then on subsequent calls I can check this ticket against the current open sessions to see if their session has expired or has been closed. The key here is that this is a third party client that I have no control over. I am just implementing the web service based on their wsdl. If you would like to see the methods created in the skeleton class, let me know, but basically just know that after the first call a ticket string is passed back in subsequent calls for me to use to maintain the current session. Has anyone worked with maintaining session specifically with regard to the Quickbooks Web Connector v.1.0.52 and Axis2 v.1.0 on Tomcat 5 (Im using v.5.5.15)? If not, does anyone have any suggestions for implementing this session maintenance by passing this ticket (which is just a String) back to the client, who sends it back to the server on subsequent calls until the final closing call? I will most likely be needing to access the HttpSession in the skeleton class for my web service, based on what Ive read in the archives, that would look something like this: MessageContext messageContext = MessageContext.getCurrentContext(); HttpServlet servlet = (HttpServlet)messageContext.getProperty(HTTPConstants.MC_HTTP_SERVLET); ServletContext servletContext = (ServletContext)servlet.getServletContext(); HttpSession session =((HttpServletRequest)messageContext.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST)).getSession(); String jsessionid = session.getId() This will give me the current session in order to get the id, on their first request.. however Im guessing that each subsequent request by them will open a new session, so given the JSESSIONID (which the client gives me on their request as a ticket) can I then check to see that the session has not expired and gain access to it? Thank you, Brian Russell www.closerware.com