Re: Example of JAXB and HashMap serialization?
naïve (all maps are MapString,String) solution to your problem. So where does that leave us? JAXBIntros supports all these annotations except @XmlJavaTypeAdapter. But adding support for it would be fairly trivial, and if you are happy with the overall picture of what I describe above, then I'll happily add support for @XmlJavaTypeAdapter to JAXBIntros and ask the JBoss guys to commit it. Then you'd be able to get the above scenario working even if you did not have the source to the M class. - Chris Kaleb Walton wrote: Glen, Thanks for the response. It is a JAXB specific question and yes I did google for both of those but they turn up pages related to an XmlAdapter which doesn't seem like the right solution. In addition we don't use annotations (we use the InlineAnnotationsReader from JBoss) so I'm not sure how I'd configure the XmlAdapter anyways. I was looking for a simpler solution if one was available - just feeling out the CXF group to see if anyone else has solved this with JAXB+CXF. Regards, Kaleb | | From: | | --| |Glen Mazza [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |11/28/2007 11:28 PM | --| | | Subject: | | --| |Re: Example of JAXB and HashMap serialization? | --| Are you sure this is a CXF/JAXB-specific question instead of a more generic JAXB question? (CXF's JAXB is the same as GlassFish Metro's, for example.) Does googling JAXB and HashMap get you anything useful? Glen Am Mittwoch, den 28.11.2007, 10:13 -0500 schrieb Kaleb Walton: I'm writing documentation for how to write services and got to a point where I have to say Do not use HashMap's in any of your services as CXF + JAXB does not support serializing HashMaps. I'd rather not have to say that - are there any examples out there of how to get HashMaps to serialize using CXF + JAXB? I've seen the XmlAdapter stuff out there but that doesn't suit my needs for two reasons: 1) We don't use annotations 2) We want to use HashMaps, not pseudo-maps I may be misunderstanding the solutions pointed out in the articles, if so please help me see the light! Regards, Kaleb
Re: Example of JAXB and HashMap serialization?
Glen, Thanks for the response. It is a JAXB specific question and yes I did google for both of those but they turn up pages related to an XmlAdapter which doesn't seem like the right solution. In addition we don't use annotations (we use the InlineAnnotationsReader from JBoss) so I'm not sure how I'd configure the XmlAdapter anyways. I was looking for a simpler solution if one was available - just feeling out the CXF group to see if anyone else has solved this with JAXB+CXF. Regards, Kaleb | | From: | | --| |Glen Mazza [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |11/28/2007 11:28 PM | --| | | Subject: | | --| |Re: Example of JAXB and HashMap serialization? | --| Are you sure this is a CXF/JAXB-specific question instead of a more generic JAXB question? (CXF's JAXB is the same as GlassFish Metro's, for example.) Does googling JAXB and HashMap get you anything useful? Glen Am Mittwoch, den 28.11.2007, 10:13 -0500 schrieb Kaleb Walton: I'm writing documentation for how to write services and got to a point where I have to say Do not use HashMap's in any of your services as CXF + JAXB does not support serializing HashMaps. I'd rather not have to say that - are there any examples out there of how to get HashMaps to serialize using CXF + JAXB? I've seen the XmlAdapter stuff out there but that doesn't suit my needs for two reasons: 1) We don't use annotations 2) We want to use HashMaps, not pseudo-maps I may be misunderstanding the solutions pointed out in the articles, if so please help me see the light! Regards, Kaleb
RE: Missing namespace prefix on arg0 ?
Yes, code first and yes I do see elementFormDefault=unqualified in the WSDL. Is that the reason? If so, how might I get rid of that? Regards, Kaleb | | From: | | --| |Benson Margulies [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |11/26/2007 04:22 PM | --| | | Subject: | | --| |RE: Missing namespace prefix on arg0 ? | --| Look at the schema for elementFormDefault and/or specific form= modifiers. Code first? RPC or Doc? -Original Message- From: Kaleb Walton [mailto:[EMAIL PROTECTED] Sent: Monday, November 26, 2007 2:11 PM To: cxf-user@incubator.apache.org Subject: Missing namespace prefix on arg0 ? This may be due to my lack of expertise with XML / WSDLs in general but I am confused as to why the arg0 tag below does not include the ns1: prefix as the rest of the tags do. If I add the ns1: prefix to arg0 (to make it ns1:arg0) CXF does not digest the request properly. Is there any way to apply a namespace to the arg tag or should I not be concerned with it? ?xml version=1.0 encoding=UTF-8? SOAP-ENV:Envelope SOAP-ENV:encodingStyle= http://schemas.xmlsoap.org/soap/encoding/; xmlns:SOAP-ENC= http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsi= http://www.w3.org/1999/XMLSchema-instance; xmlns:SOAP-ENV= http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd3= http://www.w3.org/2001/XMLSchema; xmlns:xsd= http://www.w3.org/1999/XMLSchema; SOAP-ENV:Body ns1:findAll xmlns:ns1=http://services.iss.net/v1; SOAP-ENC:root=1 arg0 ns1:sort xsi:type=xsd:stringstartTime.ASC/ns1:sort ns1:startDate xsi:type=xsd3:dateTime2006-11-26T11:56:11Z/ns1:startDate ns1:endDate xsi:type=xsd3:dateTime2007-11-26T11:56:11Z/ns1:endDate ns1:populate xsi:type=xsd:stringtrue/ns1:populate ns1:start xsi:type=xsd:int0/ns1:start ns1:limit xsi:type=xsd:int100/ns1:limit ns1:customerId xsi:type=xsd:stringCID001696/ns1:customerId /arg0 /ns1:findAll /SOAP-ENV:Body /SOAP-ENV:Envelope Regards, Kaleb
Example of JAXB and HashMap serialization?
I'm writing documentation for how to write services and got to a point where I have to say Do not use HashMap's in any of your services as CXF + JAXB does not support serializing HashMaps. I'd rather not have to say that - are there any examples out there of how to get HashMaps to serialize using CXF + JAXB? I've seen the XmlAdapter stuff out there but that doesn't suit my needs for two reasons: 1) We don't use annotations 2) We want to use HashMaps, not pseudo-maps I may be misunderstanding the solutions pointed out in the articles, if so please help me see the light! Regards, Kaleb
RE: Example of JAXB and HashMap serialization?
Great, thank you for the clarification - I hope 'supposedly' turns into 'definitely' ;-). We can hold out for the maturation of the trunk and some examples to bubble up before diving in. Regards, Kaleb | | From: | | --| |Benson Margulies [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |11/28/2007 12:55 PM | --| | | Subject: | | --| |RE: Example of JAXB and HashMap serialization? | --| It can't be done well with the JAXB we have in 2.0.x, I am told. Aegis does it nicely. The trunk uses new stuff in JAXB, which supposedly supports it, but I don't have any experience. -Original Message- From: Kaleb Walton [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 28, 2007 10:14 AM To: cxf-user@incubator.apache.org Subject: Example of JAXB and HashMap serialization? I'm writing documentation for how to write services and got to a point where I have to say Do not use HashMap's in any of your services as CXF + JAXB does not support serializing HashMaps. I'd rather not have to say that - are there any examples out there of how to get HashMaps to serialize using CXF + JAXB? I've seen the XmlAdapter stuff out there but that doesn't suit my needs for two reasons: 1) We don't use annotations 2) We want to use HashMaps, not pseudo-maps I may be misunderstanding the solutions pointed out in the articles, if so please help me see the light! Regards, Kaleb
Specifying namespaceUri / default namespace for simple server
Is there a way to specify the namespace that shows up in the WSDL root node using the simple:server? I see the default namespace is overridden in the JAXBDataBinding by a call to service.getName().getNamespaceURI() but I'm not sure where to fork this namespaceURI in my Spring config. Regards, Kaleb
Re: Aegis databinding and Java 5 Generic List creating extra anyType field
Thank you for laying it out plainly! I've found another reason why Aegis doesn't work for our circumstances so I'm going to go back to jaxb to see if theres something that will solve my minOccurs=1 on primitives issue :) Regards, Kaleb From: Daniel Kulp [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Cc: Kaleb Walton/Southfield/[EMAIL PROTECTED] Date: 11/07/2007 01:25 PM Subject:Re: Aegis databinding and Java 5 Generic List creating extra anyType field This is *quite* undesirable. Does anyone have any suggestions for a workaround? At this point, I think the only options are: 1) Switch to jaxb (which doesn't do this) 2) Start writing the code to do the flat stuff. Patches are more than welcome. :-) Dan On Wednesday 07 November 2007, Kaleb Walton wrote: Darn! I think that's it... I'm looking at the output of all of my arrays and they fork in this extra level which is given the name of the class of the object type stored in the array. Example: Note the extra 'ServiceFieldError' level that shouldn't be there and also note the 'fieldErrors' property that should actually be of type Array. [fieldErrors] = stdClass Object ( [ServiceFieldError] = Array ( [0] = stdClass Object ( [code] = errors.required [defaultMessage] = Field is required [field] = foo [rejectedValue] = Foo ) [1] = stdClass Object ( [code] = errors.required [defaultMessage] = Field is required [field] = bar [rejectedValue] = 1 ) ) ) This is *quite* undesirable. Does anyone have any suggestions for a workaround? Regards, Kaleb | | From: | | | --- --- | |Benson Margulies [EMAIL PROTECTED] | || | --- --- | | | | To:| | | --- --- | |cxf-user@incubator.apache.org | || | --- --- | | | | Date: | | | --- --- | |11/06/2007 11:49 AM | || | --- --- | | | | Subject: | | | --- --- | |RE: Aegis databinding and Java 5 Generic List creating extra | anyType field | | | --- --- | The 'flat' feature is an attribute in the mapping schema that was intended to control some cases of either adding an extra level of type/element or not. Apparently, it isn't this one. While the code to parse the attribute exists, the code to actually pay attention to it does
RE: Specifying minOccurs for primitive properties with Simple Server
Thanks for clarification - please excuse the lack of understanding on my part. If there is a way to specify JAXB configuration options via XML or some external configuration file to support such functionality I would be interested in trying that out. Do you have any suggested resources for me to follow? I'll do some digging on my own as well, thank you! Regards, Kaleb From: Benson Margulies [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Date: 11/07/2007 01:06 PM Subject:RE: Specifying minOccurs for primitive properties with Simple Server Um, the simple front end is using either JAXB or Aegis. If JAXB, I wonder if there is something in the JAXB outboard XML format that would help you with this? The problem here is that the thing you want to control is a property of the data binding, not the front end. From: Kaleb Walton [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 07, 2007 1:00 PM To: cxf-user@incubator.apache.org Cc: cxf-user@incubator.apache.org Subject: RE: Specifying minOccurs for primitive properties with Simple Server Since there are things about Aegis that I have found undesirable and the simple server is so easy to use, I've created a JIRA ticket requesting 'defaultMinOccurs' and 'defaultNillable' properties to be enabled in the simple server. Hopefully others will agree with this suggestion and it will be implemented soon! https://issues.apache.org/jira/browse/CXF-1184 Regards, Kaleb Inactive hide details for Kaleb Walton---11/05/2007 04:31:58 PM---Ok - I'll definitely research that a bit more. Thank you for Kaleb Walton---11/05/2007 04:31:58 PM---Ok - I'll definitely research that a bit more. Thank you for the tip! From: Kaleb Walton/Southfield/[EMAIL PROTECTED] To: cxf-user@incubator.apache.org Date: 11/05/2007 04:31 PM Subject: RE: Specifying minOccurs for primitive properties with Simple Server Ok - I'll definitely research that a bit more. Thank you for the tip! Regards, Kaleb Benson Margulies ---11/05/2007 04:16:37 PM---This is for what we invented Aegis, I think. You can do some of these From: Benson Margulies [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Cc: Daniel Kulp [EMAIL PROTECTED] Date: 11/05/2007 04:16 PM Subject: RE: Specifying minOccurs for primitive properties with Simple Server This is for what we invented Aegis, I think. You can do some of these things in XML files. From: Kaleb Walton [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Monday, November 05, 2007 4:13 PM To: cxf-user@incubator.apache.org Cc: Daniel Kulp Subject: Re: Specifying minOccurs for primitive properties with Simple Server Thanks for the suggestion. Right now since we use the Simple Server we have ZERO annotations in our Java classes and we want to keep it that way so that method will not work for us. If you can think of any other configuration option that I can specify in my Spring config, or if there's some file that I can create to include meta data about how to serialize the class please let me know as this is one of the last little things that's getting in our way :) Thanks again for all your consideration! Regards, Kaleb Inactive hide details for Daniel Kulp ---11/05/2007 03:56:32 PM---Hmm... Not really sure.Daniel Kulp ---11/05/2007 03:56:32 PM---Hmm... Not really sure. From: Daniel Kulp [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Cc: Kaleb Walton/Southfield/[EMAIL PROTECTED] Date: 11/05/2007 03:56 PM Subject: Re: Specifying minOccurs for primitive properties with Simple Server Hmm...Not really sure. I suppose you could try something like: public class MyArg { @XmlElement(type = Integer.class, required = false) int foo; public int getFoo() { // getter} public void setFoo(int foo) { // setter} } That might work. That said, the Java 5 autoboxing should work and allow the non-primitive forms to work.Even with public void setFoo(Integer foo), you should be able to call setFoo(12) or similar. Dan On Monday 05 November 2007, Kaleb Walton wrote: Pardon me if this has been answered already - couldn't find it anywhere in Nabble. Is there a way to specify minOccurs for primitive properties with the Simple Server? Since many of our consumers use dynamic languages that do not have default values for primitives I am forced
RE: Aegis databinding and Java 5 Generic List creating extra anyType field
Darn! I think that's it... I'm looking at the output of all of my arrays and they fork in this extra level which is given the name of the class of the object type stored in the array. Example: Note the extra 'ServiceFieldError' level that shouldn't be there and also note the 'fieldErrors' property that should actually be of type Array. [fieldErrors] = stdClass Object ( [ServiceFieldError] = Array ( [0] = stdClass Object ( [code] = errors.required [defaultMessage] = Field is required [field] = foo [rejectedValue] = Foo ) [1] = stdClass Object ( [code] = errors.required [defaultMessage] = Field is required [field] = bar [rejectedValue] = 1 ) ) ) This is *quite* undesirable. Does anyone have any suggestions for a workaround? Regards, Kaleb | | From: | | --| |Benson Margulies [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |11/06/2007 11:49 AM | --| | | Subject: | | --| |RE: Aegis databinding and Java 5 Generic List creating extra anyType field | --| The 'flat' feature is an attribute in the mapping schema that was intended to control some cases of either adding an extra level of type/element or not. Apparently, it isn't this one. While the code to parse the attribute exists, the code to actually pay attention to it does not. From: Kaleb Walton [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 06, 2007 11:27 AM To: cxf-user@incubator.apache.org Subject: RE: Aegis databinding and Java 5 Generic List creating extra anyType field Thanks for the reply. Unfortunately nillable is already set to false. What is the 'flat' feature? I can't imagine that I'm the only person having the problem. Do you know if there is a way to specify something in an aegis.xml config that tells the 'items' list to not add the 'anyType' property? Regards, Kaleb Inactive hide details for Benson Margulies ---11/06/2007 08:58:14 AM---If you set nillable to false it might do what you wantBenson Margulies ---11/06/2007 08:58:14 AM---If you set nillable to false it might do what you want. On the other From: Benson Margulies [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Date: 11/06/2007 08:58 AM Subject: RE: Aegis databinding and Java 5 Generic List creating extra anyType field If you set nillable to false it might do what you want. On the other hand, it might be that this is the never-implemented 'flat' feature of Aegis. -Original Message- From: Kaleb Walton
RE: Specifying minOccurs for primitive properties with Simple Server
To add a little bit of fuel to this fire - I found the following link related to JAXB 2.0 XML configuration for those of us who don't want to use annotations: http://jbossesb.blogspot.com/2007/07/introducing-jaxb-annotations-on.html Do we have access to the point of JAXBContext creation so we can set a RuntimeInlineAnnotationReader? Something that can be set through one of the simple: Spring tags such as simple:properties? Regards, Kaleb From: Kaleb Walton/Southfield/[EMAIL PROTECTED] To: cxf-user@incubator.apache.org Cc: cxf-user@incubator.apache.org Date: 11/07/2007 01:29 PM Subject:RE: Specifying minOccurs for primitive properties with Simple Server Thanks for clarification - please excuse the lack of understanding on my part. If there is a way to specify JAXB configuration options via XML or some external configuration file to support such functionality I would be interested in trying that out. Do you have any suggested resources for me to follow? I'll do some digging on my own as well, thank you! Regards, Kaleb Inactive hide details for Benson Margulies ---11/07/2007 01:06:37 PM---Um, the simple front end is using either JAXB or AegisBenson Margulies ---11/07/2007 01:06:37 PM---Um, the simple front end is using either JAXB or Aegis. If JAXB, I From: Benson Margulies [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Date: 11/07/2007 01:06 PM Subject:RE: Specifying minOccurs for primitive properties with Simple Server Um, the simple front end is using either JAXB or Aegis. If JAXB, I wonder if there is something in the JAXB outboard XML format that would help you with this? The problem here is that the thing you want to control is a property of the data binding, not the front end. From: Kaleb Walton [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 07, 2007 1:00 PM To: cxf-user@incubator.apache.org Cc: cxf-user@incubator.apache.org Subject: RE: Specifying minOccurs for primitive properties with Simple Server Since there are things about Aegis that I have found undesirable and the simple server is so easy to use, I've created a JIRA ticket requesting 'defaultMinOccurs' and 'defaultNillable' properties to be enabled in the simple server. Hopefully others will agree with this suggestion and it will be implemented soon! https://issues.apache.org/jira/browse/CXF-1184 Regards, Kaleb Inactive hide details for Kaleb Walton---11/05/2007 04:31:58 PM---Ok - I'll definitely research that a bit more. Thank you for Kaleb Walton---11/05/2007 04:31:58 PM---Ok - I'll definitely research that a bit more. Thank you for the tip! From: Kaleb Walton/Southfield/[EMAIL PROTECTED] To: cxf-user@incubator.apache.org Date: 11/05/2007 04:31 PM Subject: RE: Specifying minOccurs for primitive properties with Simple Server Ok - I'll definitely research that a bit more. Thank you for the tip! Regards, Kaleb Benson Margulies ---11/05/2007 04:16:37 PM---This is for what we invented Aegis, I think. You can do some of these From: Benson Margulies [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Cc: Daniel Kulp [EMAIL PROTECTED] Date: 11/05/2007 04:16 PM Subject: RE: Specifying minOccurs for primitive properties with Simple Server This is for what we invented Aegis, I think. You can do some of these things in XML files. From: Kaleb Walton [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Monday, November 05, 2007 4:13 PM To: cxf
RE: Specifying minOccurs for primitive properties with Simple Server
Since there are things about Aegis that I have found undesirable and the simple server is so easy to use, I've created a JIRA ticket requesting 'defaultMinOccurs' and 'defaultNillable' properties to be enabled in the simple server. Hopefully others will agree with this suggestion and it will be implemented soon! https://issues.apache.org/jira/browse/CXF-1184 Regards, Kaleb | | From: | | --| |Kaleb Walton/Southfield/[EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |11/05/2007 04:31 PM | --| | | Subject: | | --| |RE: Specifying minOccurs for primitive properties with Simple Server | --| Ok - I'll definitely research that a bit more. Thank you for the tip! Regards, Kaleb Inactive hide details for Benson Margulies ---11/05/2007 04:16:37 PM---This is for what we invented Aegis, I think. You can dBenson Margulies ---11/05/2007 04:16:37 PM---This is for what we invented Aegis, I think. You can do some of these From: Benson Margulies [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Cc: Daniel Kulp [EMAIL PROTECTED] Date: 11/05/2007 04:16 PM Subject:RE: Specifying minOccurs for primitive properties with Simple Server This is for what we invented Aegis, I think. You can do some of these things in XML files. From: Kaleb Walton [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 4:13 PM To: cxf-user@incubator.apache.org Cc: Daniel Kulp Subject: Re: Specifying minOccurs for primitive properties with Simple Server Thanks for the suggestion. Right now since we use the Simple Server we have ZERO annotations in our Java classes and we want to keep it that way so that method will not work for us. If you can think of any other configuration option that I can specify in my Spring config, or if there's some file that I can create to include meta data about how to serialize the class please let me know as this is one of the last little things that's getting in our way :) Thanks again for all your consideration! Regards, Kaleb Inactive hide details for Daniel Kulp ---11/05/2007 03:56:32 PM---Hmm... Not really sure.Daniel Kulp ---11/05/2007 03:56:32 PM---Hmm... Not really sure. From: Daniel Kulp [EMAIL PROTECTED] To: cxf-user
Aegis databinding and Java 5 Generic List creating extra anyType field
Thanks to Aegis databinding I can specify the minOccurs on my primitive fields so the WSDL contract doesn't force them to be required. However, Aegis has introduced something else that I'm not familiar with. It may be proper but I'm not familiar with it and it seems to add one more level of a property between a field name and it's value. I have an object defined as such: class ServiceListResultT { private ListT items; //getters/setters } T is a Java 5 generic class reference. When using the Simple Server default data binding my object looked like this when output from PHP: [items] = Array ( [0] = stdClass Object ( ... ) ) Now it looks like this: [items] = sdtClass Object ( [anyType] = Array ( [0] = stdClass Object ( ... ) ) ) Is there any way to make the output look like the Simple Server did or is this the proper output since I'm using generics? Regards, Kaleb
RE: Aegis databinding and Java 5 Generic List creating extra anyType field
Thanks for the reply. Unfortunately nillable is already set to false. What is the 'flat' feature? I can't imagine that I'm the only person having the problem. Do you know if there is a way to specify something in an aegis.xml config that tells the 'items' list to not add the 'anyType' property? Regards, Kaleb | | From: | | --| |Benson Margulies [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |11/06/2007 08:58 AM | --| | | Subject: | | --| |RE: Aegis databinding and Java 5 Generic List creating extra anyType field | --| If you set nillable to false it might do what you want. On the other hand, it might be that this is the never-implemented 'flat' feature of Aegis. -Original Message- From: Kaleb Walton [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 06, 2007 8:55 AM To: cxf-user@incubator.apache.org Subject: Aegis databinding and Java 5 Generic List creating extra anyType field Thanks to Aegis databinding I can specify the minOccurs on my primitive fields so the WSDL contract doesn't force them to be required. However, Aegis has introduced something else that I'm not familiar with. It may be proper but I'm not familiar with it and it seems to add one more level of a property between a field name and it's value. I have an object defined as such: class ServiceListResultT { private ListT items; //getters/setters } T is a Java 5 generic class reference. When using the Simple Server default data binding my object looked like this when output from PHP: [items] = Array ( [0] = stdClass Object ( ... ) ) Now it looks like this: [items] = sdtClass Object ( [anyType] = Array ( [0] = stdClass Object ( ... ) ) ) Is there any way to make the output look like the Simple Server did or is this the proper output since I'm using generics? Regards, Kaleb
Specifying minOccurs for primitive properties with Simple Server
Pardon me if this has been answered already - couldn't find it anywhere in Nabble. Is there a way to specify minOccurs for primitive properties with the Simple Server? Since many of our consumers use dynamic languages that do not have default values for primitives I am forced to use complex types for Integers, Longs, Boolean's, etc. for parameters that should be optional. This is a problem with many of our developers as they are used to using primitive ints, longs and booleans. Example: public class MyArg { Integer foo; public Integer getFoo() { // getter} public void setFoo(Integer foo) { // setter} } we would like it to be: public class MyArg { int foo; public int getFoo() { // getter} public void setFoo(int foo) { // setter} } Any options? Regards, Kaleb
Re: Specifying minOccurs for primitive properties with Simple Server
Thanks for the suggestion. Right now since we use the Simple Server we have ZERO annotations in our Java classes and we want to keep it that way so that method will not work for us. If you can think of any other configuration option that I can specify in my Spring config, or if there's some file that I can create to include meta data about how to serialize the class please let me know as this is one of the last little things that's getting in our way :) Thanks again for all your consideration! Regards, Kaleb | | From: | | --| |Daniel Kulp [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Cc:| | --| |Kaleb Walton/Southfield/[EMAIL PROTECTED] | --| | | Date: | | --| |11/05/2007 03:56 PM | --| | | Subject: | | --| |Re: Specifying minOccurs for primitive properties with Simple Server | --| Hmm...Not really sure. I suppose you could try something like: public class MyArg { @XmlElement(type = Integer.class, required = false) int foo; public int getFoo() { // getter} public void setFoo(int foo) { // setter} } That might work. That said, the Java 5 autoboxing should work and allow the non-primitive forms to work.Even with public void setFoo(Integer foo), you should be able to call setFoo(12) or similar. Dan On Monday 05 November 2007, Kaleb Walton wrote: Pardon me if this has been answered already - couldn't find it anywhere in Nabble. Is there a way to specify minOccurs for primitive properties with the Simple Server? Since many of our consumers use dynamic languages that do not have default values for primitives I am forced to use complex types for Integers, Longs, Boolean's, etc. for parameters that should be optional. This is a problem with many of our developers as they are used to using primitive ints, longs and booleans. Example: public class MyArg { Integer foo; public Integer getFoo() { // getter} public void setFoo(Integer foo) { // setter} } we would like it to be: public class MyArg { int foo; public int getFoo() { // getter} public void setFoo(int foo) { // setter} } Any options? Regards, Kaleb -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
RE: Specifying minOccurs for primitive properties with Simple Server
Ok - I'll definitely research that a bit more. Thank you for the tip! Regards, Kaleb | | From: | | --| |Benson Margulies [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Cc:| | --| |Daniel Kulp [EMAIL PROTECTED] | --| | | Date: | | --| |11/05/2007 04:16 PM | --| | | Subject: | | --| |RE: Specifying minOccurs for primitive properties with Simple Server | --| This is for what we invented Aegis, I think. You can do some of these things in XML files. From: Kaleb Walton [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 4:13 PM To: cxf-user@incubator.apache.org Cc: Daniel Kulp Subject: Re: Specifying minOccurs for primitive properties with Simple Server Thanks for the suggestion. Right now since we use the Simple Server we have ZERO annotations in our Java classes and we want to keep it that way so that method will not work for us. If you can think of any other configuration option that I can specify in my Spring config, or if there's some file that I can create to include meta data about how to serialize the class please let me know as this is one of the last little things that's getting in our way :) Thanks again for all your consideration! Regards, Kaleb Inactive hide details for Daniel Kulp ---11/05/2007 03:56:32 PM---Hmm... Not really sure.Daniel Kulp ---11/05/2007 03:56:32 PM---Hmm... Not really sure. From: Daniel Kulp [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Cc: Kaleb Walton/Southfield/[EMAIL PROTECTED] Date: 11/05/2007 03:56 PM Subject: Re: Specifying minOccurs for primitive properties with Simple Server Hmm...Not really sure. I suppose you could try something like: public class MyArg { @XmlElement(type = Integer.class, required = false) int foo; public int getFoo() { // getter} public void setFoo(int foo) { // setter} } That might work. That said, the Java 5 autoboxing should work and allow the non-primitive forms to work.Even with public void setFoo(Integer foo), you should be able to call setFoo(12) or similar. Dan On Monday 05 November 2007, Kaleb Walton wrote: Pardon me if this has been answered already - couldn't find it anywhere in Nabble. Is there a way to specify minOccurs for primitive properties with the Simple Server? Since many of our consumers use dynamic languages that do not have default values for primitives I am forced to use complex types for Integers, Longs, Boolean's, etc. for parameters that should be optional. This is a problem with many of our developers as they are used to using primitive ints, longs and booleans. Example: public class MyArg { Integer foo; public Integer getFoo() { // getter} public void setFoo(Integer foo) { // setter} } we
Custom Exceptions using Simple Server
I've been digging around trying to find a way to enable custom exceptions to be thrown using the Simple Server and am pretty stumped. I'm trying to enable ServiceExceptions to be thrown from one of my service interfaces but when I call it I get an exception such as: Caused by: javax.xml.bind.MarshalException - with linked exception: [javax.xml.bind.JAXBException: a.b.c.services.ServiceException is not known to this context] at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:295) at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:221) at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:91) at org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:192) at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:167) ... 44 more I tried adding a WebFaultOutInterceptor to my interceptor chain but this error occurs further up in the chain: INFO: Interceptor has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Threw exception at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:101) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:90) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:63) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56) at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:92) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:73) at org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:79) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:235) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:140) at org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:278) at org.apache.cxf.transport.servlet.CXFServlet.doPost(CXFServlet.java:256) ... I found http://issues.apache.org/jira/browse/CXF-340 which suggests that this error can be resolved for the JAX-WS web services but is there a way to do it with the simple server? The simple server is so nice in terms of configuration that I'd hate to have to switch over to JAX-WS - especially since we will have so many services! In addition, the simple server can keep our stuff completely annotation free. These services are not only going to be used for the web and having to include the libraries that accompany those annotations would be an annoyance to the rest of our development team. Please let me know if this is not enough information to provide suggestions.Thanks! Regards, Kaleb
Re: Custom Exceptions using Simple Server
Well, I found that I can do something like this: simple:server id=testServiceServer serviceClass=a.b.c.services.TestService serviceBean=#testService address=/Test simple:properties entry key=jaxb.additionalContextClasses bean class=a.b.c.services.ClassArrayFactoryBean property name=classNames list valuea.b.c.services.ServiceException/value /list /property /bean /entry /simple:properties simple:serviceBean bean class=a.b.c.services.TestServiceImpl/ /simple:serviceBean /simple:server Unfortunately now I get: Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions java.lang.StackTraceElement does not have a no-arg default constructor. this problem is related to the following location: at java.lang.StackTraceElement at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace() at java.lang.Throwable at java.lang.Exception at a.b.c.services.ServiceException Any way to get the simple server not to blow up if using custom exceptions in the service interfaces? Regards, Kaleb | | From: | | --| |Kaleb Walton/Southfield/[EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |11/02/2007 02:32 PM | --| | | Subject: | | --| |Custom Exceptions using Simple Server | --| I've been digging around trying to find a way to enable custom exceptions to be thrown using the Simple Server and am pretty stumped. I'm trying to enable ServiceExceptions to be thrown from one of my service interfaces but when I call it I get an exception such as: Caused by: javax.xml.bind.MarshalException - with linked exception: [javax.xml.bind.JAXBException: a.b.c.services.ServiceException is not known to this context] at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:295) at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:221) at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:91) at org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:192) at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:167) ... 44 more I tried adding a WebFaultOutInterceptor to my interceptor chain but this error occurs further up in the chain: INFO: Interceptor has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Threw exception at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:101) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:90) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:63) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56) at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:92
Re: Custom Exceptions using Simple Server
GREAT! It serializes my ServiceException nicely and without any extra configuration! I've been waiting quite some time for this. Previously all of my methods have had to throw a plain ol' Exception which is not very useful. Now I can throw a ServiceException that includes much more information for my consumers. So far this looks like a great solution. I'll let you know if I come across any snags :) Regards, Kaleb | | From: | | --| |Daniel Kulp [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Cc:| | --| |Kaleb Walton/Southfield/[EMAIL PROTECTED] | --| | | Date: | | --| |11/02/2007 03:30 PM | --| | | Subject: | | --| |Re: Custom Exceptions using Simple Server | --| Kaleb, Can you download the latest 2.0.3 SNAPSHOT (built this morning) and try that? I did a bunch of work on custom exceptions with JAXB yesterday that is in that build. http://people.apache.org/repo/m2-snapshot-repository/org/apache/cxf/apache-cxf/2.0.3-incubator-SNAPSHOT/ If that doesn't work, could you send me the exception class? Dan On Friday 02 November 2007, Kaleb Walton wrote: I've been digging around trying to find a way to enable custom exceptions to be thrown using the Simple Server and am pretty stumped. I'm trying to enable ServiceExceptions to be thrown from one of my service interfaces but when I call it I get an exception such as: Caused by: javax.xml.bind.MarshalException - with linked exception: [javax.xml.bind.JAXBException: a.b.c.services.ServiceException is not known to this context] at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:2 95) at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java :221) at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshall erImpl.java:91) at org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder. java:192) at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.jav a:167) ... 44 more I tried adding a WebFaultOutInterceptor to my interceptor chain but this error occurs further up in the chain: INFO: Interceptor has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Threw exception at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInv oker.java:101) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker. java:90) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker. java:63) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvo kerInterceptor.java:56) at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecut or.java:37) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(Ser viceInvokerInterceptor.java:92
RE: CXF + ACEGI security - full example
Thank you for the example! | | From: | | --| |Anne Racel [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |10/07/2007 08:54 AM | --| | | Subject: | | --| |RE: CXF + ACEGI security - full example | --| Oops! - this should be: your class that implements CallbackHandler entry key=passwordCallbackClass value=[your class that extends CallbackHandler/ Anne Racel Senior Software Engineer Cormine Intelligent Data
Specifying a SOAP-ENC / encoding type using simple server
A consumer of mine is asking me to specify something like this: SOAP-ENV:Envelope SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsi=http://www.w3.org/1999/XMLSchema-instance; xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/1999/XMLSchema; Is there any way to specify an encoding type like that using simple server? Regards, Kaleb
Re: Empty List's not being marshaled?
Thank you! Do you know why that is the case? Maybe because since it's empty they figured there shouldn't be any wasted space in the XML doc? It's a pain for my consumers to have to check for the existence of a variable before trying to parse it out - not the end of the world but it adds somewhat redundant code. Regards, Kaleb | | From: | | --| |Daniel Kulp [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Cc:| | --| |Kaleb Walton/Southfield/[EMAIL PROTECTED] | --| | | Date: | | --| |10/02/2007 05:55 PM | --| | | Subject: | | --| |Re: Empty List's not being marshaled? | --| On Tuesday 02 October 2007, Kaleb Walton wrote: I'm using the simple server configured via Spring. When an object contains an empty list (not null) my response does not return it as an empty list - it just excludes the property from the response. Is there any way to force it to include the property? I'd probably have to see both the schema and the soap message. Most likely, the answer is no without creating a holder bean to hold the list. For the most part, when we see something like ListString, we just create: element name=foo type=string maxOccurs=unbounded nillable=true/ In that case, if the list is empty (or even if the list is null), nothing representing the list will appear on the wire. That is how the JAXB spec calls for it to be done. If you want something always on the wire, the schema would have to be something like: element name=fooList complexType sequence element name=foo type=string maxOccurs=unbounded nillable=true/ /sequence complexType /element and a FooList class would be created to hold the ListString. -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Responses don't get xml tag and encoding type
To add on to my previous question regarding SOAP encoding types, I realized that what I'm really looking for is simply the ?xml version=1.0 encoding =UTF-8? or whatever encoding is used to be output along with the response XML. When I look at the response I do not see that line. I'm using the simple server. Regards, Kaleb
Empty List's not being marshaled?
I'm using the simple server configured via Spring. When an object contains an empty list (not null) my response does not return it as an empty list - it just excludes the property from the response. Is there any way to force it to include the property? Regards, Kaleb
Specifying an exception as a WebFault using Simple Server (simple:server)
Can anyone speak to this issue? I have not yet found a solution. Regards, Kaleb | | From: | | --| |Kaleb Walton/Southfield/IBM | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |09/18/2007 03:23 PM | --| | | Subject: | | --| |Specifying an exception as a WebFault using Simple Server (simple:server) | --| Exceptions that I throw are not rendered as Fault's to web service clients even after specifying WebFault annotations on the Exception class. I can see the ServiceException in the WSDL but the methods themselves are just ignoring the fact that I'm throwing exceptions. Can anyone point me in the right direction? I have an exception defined as follows: @WebFault(name=ServiceFault) public class ServiceException extends Exception { // Custom Exception Implementation } I'm using Spring to configure a simple:server: simple:server id=myServer serviceClass=a.b.c.MyService serviceBean=#myService address=/MyService/ I'm throwing ServiceExceptions on each method in MyService: class MyService { public ServiceResult find(ServiceArg arg) throws ServiceException { // do stuff } } Regards, Kaleb
Specifying an exception as a WebFault using Simple Server (simple:server)
Exceptions that I throw are not rendered as Fault's to web service clients even after specifying WebFault annotations on the Exception class. I can see the ServiceException in the WSDL but the methods themselves are just ignoring the fact that I'm throwing exceptions. Can anyone point me in the right direction? I have an exception defined as follows: @WebFault(name=ServiceFault) public class ServiceException extends Exception { // Custom Exception Implementation } I'm using Spring to configure a simple:server: simple:server id=myServer serviceClass=a.b.c.MyService serviceBean=#myService address=/MyService/ I'm throwing ServiceExceptions on each method in MyService: class MyService { public ServiceResult find(ServiceArg arg) throws ServiceException { // do stuff } } Regards, Kaleb
HashMap as parameter for web service call
I cannot seem to get a HashMap to work as a parameter when making a web service call via PHP. Has anyone else experienced this? I want to encapsulate my parameters in a more complex object that extends HashMap. Regards, Kaleb
Multiple CXFServlet's?
I'd like to have multiple CXFServlets in the same container with separate applicationContext.xml's. Is that possible? I'd like to be able to have: /services/* - public services /private-services/* - private, internally used services that require more authentication I don't want the public to know what internally used methods we allow. Regards, Kaleb
Re: Multiple CXFServlet's?
Dan, Thanks for the prompt response. It would be great if you could supply separate Spring config files to multiple CXFServlets (similarly to what you can do with Spring's DispatcherServlet) - where would I go to submit that suggestion? Regards, Kaleb | | From: | | --| |Dan Diephouse [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |08/31/2007 01:50 PM | --| | | Subject: | | --| |Re: Multiple CXFServlet's? | --| Kaleb Walton wrote: I'd like to have multiple CXFServlets in the same container with separate applicationContext.xml's. Is that possible? I'd like to be able to have: /services/* - public services /private-services/* - private, internally used services that require more authentication I don't want the public to know what internally used methods we allow. Regards, Kaleb I don't think thats possible. One option though is to register the servlet on /*. Then you can put private services on the /private-services/foo and public services on /services/bar - Dan -- Dan Diephouse MuleSource http://mulesource.com | http://netzooid.com/blog
Acegi Security with CXF
Does anyone have an example of authenticating with Acegi Security using a Simple Server? I'd like to pass the authentication token as easily and securely as possible - http://www.vorburger.ch/blog1/2006/10/propagating-acegis-security-context-in.html suggests passing it in the SOAP headers. There is an example at that URL as well but it is for XFire and I'm not sure how those concepts translate over to CXF; additionally the example they use points out its own inefficiency suggesting it should use a custom handler to read the contents of the SOAP message via StAX. Regards, Kaleb
Re: AW: Passing method parameters using PHP SoapClient failing
Holger, Thank you for the reply - as it turns out I was not passing an associative array in my method call. After reviewing the WSDL a bit more closely I discovered that my arguments had names such as arg0, arg1, etc. I found that the following works for me: $result = $client-testString(array(arg0=test)); The following does NOT work for me (although it would be nice if it did): $result = $client-testString(test); Again, thanks for the reply and I'll look into those other configuration options. Regards, Kaleb | | From: | | --| |Holger Stolzenberg [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |08/24/2007 04:48 AM | --| | | Subject: | | --| |AW: Passing method parameters using PHP SoapClient failing | --| The PHP call to your WS method seems to be false. You have to provide a associative array for the WS method params. Following code shows how we do it: // the wsdl URL of your service to test $serviceWsdl = 'http://127.0.0.1:8080/EEX_Shop_Backend/ws-api/CustomerService?wsdl'; // the parmeters to initialize the client with $serviceParams = array( 'trace' = 1, 'soap_version' = SOAP_1_1, 'style' = SOAP_DOCUMENT, 'use' = SOAP_LITERAL ); // create the SOAP client $client = new SoapClient( $serviceWsdl, $serviceParams ); // method call $res = $client-getCustomerById( array( 'auth' = passwd, 'customerId' = 2 ) ); var_dump( $res ); -Ursprüngliche Nachricht- Von: Kaleb Walton [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 23. August 2007 14:55 An: cxf-user@incubator.apache.org Betreff: Passing method parameters using PHP SoapClient failing As a requirement for our customers I'm trying to get SOAP communication going using PHPs SoapClient object. Calling methods with no parameters works fine (I get results) but when I pass in parameters I get a Fault occurred while processing error message returned which I assume is coming somewhere within the CXF framework. The PHP code is pretty simple: $client = new SoapClient('http://localhost:8080/services/Person?wsdl'); $client-testString('abc'); -- This line returns an error message of 'Fault occurred while processing' Service object: @WebService(endpointInterface = a.b.c.webservices.PersonService) public class PersonServiceImpl implements PersonService { public String testString(String id) { System.out.println(PersonServiceImpl: testString: +id); return id; } } Config: bean id=personServiceImpl class=a.b.c.webservices.PersonServiceImpl/ jaxws:endpoint id=personServer implementor=#personServiceImpl address=/Person / bean id=personService class=net.iss.mss.webservices.PersonService factory-bean=clientFactory factory-method=create / bean id=clientFactory class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean property name=serviceClass value=a.b.c.webservices.PersonService/ property name=address value=http://localhost:8080/services/Person/ /bean Also, it looks like CXF uses Java's Logging implementation, however, I cannot seem to get it to log anywhere. Does anyone have any quick pointers on how to get that going? Regards, Kaleb Walton
Re: JSON output
Thanks to both of you! | | From: | | --| |Dale Peakall [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |08/23/2007 03:57 AM | --| | | Subject: | | --| |Re: JSON output | --| The spring configuration will look something like this: jaxws:endpoint id=jsonWS implementor=#myService address=/json/MyService bindingUri=http://apache.org/cxf/binding/http; jaxws:properties entry key=Content-Type value=text/plain/ /jaxws:properties jaxws:serviceFactory bean class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=wrapped value=false/ !-- Wrapped services bugged: CXF-903 -- property name=properties map entry keyvaluejavax.xml.stream.XMLInputFactory/value/key bean class=org.codehaus.jettison.mapped.MappedXMLInputFactory constructor-arg map entry key= http://myserviceiface.example.org/; value=myservice/ entry key= http://myserviceimpl.example.org/; value=myserviceimpl/ /map /constructor-arg /bean /entry entry keyvaluejavax.xml.stream.XMLOutputFactory/value/key bean class=org.codehaus.jettison.mapped.MappedXMLOutputFactory constructor-arg map entry key= http://myserviceiface.example.org/; value=myservice/ entry key= http://myserviceimpl.example.org/; value=myserviceimpl/ /map /constructor-arg /bean /entry /map /property /bean /jaxws:serviceFactory /jaxws:endpoint Liu, Jervis wrote: Hi Kaleb, I am really not sure if it makes sense to convert SOAP message to JSON. But if the payload is Plain-old--XML(POX), it should be doable in CXF. At the moment, CXF HTTP binding can serve RESTful service in both POX and JSON payload. Details can be found from http://cwiki.apache.org/CXF20DOC/http-binding.html and samples\restful_http_binding. If this is what you are looking for, we can spend more time to figure what the spring configuration would look like for JSON. Cheers, Jervis -Original Message- From: Kaleb Walton [mailto:[EMAIL PROTECTED] Sent: 2007?8?22? 22:42 To: cxf-user@incubator.apache.org Subject: JSON output Is there an easy way to use JSON as the transport protocol when configuring a Service in Spring? I have a SOAP service working quite nicely but would like to expose the same service using
Re: Aegis Data Binding w/Spring
Thank you for the detailed response! How does that translate to a servlet based transport mechanism? Regards, Kaleb | | From: | | --| |Freeman Fang [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Date: | | --| |08/21/2007 11:31 PM | --| | | Subject: | | --| |Re: Aegis Data Binding w/Spring | --| Hi Kaleb, For server side, if you are using jax-ws frontend, you should use sth like jaxws:server address=/jaxwsAndAegis serviceClass=org.apache.cxf.authservice.AuthService jaxws:dataBinding bean class=org.apache.cxf.aegis.databinding.AegisDatabinding / /jaxws:dataBinding jaxws:serviceBean bean class=org.apache.cxf.authservice.AuthServiceImpl / /jaxws:serviceBean /jaxws:server If you are using simple frontend, you should use sth like simple:server address=/service serviceClass=org.apache.cxf.authservice.AuthService simple:dataBinding bean class=org.apache.cxf.aegis.databinding.AegisDatabinding / /simple:dataBinding simple:serviceBean bean class=org.apache.cxf.authservice.AuthServiceImpl / /simple:serviceBean /simple:server For client side, if you are using jax-ws frontend, you should use sth like bean id=aegisDatabinding class=org.apache.cxf.aegis.databinding.AegisDatabinding/ bean id=client class=org.apache.cxf.authservice.AuthService factory-bean=clientFactory factory-method=create/ bean id=clientFactory class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean property name=serviceClass value=org.apache.cxf.authservice.AuthService/ property name=address value=http://localhost:9002/jaxwsAndAegis/ property name=dataBinding ref=aegisDatabinding/ /bean If you are uisng simple frontend, you should use sth like bean id=aegisDatabinding class=org.apache.cxf.aegis.databinding.AegisDatabinding/ bean id=client class=org.apache.cxf.authservice.AuthService factory-bean=clientFactory factory-method=create/ bean id=clientFactory class=org.apache.cxf.frontend.ClientProxyFactoryBean property name=serviceClass value=org.apache.cxf.authservice.AuthService/ property name=address value=http://localhost:9002/service/ property name=dataBinding ref=aegisDatabinding/ /bean Best Regards Freeman Kaleb Walton wrote: Anyone have a sample Spring configuration that shows how to set up Aegis Data Binding for both server and client beans? I'm trying to get Scripted Beans to work as the Service Implementors and am concerned that the annotations are why they don't work with JAX. Thanks! Regards, Kaleb Walton
Spring Scripted Bean as Implementor
I'd like to implement my interfaces using Groovy-scripted Spring Beans but get errors when referring to the beans by id within the implementor attribute of my endpoint (configured via Spring). lang:groovy id=helloService script-source=classpath:a/b/c/webservices/HelloServiceImpl.groovy/ jaxws:endpoint id=hello implementor=#helloService address=/Hello / -- does not work HelloServiceImpl implements the HelloService interface. Any ideas? Regards, Kaleb Walton
Aegis Data Binding w/Spring
Anyone have a sample Spring configuration that shows how to set up Aegis Data Binding for both server and client beans? I'm trying to get Scripted Beans to work as the Service Implementors and am concerned that the annotations are why they don't work with JAX. Thanks! Regards, Kaleb Walton