Re: proper way to inject Context objects?

2012-04-06 Thread Jeff Wang
; > On 03/04/12 00:43, Jeff Wang wrote: >> >> I'm running CXF 2.5.2 with Spring 3.1.1 >> >> I declare my beans via >> >> @Service >> public class FooImpl implements IFooService { >> } >> >> inside FooImpl, @Autowired fields work j

proper way to inject Context objects?

2012-04-02 Thread Jeff Wang
I'm running CXF 2.5.2 with Spring 3.1.1 I declare my beans via @Service public class FooImpl implements IFooService { } inside FooImpl, @Autowired fields work just fine. However, @Context UriInfo gave me a IllegalArgumentException for trying to set a $Proxy to a UriInfo. I then added a to my

Re: Spring Java Configuration for CXF

2012-03-18 Thread Jeff Wang
I don't believe those exist at this point. I know that I've been moving to @Configuration as well. I currently still have 2 xmls, one for CXF, the other for Spring Security. Everything else has been moved to Java. Jeff On Fri, Mar 16, 2012 at 8:21 AM, jp4 wrote: > I've been able to slim down

Re: Unit testing JAX-RS services

2012-02-15 Thread Jeff Wang
Sorry, didn't see this message until just now... On Fri, Feb 3, 2012 at 9:42 AM, Sergey Beryozkin wrote: > On 03/02/12 03:02, Jeff Wang wrote: >> >> I'm having two difficulties with testing.  One practical, one theoretical. >> >> practical: >> If I have

Re: Multiple CXF instances + ServiceMix + Thirdparty Jar... help!

2012-02-15 Thread Jeff Wang
Based upon what I know of OSGI and CXF, I'd actually suggest (if possible) to do 1, and see if that works. In java, instances from a Class X belonging to ClassLoader A is not of the type (instanceof returns false) Class X belonging to ClassLoader B, even though the class bytes are exactly the same

Generic return types

