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). <-- 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
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 If you are using simple frontend, you should use sth like For client side, if you are using jax-ws frontend, you should use sth like http://localhost:9002/jaxwsAndAegis"/> If you are uisng simple frontend, you should use sth like http://localhost:9002/service"/> 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 >
Re: Aegis Data Binding w/Spring
Nevermind - I see that it uses the "address" as the reference. Being new to the library I didn't realize that jaxws:server worked similarly to jaxws:endpoint. Still trying to grasp all of the concepts - thanks! Regards, Kaleb |> | From: | |> >----------| |Kaleb Walton/Southfield/[EMAIL PROTECTED] | >--| |> | To:| |> >--| |cxf-user@incubator.apache.org | >--| |> | Date: | |> >--| |08/22/2007 08:47 AM | >--| |> | Subject: | |> >--| |Re: Aegis Data Binding w/Spring | >--| Thank you for the detailed response! How does that translate to a servlet based transport mechanism? Regards, Kaleb Inactive hide details for Freeman Fang ---08/21/2007 11:31:38 PM---Hi Kaleb,Freeman Fang ---08/21/2007 11:31:38 PM---Hi 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 If you are using simple frontend, you should use sth like For client side, if you are using jax-ws frontend, you should use sth like http://localhost:9002/jaxwsAndAegis"/> If you are uisng simple frontend, you should use sth like http://localhost:9002/service"/> 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 >
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 JSON with minimal additional configuration. I looked at the instructions on the wiki but they only show the programmatic way and I'd prefer to use Spring. The pertinent parts of my current configuration are as follows: It'd be great to be able to create another service that outputs JSON with only a few extra lines of configuration. Please excuse me if this seems a simple problem, I admit I'm having trouble figuring out the correlation between the Spring server config and the programmatic ServerFactoryBean. Regards, Kaleb
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: http://localhost:8080/services/Person"/> 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: http://apache.org/cxf/binding/http";> javax.xml.stream.XMLInputFactory http://myserviceiface.example.org/"; value="myservice"/> http://myserviceimpl.example.org/"; value="myserviceimpl"/> javax.xml.stream.XMLOutputFactory http://myserviceiface.example.org/"; value="myservice"/> http://myserviceimpl.example.org/"; value="myserviceimpl"/> 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 JSON with minimal additional configuration. I looked at the instructions on the wiki but they only show the programmatic way and I'd prefer to use Spring. The pertinent parts of my current configuration are as follows: It'd be great to be able to create another service that outputs JSON with only a few extra lines of configuration. Please excuse me if this seems a simple
Re: Passing method parameters using PHP SoapClient failing
Whew - figured out that I needed to pass an associative array as arguments. The call I needed to make was: $client->testString(array("arg0"=>"test")); Hope that helps someone else trying to figure out how to consume these webservices via PHP (NuSOAP, SoapClient, Pear SOAP, etc.). Regards, Kaleb Walton |> | From: | |> >------| |Kaleb Walton/Southfield/[EMAIL PROTECTED] | >--| |> | To:| |> >--| |cxf-user@incubator.apache.org | >--| |> | Date: | |> >--| |08/23/2007 08:56 AM | >--| |> | Subject: | |> >--| |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: http://localhost:8080/services/Person"/> 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: 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:| |> >--| | | >--| |> | 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: http://localhost:8080/services/Person"/> 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
How to define which properties to expose per class using simple server
I don't want to expose all of the properties of my Person object through web services. Is there a way to define the exposed properties via Spring using the simple server? My server has the following config: My hypothetical Person object contains an id, name, address and password. Let's say that I'd like to expose the "id", "name" and "address" properties of the Person but not the "password" - is there an easy way to define that through Spring configuration? I'm assuming I could make the property transient but I may not want to do that for internal serializations. Regards, Kaleb
Re: How to define which properties to expose per class using simple server
Does the Simple Server default to using Aegis bindings? I created Person.aegis.xml in a.b.c.entity package (a.b.c.entity.Person is my bean) which contains: My service still outputs the 'password' field. Do I need to use something other than Simple Server? Regards, Kaleb |> | From: | |> >--| |"Dan Diephouse" <[EMAIL PROTECTED]> | >--| |> | To:| |> >--| |cxf-user@incubator.apache.org | >--| |> | Date: | |> >--| |08/27/2007 01:41 PM | >--| |> | Subject: | |> >--| |Re: How to define which properties to expose per class using simple server | >--| Probably the easiest way is to add an @IgnoreProperty annotation to the property. Or you can supply an XML mapping file for your bean as well. mapping files are named after your bean - so something along the lines of MyBean.aegis.xml if your bean is named MyBean. They reside on the classpath in the same package as your bean. Another option is to read the email I just wrote to Tog. He had pretty much the exact same question, but he was looking for a programmatic way to do it. (BTW, Tog (aka Guillaume) is working on the Groovy web services stuff. If you're trying to ignore the properties on the base groovy class, hopefully he'll roll this into the Groovy WS source code so you don't have to have it in your own. If you have no idea what I'm talking about here... nevermind :-) ). - Dan On 8/27/07, Kaleb Walton <[EMAIL PROTECTED]> wrote: > > > > I don't want to expose all of the properties of my Person object through > web services. Is there a way to define the exposed properties via Spring > using the simple server? > > My server has the following config: > > script-source="classpath:a/b/c/services/PersonServiceImpl.groovy" > refresh-check-delay="3000"/> > serviceClass="a.b.c.services.PersonService" > serviceBean="#personServiceImpl" address="/Person"/> > > My hypothetical Person object contains an id, name, address and password. > > Let's say that I'd like to expose the "id", "name" and "address" > properties > of the Person but not the "password" - is there an easy way to define that > through Spring configuration? I'm assuming I could make the property > transient but I may not want to do that for internal serializations. > > Regards, > Kaleb -- Dan Diephouse Envoi Solutions http://envoisolutions.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
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
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: I'm throwing ServiceExceptions on each method in MyService: class MyService { public ServiceResult find(ServiceArg arg) throws ServiceException { // do stuff } } Regards, Kaleb
Re: Specifying an exception as a WebFault using Simple Server (simple:server)
Ok got a bit further - this was in the debug logs: org.apache.cxf.interceptor.Fault: Marshalling Error: a.b.c.ServiceException is not known to this context At least that takes me one step further - if anyone has a quick answer I'd appreciate it. I'll post my solution when it's found. Regards, Kaleb |> | From: | |> >----------| |Kaleb Walton/Southfield/[EMAIL PROTECTED] | >--| |> | To:| |> >--| |cxf-user@incubator.apache.org | >--| |> | Date: | |> >--| |09/18/2007 03:24 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: 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
Re: HashMap as parameter for web service call
Great, at least there's some light at the end of the tunnel! Where would I plug it into a spring configuration - I'm using 's? Thanks! Regards, Kaleb From: James Mao <[EMAIL PROTECTED]> To: cxf-user@incubator.apache.org Date: 09/18/2007 11:23 PM Subject:Re: HashMap as parameter for web service call Jaxb is quite plugable, you can use XmlTypeAdapter to marshal/unarshal to/from HashMap James > HashMap is not supported by JAXB binding. More discussions about this can be found from http://www.nabble.com/DataBinding-problems-%28Timestamp-and-HashMap%29-using-JAXB-tf4283645.html#a12193877 > > Cheers, > Jervis > > >> -----Original Message- >> From: Kaleb Walton [mailto:[EMAIL PROTECTED] >> Sent: 2007?9?19? 5:59 >> To: cxf-user@incubator.apache.org >> Subject: 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 >> >> > > > IONA Technologies PLC (registered in Ireland) > Registered Number: 171387 > Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland > >
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: I'm throwing ServiceExceptions on each method in MyService: class MyService { public ServiceResult find(ServiceArg arg) throws ServiceException { // do stuff } } 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 a SOAP-ENC / encoding type using simple server
A consumer of mine is asking me to specify something like this: 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 List, we just create: 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: and a "FooList" class would be created to hold the List. -- 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 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
Re: Responses don't get xml tag and encoding type
Excellent, that's a route I can investigate. Quick question - what is the default encoding for the simple server? UTF-8? Thanks again for being so responsive! Regards, Kaleb |> | From: | |> >--| |Daniel Kulp <[EMAIL PROTECTED]> | >--| |> | To:| |> >--| |cxf-user@incubator.apache.org | >--| |> | Cc:| |> >----------| |Kaleb Walton/Southfield/[EMAIL PROTECTED] | >--| |> | Date: | |> >--| |10/03/2007 10:39 AM | >--| |> | Subject: | |> >--| |Re: Responses don't get xml tag and encoding type | >----------| On Wednesday 03 October 2007, Kaleb Walton wrote: > To add on to my previous question regarding SOAP encoding types, I > realized that what I'm really looking for is simply the 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 OK. That's different. We don't output that as it's redundant with the information in the HTTP Content-Type header.It would basically just be wasted bandwidth. If it's REQUIRED, you could write an interceptor that would insert it. You would put it in the PRE_STREAM phase with a setAfter(StaxOutInterceptor.class.getName()); It would have something like: public void handleMessage(Message message) { OutputStream os = message.getContent(OutputStream.class); XMLStreamWriter writer = message.getContent(XMLStreamWriter.class); String encoding = (String)message.get(Message.ENCODING); writer.writeStartDocument(encoding, "1.0"); } -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: CXF+ACEGI
I'm yet another person very interested in securing my services using Acegi as we will be using it as our primary method of authentication over all of our service transport mechanisms (RMI, HTTP, etc.). If someone has a soup-to-nuts example implementation that would be great to see! Regards, Kaleb From: "Ray Krueger" <[EMAIL PROTECTED]> To: cxf-user@incubator.apache.org Date: 09/21/2007 04:51 PM Subject:Re: CXF+ACEGI Yeah, that looks great. If you want to do authentication at the ws-security layer I'd do it in the fashion described there and by dkulp a few posts back... On 9/21/07, mattmadhavan <[EMAIL PROTECTED]> wrote: > > Sorry everybody! I was out for couple of days and I had forgotten to add the > link! > > http://www.vorburger.ch/blog1/2006/10/propagating-acegis-security-context-in.html > > Thanks > Matt > > > > Willem2 wrote: > > > > Hi Matt > > > > I did not see any url in your mail below :(. > > Could you send them again ? > > > > Willem. > > mattmadhavan wrote: > >> Hello All, > >> Please refer to this blog. Seems to be one of the most popular blog. > >> Please > >> look at the client code! (Test case). > >> > >> Any ideas? If some one has a complete ACEGI security solution and posts > >> it > >> it will be Awesome! Ray do you mind posting a complete sample. It will be > >> greatly beneficial to everybody. > >> > >> Matt > >> > >> > >> dkulp wrote: > >> > >>> Ray, > >>> > >>> On Monday 17 September 2007, Ray Krueger wrote: > >>> > The authorization and authentication concerns are addressed at the > protocol layer first, and can then be extended into lower levels of > the application via AOP and such. So, if you're interested in securing > your application at that level, then CXF doesn't even really enter > into the discussion. Meaning that you're going to put the Acegi filter > out there, and configure it to protect whatever URLs your CXF services > are published on. Acegi wouldn't know anything about CXF in that case. > > >>> This currently works fine if you use the CXFServlet approach and deploy > >>> your application as a war into some sort of Servlet container. > >>> > >>> However, if you do a J2SE standalone mode application, this is quite > >>> hard > >>> to do right now and is something we should make a bit easier. > >>> Currently, you would need to grab the raw Jetty listeners, use the Jetty > >>> API's to add the filters, etc (Note: this also applies if you want > >>> to secure your decoupled destination for a ws-rm/ws-a interaction) > >>> > >>> We probably should allow filters to be added via the spring > >>> configuration > >>> for the destination. That would simplify things quite a bit. > >>> > >>> > From there you can decide in your endpoints how you consider the > 'Principal'. You could retrieve it from Acegi without it being part of > WS-Security and keep it loose that way. Or you could find some means > of integrating Acegi into a WS-Security provider for CXF somehow. > > >>> This was the interceptor I mentioned before. An interceptor after the > >>> WS-Sec interceptors would have access to the stuff decoded from the > >>> message. The interceptor could create the principal object and pass > >>> that into Acegi. > >>> > >>> Dan > >>> > >>> > >>> > The application I am building will support both plain xml over http > and soap over http. So in that case it makes sense for me to place > security at the http layer, and avoid relying on something like > WS-Security. > > On 9/17/07, Daniel Kulp <[EMAIL PROTECTED]> wrote: > > > Interesting you should ask this.I first heard about ACEGI > > last week in a different conversation and have just started to look > > into it a bit. I'd LOVE to have your
RE: CXF + ACEGI security - full example
Thank you for the example! |> | From: | |> >--| |"Anne Racel" <[EMAIL PROTECTED]> | >--| |> | To:| |> >--| | | >--| |> | Date: | |> >--| |10/07/2007 08:54 AM | >--| |> | Subject: | |> >--| |RE: CXF + ACEGI security - full example | >--| Oops! - this should be: "your class that implements CallbackHandler" Anne Racel Senior Software Engineer Cormine Intelligent Data
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: a.b.c.services.ServiceException 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) 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
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. >jav
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:| |> >--| | | >--| |> | 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,
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 ServiceListResult { private List 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: Help! Aegis not mapping Java.Util.Collection properly
After reviewing this thread it seems like this problem is similar to the one I just submitted titled 'Aegis databinding and Java 5 Generic List creating extra "anyType" field'. Looking forward to trying out the next snapshot! Regards, Kaleb |> | From: | |> >--| |Daniel Kulp <[EMAIL PROTECTED]> | >--| |> | To:| |> >--| |cxf-user@incubator.apache.org | >--| |> | Cc:| |> >--| |"Vespa, Anthony J" <[EMAIL PROTECTED]> | >--| |> | Date: | |> >--| |11/05/2007 06:28 PM | >--| |> | Subject: | |> >--| |Re: Help! Aegis not mapping Java.Util.Collection properly | >--| On Monday 05 November 2007, Vespa, Anthony J wrote: > Thank you so much! > > So to clarify a couple things (apologies if this is redundant I just > want to make sure I understand) > > -Once this issue is fixed, will the any-type resolve to being the > actual types on my collection, or will it still be any type and this > just fixes the breakage in the SoapUI tool? This just fixes the breakage in SoapUI tool. It will still be anyType in the wsdl. > -Will this then be going into 2.0.3, and if so, when will 2.0.3 be > fully released as a finished item? I didn't see any dates for it in > my inspection of the docs and sites. It will be in 2.0.3. I was GOING to build the 2.0.3 builds this afternoon, but you and David Sica side tracked me on fixing a couple issues before I did the build. Thus, it's likely to be later tonight or tomorrow morning. Dan > > Thanks again!! > > -Tony > > > > From: Daniel Kulp [mailto:[EMAIL PROTECTED] > Sent: Mon 11/5/2007 4:56 PM > To: cxf-user@incubator.apache.org > Cc: Vespa, Anthony J > Subject: Re: Help! Aegis not mapping Java.Util.Collection properly > > On Monday 05 November 2007, Vespa, Anthony J wrote: > > Okie, so what is the next step? Do I need to log a bug for this? > > I'm not really 100% on why the mapping is broken. > > I have it fixed. :-) Running the test suite now. > > There were two issues: > 1) We were generating the "ArrayOfAnyType" into the > http://www.w3.org/2001/XMLSchema namespace which is really wrong as > thats a standard namespace that we shouldn't be generating anything > into. > > 2) Because that namespace is a standard one, we don't create an > element for it.Thus, the SOAPui parser/validator > cannot find it. Fixing (1) actually fixes this. > > > Dan > > > -T > > > > -Original Message- > > From: Daniel Kulp [mailto:[EMAIL PROTECTED] > > Sent: Monday, November 05, 2007 4:32 PM > > To: cxf-user@incubator.apache.org > > Cc: Vespa, Anthony J > > Subject: Re: Help! Aegis not mapping Java.Util.Collection properly > > > > > > I'm not an aegis expert at all, but I believe the "claim" is that > > the generics work on the Collections, but not on other classes. > > Thus, List will map to int
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:| |> >--| | | >--| |> | 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 ServiceListResult { > private List 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
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:| > |> > | > >--- > >--- > >| > > > | > | > || > | > >--- > >--- > >| > | > |> > | Date: | > |> > | > >--- > >--- > >| > > > |11/06/2007 11:49 AM > | > || > | > >--- > >--- > >| > | > |> > | 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 From: "Benson Margulies" <[EMAIL PROTECTED]> To: 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: 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? S
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:| |> >--| | | >--| |> | 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 want"Benson 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: Date: 11/06/2007 08:58 AM Subject: RE: Aegis databinding and Java 5 Generic List creating extra "anyType
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 Spring tags such as ? 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 Aegis"Benson 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: 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: 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] &l
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 d"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: 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..
Re: Specifying minOccurs for primitive properties with Simple Server
I will work on this and let you know what I come up with. |> | From: | |> >--| |Daniel Kulp <[EMAIL PROTECTED]> | >--| |> | To:| |> >--| |cxf-user@incubator.apache.org | >--| |> | Cc:| |> >------| |Kaleb Walton/Southfield/[EMAIL PROTECTED] | >--| |> | Date: | |> >--| |11/07/2007 02:20 PM | >--| |> | Subject: | |> >--| |Re: Specifying minOccurs for primitive properties with Simple Server | >--| Hmm not right now, but it wouldn't be too hard. Basically, if we add a "Map ctxProperties" property to the JAXBDataBinding that could be configured from spring, that would allow it. The map created on line 310 of JAXBDataBinding would then be created as a copy of that map. There's a bunch of keys on the JAXBRIContext that could be set/controlled that way. The ANNOTATION_READER is one of them. You want to test it out? Patches are welcome. :-) Dan On Wednesday 07 November 2007, Kaleb Walton wrote: > 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.h >tml > > 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 Spring tags such as ? > > 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 Aegis"Benson > 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: > > > Date: 11/07/2007 01:06 PM > > > Subject:RE: Specifying minOccurs for primitive properties &
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
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 tag below does not include the ns1: prefix as the rest of the tags do. If I add the ns1: prefix to (to make it ) 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? 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";> http://services.iss.net/v1"; SOAP-ENC:root="1"> startTime.ASC 2006-11-26T11:56:11Z 2007-11-26T11:56:11Z true 0 100 CID001696 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:| |> >--| | | >--| |> | 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 tag below does > not include the ns1: prefix as the rest of the tags do. If I > add the ns1: prefix to (to make it > ) 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? > > > 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";> > > http://services.iss.net/v1"; > SOAP-ENC:root="1"> xsi:type="xsd:string">startTime.ASC > xsi:type="xsd3:dateTime">2006-11-26T11:56:11Z > xsi:type="xsd3:dateTime">2007-11-26T11:56:11Z > true > 0 xsi:type="xsd:int">100 > CID001696 > > > > > > 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:| |> >--| | | >--| |> | 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 >
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: Example of JAXB and HashMap serialization?
naïve (all maps are Map) 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 > >