Re: How best to transform a XML file into a message.
On Thu, Apr 2, 2009 at 3:27 PM, cara wrote: > umm ... fun? ... I don't know ... it's 'enterprise plumbing' ... I am one of those strange people that enjoys plumbing. The project I am using Axis2/C on is a side thing for me that consists of a whole host of languages: .Net 2.0 (still, need to upgrade to 3.5), PHP5 & JavaScript, Apache C Module, and Microsoft ATL framework. Of it all I enjoy the Apache C Module and the ATL (with is simply a C++ framework) the best. The C#.Net is fine, that is what I code in at my day job, hate the PHP and JavaScript. For the record, the Axis2/C code is replacing the PHP5 and Silverlight is replacing the JavaScript and HTML on the frontend. > If you start using java, buy XMLSpy ... it's worth it! I think it generates > M$ C code though ... Yea, have used it in the past and it is a great tool. I just cannot justify the cost of the Enterprise Edition for this project. Besides it looks like the WSDL functionality in the version I played with on Monday is not as friendly as in the Eclipse WSDL editor. What specifically about XMLSpy makes you mention it? If it can replace the crappy WSDL2C, than I would seriously consider it! It bugs me how WSDL2C does not generate "safe" string functions and VS2008 gives me all these warnings. I think I might get into the Java code and fix that, but first I need to figure out if this "safe" string function is a Microsoft thing or a new C standard thing, then I need to learn how to setup the Java environment, and finally I need to learn what it takes to submit the changes back to the Axis2/Java project. Sam
Re: How best to transform a XML file into a message.
On Thu, Apr 2, 2009 at 11:22 AM, Sam Carleton wrote: > On Thu, Apr 2, 2009 at 1:16 PM, cara wrote: > > > > he he ... I'm laughing pretty hard right now. Well, Sam, perhaps we have > now bent > > your ear with too much information. No matter what, don't feel bad ... > there is a lot > > to learn ... and I swear, you can only learn this junk by doing ... > > Well, it is a lot of info, not all of which I can absorb, but I am > trying;) I am just glad I finally get to dig into web services and > WSDL, it is all fun stuff! > umm ... fun? ... I don't know ... it's 'enterprise plumbing' ... If you start using java, buy XMLSpy ... it's worth it! I think it generates M$ C code though ... > > Sam >
Re: How best to transform a XML file into a message.
On Thu, Apr 2, 2009 at 1:16 PM, cara wrote: > > he he ... I'm laughing pretty hard right now. Well, Sam, perhaps we have now > bent > your ear with too much information. No matter what, don't feel bad ... there > is a lot > to learn ... and I swear, you can only learn this junk by doing ... Well, it is a lot of info, not all of which I can absorb, but I am trying;) I am just glad I finally get to dig into web services and WSDL, it is all fun stuff! Sam
Re: How best to transform a XML file into a message.
I agree with everyone that the java implementations have been ahead of the c. Also, a whole lot depends on that WSDL. Read the online IBM article about 'Which WSDL should I use?' The service side can make decisions like returning an XML response message all the time instead of throwing an exception. Exceptions tend to be a pain in rearend in different languages including C and ZSI (Python). they work just fine in java. I ended up doing document-literal WSDLs all in java (Axis and now JAX-WS), but the design was often driven by what languages were on the client-side. If we had C++ and Python clients to integrate, the WSDL had to be pretty conservative. On the service-side in java I have even DOM parsed an XML file and filled the autogenerated classes created by the WSDL and XSD. There are also tricks to changing the service-side ... for example, you can try to nail your interface methods (WSDL) down and only add to your XSD. In some cases existing clients can just keep using the service without re-autogenerating ... but this is the beauty of a cleaner code design which capitalizes on the extensibility and standard parsing of XML. I'd like to know if other companies are doing a good job of managing and versioning their WSDL and XSD files (they should be separate).? or, are they just letting the whole governance and configuration management fall apart.? he he ... I'm laughing pretty hard right now. Well, Sam, perhaps we have now bent your ear with too much information. No matter what, don't feel bad ... there is a lot to learn ... and I swear, you can only learn this junk by doing ... LOL cara On Thu, Apr 2, 2009 at 9:52 AM, Sam Carleton wrote: > On Thu, Apr 2, 2009 at 11:37 AM, cara wrote: > >> Sam, >> >> IMHO, it isn't worth doing web services unless you use the autogenerated >> code. I learned from experience to stop hand jamming xml. If your WSDL >> changes, you want to re-autogenerate the plumbing code on both your client >> and server side ... and with any luck, any code changes you have are >> isolated in the code you had to write in order to use the objects generated >> on your client side. > > > Very good point, things will change and using the autogenerated code will > make that far less painful. > > Thank you. > > Sam >
RE: How best to transform a XML file into a message.
Mike. > Thanks, I'll look at that but couldn't I just use subversion for that? > If I find a new wsdl file, I can just copy if over a local svn check > out, commit the new one, and then go back and play around if needed. That's true you can do that. I would only suggest going that route if you only move forward and will never need to support a previous version. For our project we get a new version of the WSDL file every few months. Thus we use the Archiva method for management of these artifacts as not all client operations of our service update to the latest immediately so we end up supporting multiple versions of a single WSDL. This in itself is it's own task especially when dealing with generated code and namespaces... > I hate to ask but does the XML file actually relate to your WSDL or > is it unrelated DATA, intended for a local XML parser to examine? > You may be just asking a question like, " how do I send a JPEG or > PDF file in a SOAP response?" I prefer to think of web services as a combination of operations/signatures and payloads. The XML is the payload and is defined by the XML Schema which is generally referenced from or embedded in the WSDL. The operation signature is defined by the WSDL with wsdl:operation and wsdl:message. Example: http://www.w3.org/2001/XMLSchema"; xmlns:msg="http://www.mycompany.com";> http://schemas.xmlsoap.org/soap/http"; style="document"/> It's fine to have the WSDL but you need a schema definition to go along with it. It ends up looking something like this: Request message: foo Response message: foo There's a quick and dirty intro to WSDL. This is why I was asking if the XML Schema was changing or just the operation signatures... Disclaimer: I did this off the top of my head! Alastair This e-mail and any attachments are intended solely for the use of the intended recipient(s) and may contain legally privileged, proprietary and/or confidential information. Any use, disclosure, dissemination, distribution or copying of this e-mail and any attachments for any purposes that have not been specifically authorized by the sender is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by reply e-mail and permanently delete all copies and attachments. The entire content of this e-mail is for "information purposes" only and should not be relied upon by the recipient in any way unless otherwise confirmed in writing by way of letter or facsimile. -Original Message- From: Mike Marchywka [mailto:marchy...@hotmail.com] Sent: Thursday, April 02, 2009 9:40 AM To: axis-c-user@ws.apache.org Subject: RE: How best to transform a XML file into a message. > Subject: RE: How best to transform a XML file into a message. > Date: Thu, 2 Apr 2009 09:32:47 -0700 > From: spam haven CT > To: axis-c-user@ws.apache.org > > Hi Mike. > > The Java route for different versions of the WSDL is a very good > solution. Especially if you couple this with Maven2 and the use of an > artifact repository such as Archiva (http://archiva.apache.org/). > Then, you can construct an individual, versioned JAR file for each > version of the WSDL. In your Java code the run the application you can > then simply configure it to use the appropriate version as necessary. > This would remove the need to "update your classpath" - you'd simply > let Maven2 manage the dependencies. > Thanks, I'll look at that but couldn't I just use subversion for that? If I find a new wsdl file, I can just copy if over a local svn check out, commit the new one, and then go back and play around if needed. > Another follow on question to your previous email: Are they changing > the WSDL or the Schema of the web services? > I hate to ask but does the XML file actually relate to your WSDL or is it unrelated DATA, intended for a local XML parser to examine? You may be just asking a question like, " how do I send a JPEG or PDF file in a SOAP response?" > Alastair _ Windows Live(tm): Keep your life in sync. http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_042009
Re: How best to transform a XML file into a message.
On Thu, Apr 2, 2009 at 11:37 AM, cara wrote: > Sam, > > IMHO, it isn't worth doing web services unless you use the autogenerated > code. I learned from experience to stop hand jamming xml. If your WSDL > changes, you want to re-autogenerate the plumbing code on both your client > and server side ... and with any luck, any code changes you have are > isolated in the code you had to write in order to use the objects generated > on your client side. Very good point, things will change and using the autogenerated code will make that far less painful. Thank you. Sam
RE: How best to transform a XML file into a message.
> Subject: RE: How best to transform a XML file into a message. > Date: Thu, 2 Apr 2009 09:32:47 -0700 > From: spam haven CT > To: axis-c-user@ws.apache.org > > Hi Mike. > > The Java route for different versions of the WSDL is a very good > solution. Especially if you couple this with Maven2 and the use of an > artifact repository such as Archiva (http://archiva.apache.org/). Then, > you can construct an individual, versioned JAR file for each version of > the WSDL. In your Java code the run the application you can then simply > configure it to use the appropriate version as necessary. This would > remove the need to "update your classpath" - you'd simply let Maven2 > manage the dependencies. > Thanks, I'll look at that but couldn't I just use subversion for that? If I find a new wsdl file, I can just copy if over a local svn check out, commit the new one, and then go back and play around if needed. > Another follow on question to your previous email: Are they changing the > WSDL or the Schema of the web services? > I hate to ask but does the XML file actually relate to your WSDL or is it unrelated DATA, intended for a local XML parser to examine? You may be just asking a question like, " how do I send a JPEG or PDF file in a SOAP response?" > Alastair _ Windows Liveā¢: Keep your life in sync. http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_042009
RE: How best to transform a XML file into a message.
Hi Mike. The Java route for different versions of the WSDL is a very good solution. Especially if you couple this with Maven2 and the use of an artifact repository such as Archiva (http://archiva.apache.org/). Then, you can construct an individual, versioned JAR file for each version of the WSDL. In your Java code the run the application you can then simply configure it to use the appropriate version as necessary. This would remove the need to "update your classpath" - you'd simply let Maven2 manage the dependencies. Another follow on question to your previous email: Are they changing the WSDL or the Schema of the web services? Alastair This e-mail and any attachments are intended solely for the use of the intended recipient(s) and may contain legally privileged, proprietary and/or confidential information. Any use, disclosure, dissemination, distribution or copying of this e-mail and any attachments for any purposes that have not been specifically authorized by the sender is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by reply e-mail and permanently delete all copies and attachments. The entire content of this e-mail is for "information purposes" only and should not be relied upon by the recipient in any way unless otherwise confirmed in writing by way of letter or facsimile. -Original Message- From: Mike Marchywka [mailto:marchy...@hotmail.com] Sent: Thursday, April 02, 2009 9:18 AM To: axis-c-user@ws.apache.org Subject: RE: How best to transform a XML file into a message. > Date: Thu, 2 Apr 2009 08:37:01 -0700 > Subject: Re: How best to transform a XML file into a message. > From: > To: axis-c-user@ws.apache.org > > Sam, > > IMHO, it isn't worth doing web services unless you use the autogenerated code. I learned from experience to stop hand jamming xml. If your WSDL changes, you want to re-autogenerate the plumbing code on both your client and server side ... and with any luck, any code changes you have are isolated in the code you had to write in order to use the objects generated on your client side. > > I spent a lot of time with the C generated code and never did get it to work well I so went back to java axis and everything pretty much worked right away. But, the reason for mentioning this now, is that I have subsequently found that our service provider often updates the WSDL file. This turns out to be fine in java since I can diff the wsdl files, re generate the class files unless there is something gross that has been changed, and then almost all of my reflection-invoked code still runs: I can archive, upload, and download things in a complete and consistent manner by just looking for public get/set methods. Is there some similar facility in the C- axis to reflection invokation? I guess if you put all that in a DLL/SO you can load the library of your choice. With java, if I really need to, I can point the class path to pick up either the current or prior WSDL class files with little effort. _ Rediscover Hotmail(r): Now available on your iPhone or BlackBerry http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover _Mobile1_042009
RE: How best to transform a XML file into a message.
> Date: Thu, 2 Apr 2009 08:37:01 -0700 > Subject: Re: How best to transform a XML file into a message. > From: > To: axis-c-user@ws.apache.org > > Sam, > > IMHO, it isn't worth doing web services unless you use the autogenerated > code. I learned from experience to stop hand jamming xml. If your WSDL > changes, you want to re-autogenerate the plumbing code on both your client > and server side ... and with any luck, any code changes you have are isolated > in the code you had to write in order to use the objects generated on your > client side. > > I spent a lot of time with the C generated code and never did get it to work well I so went back to java axis and everything pretty much worked right away. But, the reason for mentioning this now, is that I have subsequently found that our service provider often updates the WSDL file. This turns out to be fine in java since I can diff the wsdl files, re generate the class files unless there is something gross that has been changed, and then almost all of my reflection-invoked code still runs: I can archive, upload, and download things in a complete and consistent manner by just looking for public get/set methods. Is there some similar facility in the C- axis to reflection invokation? I guess if you put all that in a DLL/SO you can load the library of your choice. With java, if I really need to, I can point the class path to pick up either the current or prior WSDL class files with little effort. _ Rediscover HotmailĀ®: Now available on your iPhone or BlackBerry http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile1_042009
RE: How best to transform a XML file into a message.
Hi Sam. If you the format of the XML on the server is a different format from that expected via the web services then I would suggest the following: 1. Generate the service endpoint using the Axis2/C engine with no data binding - only using OMElements for the input/output. 2. Transform the XML into the correct data format using XSLT. I would highly suggest NOT doing this transformation by hand using generated C code. XSLT will be your easiest option though if you don't know it... 3. Finally, load the OMElement with the data and return. If the format of the XML is the same, you can simply skip steps #1 and #2 from the previous list. Really your problem isn't a SOAP/WS problem, it's a data transformation problem. You need to convert your data into the appropriate interface format. That's the real crux of your problem (it seems). Cheers. Alastair Fettes This e-mail and any attachments are intended solely for the use of the intended recipient(s) and may contain legally privileged, proprietary and/or confidential information. Any use, disclosure, dissemination, distribution or copying of this e-mail and any attachments for any purposes that have not been specifically authorized by the sender is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by reply e-mail and permanently delete all copies and attachments. The entire content of this e-mail is for "information purposes" only and should not be relied upon by the recipient in any way unless otherwise confirmed in writing by way of letter or facsimile. From: scarle...@gmail.com [mailto:scarle...@gmail.com] On Behalf Of Sam Carleton Sent: Thursday, April 02, 2009 4:45 AM To: Apache AXIS C User List Subject: Re: How best to transform a XML file into a message. Folks, I know this is a free forum thus folks are free to ignore questions. On the question below, the big question I have comes from my ignorance of the plumbing of Web Services. Any feedback, even feedback such as, "Sam go learn more about the SOAP envelope to find out your own confort level, fore this is something only you can answer." would be much appreciated. Sam P.S. I am starting to talk to WSO2 about some paid support, I am hoping to get some feedback on this sooner rather then later, though ;) On Wed, Apr 1, 2009 at 7:34 AM, Sam Carleton wrote: My first operation I need to implement with Axis2/C is sort of interesting... I have an XML file on the server that needs to be transformed and returned to the client. The question is how best to do this transformation? A: Do I use the code generated by WSDL2C and in the call to the operation populate the response using all the generated code and allowing the generated code to serialize it into the SOAP message? B: Do I write some XSLT (which I do know) to do the transformation in the services Invoke method? I like option B better, but I have a feeling there is some namespace and endpoint data that is magically done for me in option A. Myself being new to this whole thing, which would be faster for me to implement? I am thinking A, but would the learning experience of implementing B end up making my life a lot easier down the road? As I just posed, I have a lot more to learn about the whole WS-* stuff and to figure out where and/or if that will fit into my solution, would option B prevent me from using the other WS-* or do those things kick in before/after the services invoke? Sam
Re: How best to transform a XML file into a message.
Sam, IMHO, it isn't worth doing web services unless you use the autogenerated code. I learned from experience to stop hand jamming xml. If your WSDL changes, you want to re-autogenerate the plumbing code on both your client and server side ... and with any luck, any code changes you have are isolated in the code you had to write in order to use the objects generated on your client side. But, I did find your question hard to answer. I've been successful hand jamming xml (and doing xslt) and wrapping it in a SOAP env for old fashioned rpc wsdls. But with doc-literal, you should try to use the objects generated by axis. did this help? On Thu, Apr 2, 2009 at 4:44 AM, Sam Carleton wrote: > Folks, > > I know this is a free forum thus folks are free to ignore questions. On > the question below, the big question I have comes from my ignorance of the > plumbing of Web Services. Any feedback, even feedback such as, "Sam go > learn more about the SOAP envelope to find out your own confort level, fore > this is something only you can answer." would be much appreciated. > > Sam > > P.S. I am starting to talk to WSO2 about some paid support, I am hoping to > get some feedback on this sooner rather then later, though ;) > > On Wed, Apr 1, 2009 at 7:34 AM, Sam Carleton > wrote: > >> My first operation I need to implement with Axis2/C is sort of >> interesting... I have an XML file on the server that needs to be >> transformed and returned to the client. The question is how best to do this >> transformation? >> >> A: Do I use the code generated by WSDL2C and in the call to the operation >> populate the response using all the generated code and allowing the >> generated code to serialize it into the SOAP message? >> >> B: Do I write some XSLT (which I do know) to do the transformation in the >> services Invoke method? >> >> I like option B better, but I have a feeling there is some namespace and >> endpoint data that is magically done for me in option A. Myself being new >> to this whole thing, which would be faster for me to implement? I am >> thinking A, but would the learning experience of implementing B end up >> making my life a lot easier down the road? As I just posed, I have a lot >> more to learn about the whole WS-* stuff and to figure out where and/or if >> that will fit into my solution, would option B prevent me from using the >> other WS-* or do those things kick in before/after the services invoke? >> >> Sam >> > >
Re: How best to transform a XML file into a message.
Folks, I know this is a free forum thus folks are free to ignore questions. On the question below, the big question I have comes from my ignorance of the plumbing of Web Services. Any feedback, even feedback such as, "Sam go learn more about the SOAP envelope to find out your own confort level, fore this is something only you can answer." would be much appreciated. Sam P.S. I am starting to talk to WSO2 about some paid support, I am hoping to get some feedback on this sooner rather then later, though ;) On Wed, Apr 1, 2009 at 7:34 AM, Sam Carleton wrote: > My first operation I need to implement with Axis2/C is sort of > interesting... I have an XML file on the server that needs to be > transformed and returned to the client. The question is how best to do this > transformation? > > A: Do I use the code generated by WSDL2C and in the call to the operation > populate the response using all the generated code and allowing the > generated code to serialize it into the SOAP message? > > B: Do I write some XSLT (which I do know) to do the transformation in the > services Invoke method? > > I like option B better, but I have a feeling there is some namespace and > endpoint data that is magically done for me in option A. Myself being new > to this whole thing, which would be faster for me to implement? I am > thinking A, but would the learning experience of implementing B end up > making my life a lot easier down the road? As I just posed, I have a lot > more to learn about the whole WS-* stuff and to figure out where and/or if > that will fit into my solution, would option B prevent me from using the > other WS-* or do those things kick in before/after the services invoke? > > Sam >