2012-02-15 Thread Jeff Wang
Scenario: User "owns" contacts via an unidirectional @ManyToOne JPA mapping on Contact. Contact subclasses from a @MappedSuperclass called UserResource. What I would like to do: an Interface called ISubResourceService that has a CXF annotation of: public interface ISubResourceService {

Re: Unit testing JAX-RS services

2012-02-02 Thread Jeff Wang
I'm having two difficulties with testing. One practical, one theoretical. practical: If I have any @Context annotations, I can't actually call the service via a client proxy. I need to code the call separately (and manually.) theoretical: Using the same JSON compile unit on the service and the

Re: Issue uploading large attachment to JAX-RS service

2012-01-23 Thread Jeff Wang
If your service runs fine with a smaller file, and you are running into trouble with a particular file size, that means you are running into memory issues. The reason why you are experiencing a 2x expected run-time for that particular test is because of all the memory garbage collections that the V

Sub-resources and relative URIs

2011-12-28 Thread Jeff Wang
I have a resource and a sub resource... @Path(/user) @Service public UserServiceImpl { @Path("{userId}/contact") public IContactService getContactService(@PathParam("userId") Long userId); } @Service public ContactServiceImpl { @POST public Response addContact(Long userId, Contac

Re: Newbie Question: WARNING: No root resource matching request path / has been found.

2011-12-25 Thread Jeff Wang
instead of: try the CXF servlet is matching /*, and your url base is /cxftest (which is the name of your deployed war, I assume.) CXF can't find /myService/customer/1 because you have declared /customer/1 instead. Jeff On Fri, Dec 23, 2011 at 8:01 PM, cxfuser wrote: > Hello > > I'm trying

Re: Long vs long...

2011-12-10 Thread Jeff Wang
s/jax-rs-data-bindings.html#JAX-RSDataBindings-Jettison > > Sergey > > > On 09/12/11 17:42, Jeff Wang wrote: >> >> So you mean I should remove the writeXsiType false setting, and set up >> the xs namespace on the client-side? Or is there another namespace >> that I sh

Re: Long vs long...

2011-12-09 Thread Jeff Wang
08, Jeff Wang wrote: >> >> On Fri, Dec 9, 2011 at 8:56 AM, Jeff Wang  wrote: >>> >>> Exception : 116916 [http-bio-8080-exec-4] WARN >>> org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper  - >>> WebApplicationException has been caught : >>&g

Re: Long vs long...

2011-12-09 Thread Jeff Wang
On Fri, Dec 9, 2011 at 8:56 AM, Jeff Wang wrote: > Exception : 116916 [http-bio-8080-exec-4] WARN > org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper  - > WebApplicationException has been caught : > com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to > java

Re: Long vs long...

2011-12-09 Thread Jeff Wang
On Fri, Dec 9, 2011 at 8:15 AM, Sergey Beryozkin wrote: > > Is it a JSON sequence ? The error is side-effect of this xsi type which is > probably not needed for this particular case; you'd need to set up a > namespace map for JSONProvider if you prefer to keep 'xsi' & 'xs' > It's not a sequence.

Long vs long...

2011-12-09 Thread Jeff Wang
I have a class with the ID as Long (I like to use null to indicate not yet stored, as opposed to a magic-number that is defined as the not-yet-stored number. However, when JAXB is done serialzing it, the type comes out as "@xsi.type":"xs:long", which, when ClientProxyImpl tries to deserialize, com

Re: JAX-RS Annotations and path resolution

2011-12-06 Thread Jeff Wang
ow, Bar, the POJO has a very simple JPA and XML mapping. @XMLRootElement @Entity public class Bar { @Column(name="fooId") public Foo; } (getters, setters, and other fields removed.) How would a equivalent mapping be expressed in a sub-resource locator? Would it be actually easier to read? thanks Jeff Wang

JAX-RS Annotations and path resolution

2011-12-05 Thread Jeff Wang
like you can use a returned @Component to have CXF continue resolving? For example, assuming like you previous answer, that BusResource is annotated with a class level @Path("/busses"). would a method level annotation of @Path("{bus_Id)") be able to match /fleets/5/busses/1? thanks! Jeff Wang

Re: Spring-Security Sessions and CXF

2011-11-16 Thread Jeff Wang
There's an open-id implementation of spring security. It goes through a bunch of redirects (302s) 1) client POSTs to the open id endpoint on , which typically is a /j_spring_openid_security_check 2) the endpoint in 1 responds with a 302 and a redirect to the openid endpoint (www.google.com//j_spr

Spring-Security Sessions and CXF

2011-11-15 Thread Jeff Wang
Due to a variety of reasons, we decided to not secure our html pages, but to secure the AJAX data calls. The AJAX endpoints are CXF JAX-RS endpoints. Because we support OAuth and OpenID, we made the decision to go with Spring Security and sessions, instead of the proper RESTful authenticate-each-

Re: Problem migrating from 2.3.1 to 2.5.0

2011-11-08 Thread Jeff Wang
This should be expected, right? The client represents an active connection (the conduit.) Shouldn't you be calling ClientProxy.getClient(...) again when you need a new client? Jeff On Tue, Nov 8, 2011 at 11:28 AM, Evangelina wrote: > Hi, > > I'm having a few issues trying to migrate CXF from 2.

2.5 and OAuth

2011-11-08 Thread Jeff Wang
With great anticipation, I am looking through the OAuth 1.0 implementation in CXF. I have some questions: In AuthorizationRequestService 1) This is just authorization, right? So we actually need to have secured the (in the example) /forms/oauthAuthorize.jsp so that before they go there, they are

Re: CORS Interceptor/Filter/Endpoint?

2011-09-14 Thread Jeff Wang
CORS response to the pre-flight call. Next steps, probably explore the InInterceptor idea. Jeff On Mon, Sep 12, 2011 at 2:43 AM, Sergey Beryozkin wrote: > Hi Jeff > > On 12/09/11 08:33, Jeff Wang wrote: >> >> (different contract, same CXF...) >> >> Ok, I've

Re: Are there any GOOD tutorials on creating REST services in CXF?

2011-09-14 Thread Jeff Wang
Perhaps, instead of using the maven tomcat plugin, you can ignore that. Just set the package type in maven to WAR, and then do a "mvn package". then copy the resulting war file from your /target directory to your /webapp directory. and then manually start tomcat. That plugin shouldn't be a big

CORS Interceptor/Filter/Endpoint?

2011-09-12 Thread Jeff Wang
one of the extra headers. Letting the call keep on going to CXF (by calling chain.doFilter) results in a 404. So that's not a good thing either. Any pointers on approahces would be much appreciated. Jeff Wang

RE: Jax-ws: how to implement server side timeout

2011-08-09 Thread Jeff Wang
If you're using CXF with Spring, and you have a late enough version, I wonder if the @Async tag works on a service method? You can have one endpoint marked with an @Async annotation, and another one to get the status (success or failure) of that call. Jeff -Original Message- From: Dan

RE: WebClient - Content-Type Override?

2011-07-31 Thread Jeff Wang
T requests ? Cheers, Sergey On 28/07/11 22:45, Jeff Wang wrote: > Looking through the code, it seems that if the body is null (which has > to be the case considering it's a get, then the content type is > overwritten with wildcards. > Using client.invoke("GET",""

RE: WebClient - Content-Type Override?

2011-07-28 Thread Jeff Wang
Looking through the code, it seems that if the body is null (which has to be the case considering it's a get, then the content type is overwritten with wildcards. Using client.invoke("GET",""); solved the problem for me. Jeff -Original Message- From:

WebClient - Content-Type Override?

2011-07-27 Thread Jeff Wang
I'm trying to act as a proxy to a third party webservice, and need to transform a REST request. One issue that I have is that the Content-Type header seems to get overridden no matter what I do. The code is actually very simple (context is an @Context MessageContext variable): We

RE: Multipart and WebClient

2011-07-21 Thread Jeff Wang
I think something else is interefing. By the way, default JSONProvider does not handle Strings... If you can get CXF source and put a breakpoint in MulipartProvider.isWriteable then it would provide an answer - alternatively please create a test project and attach it to JIRA... Cheers, Sergey > Thanks! > Jeff Wang

Multipart and WebClient

2011-07-20 Thread Jeff Wang
not configure something correctly? Any help would be greatly appreciated. Thanks! Jeff Wang