Re: JSESSIONID cookie not sent back to server

2008-02-16 Thread Landslide

Just want to share with others that Axis2 works properly if I use these 4
lines on the client side:
Options options = new Options();
options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, true);
options.setCallTransportCleanup(true);
client.setOptions(options);
-- 
View this message in context: 
http://www.nabble.com/JSESSIONID-cookie-not-sent-back-to-server-tp15514055p15517343.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: access via deferent clients (.NET and ...)

2008-02-16 Thread Glen Mazza
Yes, but you will need to follow the WS-I Basic Profile more closely,
and of course test your services with .Net clients.  It would also
depend on the nature and complexity of your web services.  

Truth be told, I suspect GlassFish Metro i.e., Project Tango, would be a
safer bet if .NET clients are a heavy requirement and advanced usage of
the WS-* specifications are planned.  Sun Microsystems does frequent
compatibility testing with Microsoft.

Glen

Am Samstag, den 16.02.2008, 04:20 -0800 schrieb Mohammad Shamsi:
 hi all,
 
 im working on JEE (Spring 2.5)  projects.
 i have some web services to implement. but my web services clients may be
 implemented in deferent language like .NET.
 
 can i use CXF in this case ? is it possible to connect CXF web service with
 .NET clients ?
 
 



Re: JSESSIONID cookie not sent back to server

2008-02-16 Thread Daniel Kulp

Looking at the code, this MAY be a bug in the HTTPConduit on the client 
side.Is there anyway you could use wireshark or tcpdump to get the 
very low level raw wire transfer captured?

In the Conduit, I see:
String cookieStr = connection.getHeaderField(Set-Cookie);

which according to the javadocs, says:
If called on a connection that sets the same header multiple times with 
possibly different values, only the last value is returned.


Thus, I'd like to know if JBoss/Tomcat is sending it on the wire on one 
line (one Set-Cookie header) or two.   If it's sending it as two, there 
definitely is an issue.  The client would only be getting the second 
one.

The code around line 1940 of HTTPConduit probably needs some updating to 
call getHeaderFields() and then process the full list for Set-Cookie.  
Please log a JIRA if you get a chance.


Dan




On Friday 15 February 2008, Landslide wrote:
 I am testing the latest release of CXF 2.0.4 and I got some unexpected
 results. On the client side, I got the following from the server side
 response and I have received the “JSESSIONID” in the cookie
 “Set-Cookie”.

 Headers: {Content-Length=[329], X-Powered-By=[Servlet 2.4;
 JBoss-4.0.5.GA (build: CVSTag=Branch_4_0
 date=200610162339)/Tomcat-5.5],
 Set-Cookie=[LSCookie=AA38FF4D7AD8E693942E95BB1AFAD5D8$$$,
 JSESSIONID=AA38FF4D7AD8E693942E95BB1AFAD5D8; Path=/], Date=[Fri, 15
 Feb 2008 00:22:18 GMT], SOAPAction=[urn:RetrieveContact],
 Server=[Apache-Coyote/1.1], content-type=[text/xml;charset=UTF-8]}

 I call the following on the client side to pass the header info back
 to the server side for all subsequent requests:
 BindingProvider bp = (BindingProvider)port;
 bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,
 true);

 On the server side, I could not see the “JSESSIONID” in the cookie
 when I use an interceptor of “Phase.PRE_PROTOCOL” or “Phase.READ”.

 19:22:19,140 INFO  [STDOUT] Headers: {connection=[keep-alive],
 cache-control=[no-cache], host=[localhost:],
 user-agent=[Java/1.5.0_12], transfer-encoding=[chunked],
 pragma=[no-cache], content-type=[text/xml; charset=UTF-8],
 cookie=[$Version=1;
 LSCookie=AA38FF4D7AD8E693942E95BB1AFAD5D8$$$], accept=[*],
 soapaction=[urn:RetrieveContact]}

 Please help me to understand how to retrieve the values of all cookies
 in an interceptor on the server side? Why would I get a null value of
 “httpSession” in my interceptor of “Phase.PRE_PROTOCOL” or
 “Phase.READ” which extends AbstractPhaseInterceptorMessage for all
 subsequent requests? HttpServletRequest request =
 (HttpServletRequest)message.getContextualProperty(HTTP_REQUEST);
 HttpSession httpSession =
 request.getSession(false);

 I would just like to add one more piece of info for this thread. When
 I switch to Axis2 on my SOAP client by calling:
 Options options = new Options();
 options.setManageSession(true);
 client.setOptions(options);

 I got the following header info on the server side using the same CXF
 implementation:
 07:33:10,078 INFO  [STDOUT] Headers: {host=[localhost:],
 user-agent=[Axis2], transfer-encoding=[chunked],
 cookie=[JSESSIONID=D4485D75748F657BA06C7A2E67F5323F; Path=/],
 content-type=[text/xml; charset=UTF-8],
 soapaction=[urn:anonOutInOp]}

 I got the value of “JSESSIONID” cookie on the server side, but
 unfortunately, also lost the value of the other cookie “LSCookie”, a
 similar bug of CXF which has been fixed. The real world is never
 perfect ……..



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog


jax-rs, raw xml output, a BUG?

2008-02-16 Thread gent911

Hello there,

