Re: Logging Axis Soap messages
The easiest way I've found is to create a couple of handlers and set them int eh request and response flows. These handlers will have a chance to operate on the message context as it comes in and out of axis. At this time you can perform the logging that you require. I split the req, the resp, and faults into different log files and have different handlers for each scenario. I have something like the following in my globalConfiguration element in the wsdd: requestFlow handler type=java:foo.bar.RequestLogHandler / handler type=java:foo.bar.FaultLogHandler / /requestFlow responseFlow handler type=java:foo.bar.ResponseLogHandler / /responseFlow Hope that helps. On 3/3/06, San D [EMAIL PROTECTED] wrote: Hi, Is there a way to log the Axis request and response SOAP messages using log4j. I tried with the following.It was creating the axis.log file, but no messages in it? where am i doing wrong? ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; appender name=FILE_ERROR class=org.apache.log4j.FileAppender param name=File value=d:/Log/ErrorLog.log/ param name=Append value=false/ param name=Threshold value=ERROR/ !-- Rollover at midnight each day -- layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d %-5p [%c] %m%n/ /layout /appender appender name=FILE_INFO class=org.apache.log4j.FileAppender param name=File value=d:/Log/AuditLog.log/ param name=Append value=false/ param name=Threshold value=INFO/ !-- Rollover at midnight each day -- layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d %-5p [%c] %m%n/ /layout /appender appender name=FILE_DEBUG class=org.apache.log4j.FileAppender param name=File value=d:/Log/axis.log/ param name=Append value=false/ param name=Threshold value=DEBUG/ !-- Rollover at midnight each day -- layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d %-5p [%c] %m%n/ /layout /appender category name=log4j.logger.org.apache.axis.SOAPPart additivity=false priority value=DEBUG/ appender-ref ref=FILE_DEBUG/ /category root appender-ref ref=FILE_ERROR/ appender-ref ref=FILE_INFO/ /root /log4j:configuration Thanks SanDi
Determining the request path for logging [1.x]
I've got logging set up to log requests, responses, and faults to seperate log files. The problem is that I cannot reliably tell which request ties to with response or fault. Using timestamps is completely unreliable. I set it to log the thread information, but this is repeated everytime the thread services a new request so you cannot get reliable info this way either. So, my question is: what approach do you use to link a specific request to a specific repsonse/fault for logging etc. Thanks -T
Re: Determining the request path for logging [1.x]
Thanks guys. The java.util.UUID approach worked perfectly. On 3/1/06, robert [EMAIL PROTECTED] wrote: Just a small caveat: The uuid idea is a good one, however, from the uuid mini faq: http://www.asciiarmor.com/blog/default/2005/01/03/C62D35145B8464302800D42AB64B5036.txt java.rmi.server.UID only has 2^16 significant digits and makes no provision for the system clock being set backward. If you run java 5.0 you can use java.util.UUID which has 2^122 significant digits and doesn't have the system clock problems. There is also commons-id . For just logging the rmi.uid issues don't really come up but java.util.UUID in general is the better option. Axis2 places a uuid in the request header for WS-Addressing, but not in the response. Last I checked axis 1.x headers (been a while) it doesn't have a UUID. HTH, Robert http://www.braziloutsource.com/ Em Quarta 01 Março 2006 15:28, o Jeff Greif escreveu: If you're using a handler for logging, the handler in the request flow could add a correlation-id or request-id property to the MessageContext with a generated value, and include it in the log message. Similarly, the handler in the response flow could retrieve that property and include it in the response/fault log. The correlation id could be generated using java.rmi.server.UID or java.rmi.dgc.VMID depending upon the configuration of your server(s). Before doing this, check to see if Axis already has some correlation-id functionality or whether there is already a unique request-id in the MessageContext. Jeff On 3/1/06, Todd Orr [EMAIL PROTECTED] wrote: I've got logging set up to log requests, responses, and faults to seperate log files. The problem is that I cannot reliably tell which request ties to with response or fault. Using timestamps is completely unreliable. I set it to log the thread information, but this is repeated everytime the thread services a new request so you cannot get reliable info this way either. So, my question is: what approach do you use to link a specific request to a specific repsonse/fault for logging etc. Thanks -T --
Re: Axis 1.3 suitable for production env?
It seems as though you haven't looked hard enough for these answers. #1 - I have been able to avoid all the Exception trouble you mention by simply creating a beanMapping for my custom exception.#2 - Easy. Create a typeMapping for your array and call it whatever you want. #3 - This just isn't true. I have many Boolean fields defined. Watching the debugger I can plainly see that they come in as null if not provided.#4 - Valid. There's only so much time in a day?Another point: I have been able to use the java2wsdl tool without modifying the wsdl at all. Of course, it depends on your needs. I have been able to easily create a wsdl of my liking by simply creating the neccessary delegate objects. I have yet to run into any trouble with wsdl creating I couldn't get around. On 1/10/06, Jarmo Doc [EMAIL PROTECTED] wrote: I do use document/literal.On the #1 issue below, I see the following from java2wsdl:- Please register a typemapping/beanmapping for 'xyz.myexception'- The class java.lang.Throwable is defined in a java or javax package and cannot be converted into an xml schema type.An xml schema anyType will beused to define this class in the wsdl file.How do I 'tweak' the WSDL to correct these issues?On the #2 issue below, I eventually found a workaround which is instead of writing the following:public class Employer{public int employerID;public Employee [] employees;}just write the following:public class Employer{public int employerID; public Employee [] employees; // could be privatepublic Employee [] getEmployees(){return this.employees;}public void setEmployees(Employee [] employees){this.employees = employees;}}This 'hack' solved all my problems to do with having to use ArrayOfEmployeein boith the Axis server and Axis clients.On #3, I don't have a solution yet so may have to create an intermediate class that contains the Booleans and then pass that class to the operationrather than passing the contained Booleans.From: Davanum Srinivas [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED]To: axis-user@ws.apache.orgSubject: Re: Axis 1.3 suitable for production env?Date: Tue, 10 Jan 2006 11:58:31 -0500 for 1/2/3. You need to use java2wsdl ONLY once, then tweak it. Makesure u use document/literal and not rpc/encoded.thanks,dimsOn 1/10/06, Jarmo Doc [EMAIL PROTECTED] wrote: Is Axis 1.3 suitable for a production environment?And is it the most suitable Axis version for a production environment? I ask because some very, very basic things appear to cause major headaches: 1. exceptions descending from java.rmi.RemoteException (as per the Axis sample NoSuchEmployeeFault) cause java2wsdl to report The class java.lang.Throwable is defined in a java or javax package and cannot be converted into an xml schema type.An xml schema anyType will be usedto define this class in the wsdl file. 2. you have to jump through hoops to avoid intermediate ArrayOf classes. 3. Boolean parameters to operations appear to be converted to intrinsic booleans (note lowercase) in an Axis client so you can only passtrue/false when you need to be able to pass true/false/null. _Don't just search. Find. Check out the new MSN Search!http://search.msn.click-url.com/go/onm00200636ave/direct/01/
Re: Axis 1.3 suitable for production env?
Not sure what's so special about an exception. My boolean situations is as follows: bean: public void setPrimary(Boolean arg0) { generates: Doc Lit - element name=primary nillable=true type=xsd:boolean/ RPC Enc - element name=primary nillable=true type=soapenc:boolean/ From what I've seen java2wsdl will generate a nillable attribute only if the argument is non-primitive. So, Axis must be seeing your argument as a boolean when it converts it. If you can absolutely verify that your java2wsdl will not produce the nillable attribute, file a bug request. On 1/10/06, Jarmo Doc [EMAIL PROTECTED] wrote: I do have a typeMapping for my exception. It was generated for me by wsdl2java, as follows: typeMapping xmlns:ns=x.y.z qname=ns:MyException type=java:x.y.z.MyException serializer=org.apache.axis.encoding.ser.BeanSerializerFactory deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory encodingStyle= / I'm assuming that this is perfectly reasonable alternative to a beanmapping. What I don't understand is why java2wsdl reports that I should register a typemapping/beanmapping (does that mean oneor the other? Or both?) for this exception when it does not report that for any other user-defined class. What's so special about an exeption? From: Todd Orr [EMAIL PROTECTED] Reply-To: axis-user@ws.apache.org To: axis-user@ws.apache.org Subject: Re: Axis 1.3 suitable for production env? Date: Tue, 10 Jan 2006 10:25:43 -0800 #1 - I have been able to avoid all the Exception trouble you mention by simply creating a beanMapping for my custom exception. On 1/10/06, Jarmo Doc [EMAIL PROTECTED] wrote: I do use document/literal. On the #1 issue below, I see the following from java2wsdl: - Please register a typemapping/beanmapping for 'xyz.myexception' - The class java.lang.Throwable 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. How do I 'tweak' the WSDL to correct these issues? 1. exceptions descending from java.rmi.RemoteException (as per the Axis sample NoSuchEmployeeFault) cause java2wsdl to report The class java.lang.Throwable 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. _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Custom Serializer
Does anyone know of any tutorials on custom serialization? I've been hacking through the BeanSerializer, but my results are not encouraging. Thanks.-T
Re: axis2 impressions
We build with maven and have a simple goal that iterates through the project'sdependencies and copies them all into the lib folder of the axis2 webapp. Another goal removes them. This is pretty easy to do and frees you fromhaving to worry about modifying the axis2 war file.We use JBoss4 and Ant. In our environment, we would still have to alter the deployed war unless we either built axis2 each time, or un/re-packaged the war each time. This situation is less than ideal. Even if this is a headache for my release engineer and therefore is mitigated to one resource, it still pales in comparison the to developer productivity drawbacks stated. On 12/15/05, Alex Artigues [EMAIL PROTECTED] wrote: 5This new approach is incompatible with my company's build scripts. Automating the build seems to be a hassle. I do not even see a nice way to do this - explode the war, build and deploy my aar files to the exploded war, then repackage? Ugh.We build with maven and have a simple goal that iterates through the project'sdependencies and copies them all into the lib folder of the axis2 webapp.Another goal removes them.This is pretty easy to do and frees you from having to worry about modifying the axis2 war file.--Alex
Axis2 Deployment Options
The changes in the deployment options from Axis1 to Axis2 are very disruptive. The web admin for uploading new services is nice for testing, but makes my company's deployment scripts useless. The fact that the aar files need to be placed in the exploded axis2 war's services directory makes deployment a real pain. Axis1 was very simple and easy to use since it was only a regular webapp. I've been reading through the docs, and I do not see any other deployment options. Has anyone found any better ways to deploy axis2 services?
Re: Axis2 Deployment Options
Also, how do you share global objects now? I used to be able to create an entire war and share any objects I needed to. Now that the services are in individual aar files, where do I put the shared objects? On 12/14/05, Todd Orr [EMAIL PROTECTED] wrote: The changes in the deployment options from Axis1 to Axis2 are very disruptive. The web admin for uploading new services is nice for testing, but makes my company's deployment scripts useless. The fact that the aar files need to be placed in the exploded axis2 war's services directory makes deployment a real pain. Axis1 was very simple and easy to use since it was only a regular webapp. I've been reading through the docs, and I do not see any other deployment options. Has anyone found any better ways to deploy axis2 services?
Re: Axis2 Deployment Options
Also, how would you version the services now? I used to be able to create a separate war with a different url-pattern based on version. Now that services are deployed under one war, how can I differentiate? On 12/14/05, Todd Orr [EMAIL PROTECTED] wrote: Also, how do you share global objects now? I used to be able to create an entire war and share any objects I needed to. Now that the services are in individual aar files, where do I put the shared objects? On 12/14/05, Todd Orr [EMAIL PROTECTED] wrote: The changes in the deployment options from Axis1 to Axis2 are very disruptive. The web admin for uploading new services is nice for testing, but makes my company's deployment scripts useless. The fact that the aar files need to be placed in the exploded axis2 war's services directory makes deployment a real pain. Axis1 was very simple and easy to use since it was only a regular webapp. I've been reading through the docs, and I do not see any other deployment options. Has anyone found any better ways to deploy axis2 services?
axis2 impressions
The more I learn about Axis2, the less appealing it is. It seems to be giant leap backwards. Why is coding using OMElement (and the other OM... objects) a better approach than deploying a POJO? This is a huge pain. Not to mention the deployment issues that I've already run into. Based on the documentation I feel as though Axis2 is a step forward architecturally, but extremely weak in user friendliness. For this reason I've been finding myself more interested in XFire. It has many features of Axis2, yet is extremely easy to create Web services with. Why would the Axis2 team go in this anti-productivity direction?
Shared Session Objects
I am having trouble with Axis' session handling. I have two services. One deals with logging a user in to the system. The other performs some business specific logic. This user service has a login method that stores some data in the session to use as a key for subsequent isLoggedIn calls. If I call the user web service and login, it works. If I then subsequently call the user services' isLoggedIn method, it works. However, if I then call a business method on the other service that calls out to the user service object to determine if the user is logged in, it fails. What am I missing?
WSDL Location Question
I've read up on how to tell Axis to use a specific wsdl instead of auto-generating them. I still have not found any information on altering the public wsdl location. So, I moved my wsdls into a publicly accessible (outside of WEB-INF) directory. Now I can easily generate client stubs. However, I cannot submit a soap request to these locations. Is there a way to configure the public wsdl location, and the service's access point? Preferably, they'd be one in the same. The big part of the problem is that I find the default inadequate.Thanks,T
Re: Required Fields
I got it. So WSDL first is a better approach. Thanks for your input. when something is missing in an open source project perhaps that thing is your contribution. :)I'm thinking about it. It's no small change and would require JDK5, etc. But, I think it would help. On 11/23/05, Ron Reynolds [EMAIL PROTECTED] wrote: i've found (the hard way) that putting your objects before your XML whenwriting web services makes for more problems than it solves (and tends toproduce very inefficient XML, especially if you go with a non-encoded (literal) approach).i found it much easier and more efficient in general tothink about the API operations, then the XML to the API, write the WSDL, letAxis generate the objects, then write code to map those objects into any other object model(s) i might have on the client and/or server sides.much simpler(and possibly more efficient) than trying to write customserializers/deserializers to map pre-existing objects into XML (especially if that XML is substantially different from the original object).just my $0.02 worth...when something is missing in an open source project perhaps that thing is yourcontribution. :) I don't know how. I imagine a world where I can put a little @required annotation next to a property in my pojo. The java2wsdl would recognize this and produce the correct schema. Forgive me, I'm still getting a handle on SOAP. Maybe I've got pie in the sky hopes. I've gotten used to working with (what I've found to be) highly productive frameworks like ejb3, spring, and tapestry. I feel like something is missing here. I will hand code this stuff if I have to, but this solution has improvement written all over it. I've looked around a little bit (http://ws.apache.org/axis/java/releases.html, for example) and I don't see any roadmap for these type of conveniences. Are there any plans to ease our burdens? On 11/22/05, Ron Reynolds [EMAIL PROTECTED] wrote: AH!that's backwards from the way i build my services.sorry, dunno that one - how WOULD Java2WSDL be able to tell that a field is required vs optional?it seems to use primitives for required fields, object-wrappers for optional.but i'm not sure if it works in reverse. good luck. Todd Orr wrote: I'm trying to produce wsdl's from my service pojos. How do I specify which properties are mandatory so that when the java2wsdl runs the schema will be correct?
Re: Versioning Techniques
How about your source packages? I have found that I need to manage the endpoint classes as well. I suppose all additional properties could be omitted from the wsdl, but at some point a complete refactor may be in order. In this case, I will need to branch the source too. Package names cannot contain numbers, so it gets really ugly. On 11/23/05, Yagiz Erkan [EMAIL PROTECTED] wrote: We combine namespace and the version id. We do a namespace change fornon-backwards compatible changes and a version id attribute change ifthe change is backwards compatible. And we use the date pattern in thenamespace to distinguish the versions. - Yagiz -
Required Fields
Pardon my noobiness, but I've googled the hell out of this to no avail. Is there a way to specify required properties in the wsdd file so that the schema gets generated accordingly? All I want to do is specify required elements so that the validation can occur at XML validation time before hitting the code. Thanks,T
Re: Required Fields
Really, how? Do I annotate the methods or something? How does the Java2WSDL generate a WSDL that reflects the constraints on my pojo?On 11/22/05, Ron Reynolds [EMAIL PROTECTED] wrote:that sort of info is normally contained in the XSD and embedded into the code via WSDL2Java...you're trying to change a WSDD so that the generated WSDL'sXSD has requirements that aren't mirrored in the original WSDL from which theWSDD was generated? :-?from what i've seen the client-side validation is embedded into the client-side stub code and that also is extracted from theWSDL/XSD from which it was generated. Pardon my noobiness, but I've googled the hell out of this to no avail. Is there a way to specify required properties in the wsdd file so that the schema gets generated accordingly? All I want to do is specify required elements so that the validation can occur at XML validation time before hitting the code. Thanks, T
Re: Required Fields
I'm trying to produce wsdl's from my service pojos. How do I specify which properties are mandatory so that when the java2wsdl runs the schema will be correct?On 11/22/05, Ron Reynolds [EMAIL PROTECTED] wrote: when did pojo's come into the picture?i was referring to the client-side api classes generated by WSDL2Java -the types section of the WSDL is XML Schema, which has all the rulesfor required, optional, and so forth.WSDL2Java consumes the XSD and produces Java code (in the form of the client api data classes) thatenforce those rules.it sounded like you wanted to change those rulespost-WSDL2Java.but now it sounds like you're not using WSDL2Java at all?i guess i'm not sure how you generated your service or your client- is the client-side hand-written (thus pojo) or generated?or are youtalking straight XML to your service?sorry, it's getting late - i'm rambling..ron.Todd Orr wrote: Really, how? Do I annotate the methods or something? How does the Java2WSDL generate a WSDL that reflects the constraints on my pojo? On 11/22/05, *Ron Reynolds * [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: that sort of info is normally contained in the XSD and embedded into the code via WSDL2Java...you're trying to change a WSDD so that the generated WSDL's XSD has requirements that aren't mirrored in the original WSDL from which the WSDD was generated? :-?from what i've seen the client-side validation is embedded into the client-side stub code and that also is extracted from the WSDL/XSD from which it was generated. Pardon my noobiness, but I've googled the hell out of this to no avail. Is there a way to specify required properties in the wsdd file so that the schema gets generated accordingly? All I want to do is specify required elements so that the validation can occur at XML validation time before hitting the code. Thanks, T
Re: Required Fields
I don't know how. I imagine a world where I can put a little @required annotation next to a property in my pojo. The java2wsdl would recognize this and produce the correct schema. Forgive me, I'm still getting a handle on SOAP. Maybe I've got pie in the sky hopes. I've gotten used to working with (what I've found to be) highly productive frameworks like ejb3, spring, and tapestry. I feel like something is missing here. I will hand code this stuff if I have to, but this solution has improvement written all over it. I've looked around a little bit ( http://ws.apache.org/axis/java/releases.html, for example) and I don't see any roadmap for these type of conveniences. Are there any plans to ease our burdens? On 11/22/05, Ron Reynolds [EMAIL PROTECTED] wrote: AH!that's backwards from the way i build my services.sorry, dunnothat one - how WOULD Java2WSDL be able to tell that a field is requiredvs optional?it seems to use primitives for required fields,object-wrappers for optional.but i'm not sure if it works in reverse. good luck.Todd Orr wrote: I'm trying to produce wsdl's from my service pojos. How do I specify which properties are mandatory so that when the java2wsdl runs the schema will be correct? On 11/22/05, * Ron Reynolds* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: when did pojo's come into the picture? i was referring to the client-side api classes generated by WSDL2Java - the types section of the WSDL is XML Schema, which has all the rules for required, optional, and so forth.WSDL2Java consumes the XSD and produces Java code (in the form of the client api data classes) that enforce those rules.it sounded like you wanted to change those rules post-WSDL2Java.but now it sounds like you're not using WSDL2Java at all?i guess i'm not sure how you generated your service or your client - is the client-side hand-written (thus pojo) or generated?or are you talking straight XML to your service?sorry, it's getting late - i'm rambling... ...ron. Todd Orr wrote: Really, how? Do I annotate the methods or something? How does the Java2WSDL generate a WSDL that reflects the constraints on my pojo? On 11/22/05, *Ron Reynolds * [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: that sort of info is normally contained in the XSD and embedded into the code via WSDL2Java...you're trying to change a WSDD so that the generated WSDL's XSD has requirements that aren't mirrored in the original WSDL from which the WSDD was generated? :-?from what i've seen the client-side validation is embedded into the client-side stub code and that also is extracted from the WSDL/XSD from which it was generated.Pardon my noobiness, but I've googled the hell out of this to no avail. Is there a way to specify required properties in the wsdd file so that the schema gets generated accordingly? All I want to do is specify required elements so that the validation can occur at XML validation time before hitting the code. Thanks, T
Versioning Techniques
What is the best way(s) to version SOAP applications. Since these are externally facing APIs, they must provide a reliable means for third parties to consume services. I must ensure that the wsdl that I provide will not change. However, change is inevitable. Therefore, there must be a way to version SOAP applications. I can imagine that this has mostly something to do with the wsdl url. If so, what would a typical project structure look like? Are there any other ways that you've overcome this problem?