I have a small problem, which I cant seem to solve.
What I want: I would like to receive a GET request from the browser and send
back a raw xml, which is being generated by jaxb (generation part works
perfectly well), I get a valid xml document, but on sending back the
response cxf modifies it, deletes ?xml ... header and even modifies my root
element inserting the namespace definition and it looks like this: ns2:rss
(I'm implementing rss feed). So here is my code:

---
@WebService
public interface RSSFeedManager {

  @Get
  @HttpResource( location = /rss )
  @WebResult( name = rss )
  public RSSFeed getRssFeed();
  
}
---

here goes spring config:

---
  bean class=org.apache.cxf.jaxws.JaxWsServerFactoryBean
init-method=create
property name=address value=http://localhost:8080/; /
property name=serviceBean ref=rssManager /
property name=bindingId value=http://apache.org/cxf/binding/http; /
property name=serviceFactory
  bean class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean
property name=wrapped value=false /
  /bean
/property
property name=properties
  props
prop key=Content-Typeapplication/xml/prop
  /props
/property
  /bean
---

The implemetation of RSSFeedManager interface delivers a correct xml
document, which I want my client to receive. The client receives:

---
ns2:rss xmlns:ns2=http://service.rss.test/; version=2.0
  channel
title
   ...
---

I would appreciate some comments on the issue, thnx.

PS:
I have just downloaded the cxf snapshot and have given it a try, using the
jax-rs/basic example I get the following exception:

---
Exception in thread main java.lang.NullPointerException
at
org.apache.cxf.endpoint.ManagedEndpoint.getObjectName(ManagedEndpoint.java:89)
at
org.apache.cxf.management.jmx.InstrumentationManagerImpl.register(InstrumentationManagerImpl.java:155)
at
org.apache.cxf.management.jmx.InstrumentationManagerImpl.register(InstrumentationManagerImpl.java:149)
at 
org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:102)
at org.apache.cxf.endpoint.ServerImpl.init(ServerImpl.java:69)
at
org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:82)
at demo.jaxrs.server.Server.init(Server.java:33)
at demo.jaxrs.server.Server.main(Server.java:37)
---
Do I miss something or it is really a bug in CXF?
Thnx

--
Regards,
Dmitry
-- 
View this message in context: 
http://www.nabble.com/jax-rs%2C-raw-xml-output%2C-a-BUG--tp15518626p15518626.html
Sent from the cxf-user mailing list archive at Nabble.com.



RE: jax-rs, raw xml output, a BUG?

2008-02-16 Thread Beryozkin, Sergey


Hi

Looks like you're not using a CXF JAX-RS implementation but
a CXF-specific HTTP binding.
Please consider giving a try to CXF JAX-RS...
Not sure where http://service.rss.test is coming from



Cheers, Sergey 






-Original Message-
From: gent911 [mailto:[EMAIL PROTECTED] 
Sent: 16 February 2008 18:40
To: cxf-user@incubator.apache.org
Subject: jax-rs, raw xml output, a BUG?


Hello there,

I have a small problem, which I cant seem to solve.
What I want: I would like to receive a GET request from the browser and
send
back a raw xml, which is being generated by jaxb (generation part works
perfectly well), I get a valid xml document, but on sending back the
response cxf modifies it, deletes ?xml ... header and even modifies my
root
element inserting the namespace definition and it looks like this:
ns2:rss
(I'm implementing rss feed). So here is my code:

---
@WebService
public interface RSSFeedManager {

  @Get
  @HttpResource( location = /rss )
  @WebResult( name = rss )
  public RSSFeed getRssFeed();
  
}
---

here goes spring config:

---
  bean class=org.apache.cxf.jaxws.JaxWsServerFactoryBean
init-method=create
property name=address value=http://localhost:8080/; /
property name=serviceBean ref=rssManager /
property name=bindingId
value=http://apache.org/cxf/binding/http; /
property name=serviceFactory
  bean
class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean
property name=wrapped value=false /
  /bean
/property
property name=properties
  props
prop key=Content-Typeapplication/xml/prop
  /props
/property
  /bean
---

The implemetation of RSSFeedManager interface delivers a correct xml
document, which I want my client to receive. The client receives:

---
ns2:rss xmlns:ns2=http://service.rss.test/; version=2.0
  channel
title
   ...
---

I would appreciate some comments on the issue, thnx.

PS:
I have just downloaded the cxf snapshot and have given it a try, using
the
jax-rs/basic example I get the following exception:

---
Exception in thread main java.lang.NullPointerException
at
org.apache.cxf.endpoint.ManagedEndpoint.getObjectName(ManagedEndpoint.ja
va:89)
at
org.apache.cxf.management.jmx.InstrumentationManagerImpl.register(Instru
mentationManagerImpl.java:155)
at
org.apache.cxf.management.jmx.InstrumentationManagerImpl.register(Instru
mentationManagerImpl.java:149)
at
org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:102)
at org.apache.cxf.endpoint.ServerImpl.init(ServerImpl.java:69)
at
org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBea
n.java:82)
at demo.jaxrs.server.Server.init(Server.java:33)
at demo.jaxrs.server.Server.main(Server.java:37)
---
Do I miss something or it is really a bug in CXF?
Thnx

--
Regards,
Dmitry
-- 
View this message in context:
http://www.nabble.com/jax-rs%2C-raw-xml-output%2C-a-BUG--tp15518626p1551
8626.html
Sent from the cxf-user mailing list archive at Nabble.com.


IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland