Re: Client time-out not working

2008-04-23 Thread Willem Jiang

You need to create the client first or you can't get a real client.
So the code snippet should be
 JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
  proxyFactory.setServiceClass(CustomerService.class);
  proxyFactory.setAddress(serviceURL);
  proxyFactory.setServiceName(serviceName);

 // The Client instance will be created when call the proxyFactory's 
create method.

 CustomerService customerService = (CustomerService) proxyFactory.create();

 Client client = ClientProxy.getClient(cusomerService);
 HTTPConduit http =  (HTTPConduit) client.getConduit();
 

Willem

Arul Dhesiaseelan wrote:

Hi,

I tried the below code in the client side to set the client timeout as 
suggested in the documentation. I get a NPE when I try to get the 
conduit from client. Am I missing something?


Please clarify.

   JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
   proxyFactory.setServiceClass(CustomerService.class);
   proxyFactory.setAddress(serviceURL);
   proxyFactory.setServiceName(serviceName);

   Client client = proxyFactory.getClientFactoryBean().getClient();
   HTTPConduit http = (HTTPConduit) client.getConduit();//NPE occurs here

   HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
   httpClientPolicy.setConnectionTimeout(36000);
   httpClientPolicy.setAllowChunking(false);
   httpClientPolicy.setReceiveTimeout(32000);

Thank you
Arul

Arul Dhesiaseelan wrote:

[EMAIL PROTECTED] wrote:
When debugging our services, sometimes the time spent debugging is 
greater that the time-out period for the client call. How can I 
increase the allowed time-out period?


Thanks...

Chris

_
Scanned by MessageLabs for the Super Flux Friends
_
  

Can you try adding this to your client?

   HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
   httpClientPolicy.setConnectionTimeout(0);
   httpClientPolicy.setAllowChunking(true);
   ((HTTPConduit) 
proxyFactory.getClientFactoryBean().getClient().getConduit()).setClient(httpClientPolicy); 



Cheers,
Arul


_
Scanned by MessageLabs for the Super Flux Friends
_







Re: Using logger !

2008-04-23 Thread Willem Jiang

I think you are talking about two difference thing.
One is the Logging{In|Out}Interceptor which logs the request and 
response message and it could be configured with annotation.


The other is the logging.Properties file which could configure the j.u.l 
's logging level.


Since the logging interceptor's default logging level is INFO, you could 
see request and response message without change the logging.Properties 
file (The default j.u.l logging level is INFO).


You said you can't get the client side request and response message from 
the log. It might be the CXF's bug. Could you show me the Client 
creating code?


BTW, you could also find some CXF logging information here [1]
[1]http://cwiki.apache.org/CXF20DOC/debugging.html

Willem


harbhanu wrote:

Hi,

As per the documentation for CXF, incase the logger is associated with the
SEI , using annotations, it enables logging for both client-server.

Otherwise if it's done only for SEI Implementation, then it enable only
server side logging.

 


But to my surprise, once I have specified the handler to console in
logging. Properties file it logs for both client and server.

For server there is a visible difference when I associate logging
interceptors, but there is NO change for client.

 


Does it mean that specifying loggin.properties file by itself enables some
amount of logging??

 


I think there are some subtle points regarding logging that I am missing.
Any comments ?

 


Thanks N Regards,

Harbhanu

PS: I have tried this for code generated using Wsdl2Java and executed using
the generated build.xml


  




Re: cxf.apache.org down?

2008-04-22 Thread Willem Jiang

You can get the CXF schema information here [1]

[1] http://cwiki.apache.org/CXF20DOC/schemas-and-namespaces.html

Willem
toddmcgrath wrote:

Hi everybody,

I'm getting validation errors on app startup with a CXF client.  I'm
assuming it's because http://cxf.apache.org/ is down?

This is probably an elementary question, but I couldn't find an answer in
the docs and the one mailing list post I found seemed like much work to
change the paths.  Also, in the aforementioned post, the schemaLocation
paths will be hardcoded which will be different when moving to production.

Can we specify the location of xsd files to search the classpath/jar file?

Thoughts and/or ideas?  



beans xmlns=http://www.springframework.org/schema/beans;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns:sec=http://cxf.apache.org/configuration/security;
  xmlns:http=http://cxf.apache.org/transports/http/configuration;
  xsi:schemaLocation=
  http://cxf.apache.org/configuration/security
  http://cxf.apache.org/schemas/configuration/security.xsd
  http://cxf.apache.org/transports/http/configuration
  http://cxf.apache.org/schemas/configuration/http-conf.xsd
  http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans.xsd;

import resource=classpath:META-INF/cxf/cxf.xml /
import resource=classpath:META-INF/cxf/cxf-extension-soap.xml /
import resource=classpath:META-INF/cxf/cxf-servlet.xml /

   http:conduit

name={http://fedex.com/ws/ship/v3}ShipServicePort.http-conduit;
   !--
   http:authorization
   sec:UserNameusernamehere/sec:UserName
   sec:Passwordpasswordhere/sec:Password
   /http:authorization
   --
   http:tlsClientParameters secureSocketProtocol=SSL /
   /http:conduit

/beans

Thanks in advance (and apologies if I'm missing an easy answer),
Todd


-
--
Todd McGrath
http://www.supergloo.com http://www.supergloo.com 
612 843-1055
  




Re: servlet transport question

2008-04-20 Thread Willem Jiang

Hi Leos,

Please see my comments in the mail.

[EMAIL PROTECTED] wrote:

Rafael,

thank you for your message. Especially the note about FQCN for Endpoint is 
crucial for me! Can somebody update 
http://cwiki.apache.org/CXF20DOC/servlet-transport.html ?
  

Sure, I will take care of it.
  

After, I configured CXFNonSpringServlet on my web.xml file and then I had
setup a Servlet (it could be a filter as well) with loadonstartup to
register the Services I had using: Endpoint.publish. Be careful not to
import the wrong Endpoint (right one is from: javax.xml.ws) class.



Please put snippet, how to configure the Bus (setup the servlet). The web.xml 
part is clear:

 servlet
servlet-nameCXFServlet/servlet-name
display-nameCXF Servlet/display-name
servlet-class
org.apache.cxf.transport.servlet.CXFServlet
/servlet-class
  /servlet

  servlet-mapping
servlet-nameCXFServlet/servlet-name
url-pattern/services/*/url-pattern
  /servlet-mapping

But how to manage this part?

// cxf is the instance of the CXFServlet
Bus bus = cxf.getBus();
BusFactory.setDefaultBus(bus); 

How have you solved it? Or is it set up behind the scene automatically in 2.0.5 release? 
  
Basically, you can extends the CXFNonSpringServlet[1] and  the setup 
default Bus part before you call the endpoint.publish
And you also need to change the web.xml's servlet-class with your 
extended servlet :)



Thank you

Leos


  

Willem


Re: Multiple addresses for a service

2008-04-16 Thread Willem Jiang
Good suggestion, I will try to address this issue by checking the 
request url with the path separator.

Here is the JIRA[1] for tracing it.

[1]https://issues.apache.org/jira/browse/CXF-1531

Willem
Guillaume Nodet wrote:

I guess we could preserve the existing behavior while still use the correct
bean.  We just need to take into account the path separator / and only
select the one that has a full match.

On Mon, Apr 14, 2008 at 4:15 AM, Willem Jiang [EMAIL PROTECTED]
wrote:

  

That is because CXF support to map a Http request to a soap request, such
as http://localhost:9000/SoapContext/SoapPort/greetMe/requestType/cxf;.
To implement this by default , CXF use the match the first policy(call the
String.startWith()) to lookup the proper destination.

With these policy http://localhost:8080/MyThingInstance?wsdl; and 
http://localhost:8080/MyThingInstance2?wsdl; requests will be dispatched
destination which address is MyThingInstance. So you always get the same
WSDL with these two URL.

If you want to get the different wsdl definitions from Address1 and
Address2 , you need to avoid the Address2 starting with Address1.

Willem


Arul Dhesiaseelan wrote:



Thanks Dan.

But when I implement as shown below.

  MyThing implementor = new MyThingImpl();
  String address = http://localhost:8080/MyThingInstance;
  javax.xml.ws.Endpoint jaxwsEndpoint = Endpoint.publish(address,
implementor); MyThing implementor2 = new MyThingImpl();
  String address2 = http://localhost:8080/MyThingInstance2;
  javax.xml.ws.Endpoint jaxwsEndpoint = Endpoint.publish(address2,
implementor2);  I tried to access
http://localhost:8080/MyThingInstance?wsdl and
http://localhost:8080/MyThingInstance2?wsdl. Both the WSDL has the same
service definition.

I do not see MyThingInstance2 anywhere in the WSDL.

Am I missing something?

Best regards
Arul

Daniel Kulp wrote:

  

On Wednesday 09 April 2008, Arul Dhesiaseelan wrote:




Daniel Kulp wrote:


  

On Wednesday 09 April 2008, Benson Margulies wrote:




A bit of googling got me nowhere here.

I want to publish a service on both a http: address and a local:
address. Two jaxws:endpoints? Can they point to the same
#implementation bean?


  

Yep.   It's the same as if you did:

MyThing thing = new MyThingImpl();
Endpoint.publish(address1, thing);
Endpoint.publish(address2, thing);




Dan,

Does this work?

MyThing thing1 = new MyThingImpl();
MyThing thing2 = new MyThingImpl();

Endpoint.publish(address1, thing1);
Endpoint.publish(address2, thing2);

When I invoke the service at address1, it should invoke thing1 and
address2 should invoke thing2.

Thanks!
Arul


  

Yep.   That's exactly how it's supposed to work.






  



  




Re: Local transport is both up and down at the same time, sort of.

2008-04-13 Thread Willem Jiang
Just as DanK said , if you want to use the local transport across the 
web apps, you need to share the bus between these apps.

It is not a easy way to do that.
How about starting a stand http servlet transport to do that ?

Willem

Benson Margulies wrote:

JNI is a pain in a web container. It occured to me that the most portable
way to share JNI between webapps was to put it into a web service in one web
app, and consume it in the others.

  




Re: Using cxf with external web-services

2008-04-13 Thread Willem Jiang
There are the outputs of the Spring's logger which uses the common log, 
if you have the log4j jar in your class path, common log will pick them 
up. You may turn off the log by putting the log4j logger.property file 
in your class path and set the Spring logging level to WARNING.


Willem
Tim Perrett wrote:

Awesome Glen, just the ticket!

Oddly, my tester now works, although I get info messages output in the 
terminal, despite my global CXF logging level set to WARNING?
Its not really a massive problem, but just a bit disconcerting having 
all that red output in eclipse. The messages Im getting are detailed 
below.


Any help would be awesome :-)

Cheers, Tim



Apr 12, 2008 12:44:57 PM 
org.springframework.context.support.AbstractApplicationContext 
prepareRefresh
INFO: Refreshing 
[EMAIL PROTECTED]: display name 
[EMAIL PROTECTED]; startup date 
[Sat Apr 12 12:44:57 BST 2008]; root of context hierarchy
Apr 12, 2008 12:44:57 PM 
org.apache.cxf.bus.spring.BusApplicationContext getConfigResources

INFO: No cxf.xml configuration file detected, relying on defaults.
Apr 12, 2008 12:44:57 PM 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource 
[META-INF/cxf/cxf.xml]
Apr 12, 2008 12:44:57 PM 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource 
[META-INF/cxf/cxf-extension-xml.xml]
Apr 12, 2008 12:44:57 PM 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource 
[META-INF/cxf/cxf-extension-http.xml]
Apr 12, 2008 12:44:57 PM 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource 
[META-INF/cxf/cxf-extension-soap.xml]
Apr 12, 2008 12:44:57 PM 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource 
[META-INF/cxf/cxf-extension-jaxws.xml]
Apr 12, 2008 12:44:57 PM 
org.springframework.context.support.AbstractApplicationContext 
obtainFreshBeanFactory
INFO: Bean factory for application context 
[EMAIL PROTECTED]: 
[EMAIL PROTECTED] 

Apr 12, 2008 12:44:58 PM 
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker 
postProcessAfterInitialization
INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not 
eligible for getting processed by all BeanPostProcessors (for example: 
not eligible for auto-proxying)
Apr 12, 2008 12:44:58 PM 
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker 
postProcessAfterInitialization
INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is 
not eligible for getting processed by all BeanPostProcessors (for 
example: not eligible for auto-proxying)
Apr 12, 2008 12:44:58 PM 
org.springframework.beans.factory.support.DefaultListableBeanFactory 
preInstantiateSingletons
INFO: Pre-instantiating singletons in 
[EMAIL PROTECTED]: 
defining beans 
[cxf,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.jaxws.context.WebServiceContextResourceResolver,org.apache.cxf.jaxws.context.WebServiceContextImpl]; 
root of factory hierarchy
Apr 12, 2008 12:44:58 PM 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean 
buildServiceFromWSDL
INFO: Creating Service 
{http://webservices.daelab.net/temperature}TemperatureConversions from 
WSDL: 
file:/Users/timperrett/Documents/workspace/MyWeatherDemo/src/main/wsdl/temperature.wsdl 




On 12 Apr 2008, at 03:50, Glen Mazza wrote:

Perhaps my client example may help you:
http://www.jroller.com/gmazza/date/20070929

Glen








Re: Multiple addresses for a service

2008-04-13 Thread Willem Jiang
That is because CXF support to map a Http request to a soap request, 
such as 
http://localhost:9000/SoapContext/SoapPort/greetMe/requestType/cxf;.
To implement this by default , CXF use the match the first policy(call 
the String.startWith()) to lookup the proper destination.


With these policy http://localhost:8080/MyThingInstance?wsdl; and 
http://localhost:8080/MyThingInstance2?wsdl; requests will be 
dispatched destination which address is MyThingInstance. So you always 
get the same WSDL with these two URL.


If you want to get the different wsdl definitions from Address1 and 
Address2 , you need to avoid the Address2 starting with Address1.


Willem

Arul Dhesiaseelan wrote:

Thanks Dan.

But when I implement as shown below.

   MyThing implementor = new MyThingImpl();
   String address = http://localhost:8080/MyThingInstance;
   javax.xml.ws.Endpoint jaxwsEndpoint = Endpoint.publish(address, 
implementor);  
   MyThing implementor2 = new MyThingImpl();

   String address2 = http://localhost:8080/MyThingInstance2;
   javax.xml.ws.Endpoint jaxwsEndpoint = 
Endpoint.publish(address2, implementor2);  
I tried to access http://localhost:8080/MyThingInstance?wsdl and 
http://localhost:8080/MyThingInstance2?wsdl. Both the WSDL has the 
same service definition.


I do not see MyThingInstance2 anywhere in the WSDL.

Am I missing something?

Best regards
Arul

Daniel Kulp wrote:

On Wednesday 09 April 2008, Arul Dhesiaseelan wrote:
 

Daniel Kulp wrote:
   

On Wednesday 09 April 2008, Benson Margulies wrote:
 

A bit of googling got me nowhere here.

I want to publish a service on both a http: address and a local:
address. Two jaxws:endpoints? Can they point to the same
#implementation bean?


Yep.   It's the same as if you did:

MyThing thing = new MyThingImpl();
Endpoint.publish(address1, thing);
Endpoint.publish(address2, thing);
  

Dan,

Does this work?

MyThing thing1 = new MyThingImpl();
MyThing thing2 = new MyThingImpl();

Endpoint.publish(address1, thing1);
Endpoint.publish(address2, thing2);

When I invoke the service at address1, it should invoke thing1 and
address2 should invoke thing2.

Thanks!
Arul




Yep.   That's exactly how it's supposed to work.

  







Re: Local transport is both up and down at the same time, sort of.

2008-04-12 Thread Willem Jiang

Hi Benson

Just one more question, why did you want to use location transport in 
the Web container ?
Did you want to share or route the client request between the different 
endpoints?


Willem

Benson Margulies wrote:

Willem,

The log messages from RSFB are a bit confusing. Notice that the first set
ends with a publish address and the second with a destination address.

I'll go read the code, but now that I'm awake I can't imagine how the local
transport would sneak across webapp class loader boundaries if no code is
loaded into the system class loader.

--benson


On Thu, Apr 10, 2008 at 7:34 AM, Benson Margulies [EMAIL PROTECTED]
wrote:

  

I see your point. Maybe I made a cut-and-paste error and set up the
service factory instead of the proxy factory.


On Thu, Apr 10, 2008 at 4:14 AM, Willem Jiang [EMAIL PROTECTED]
wrote:



Hi Benson,

I am confused about the Webapp#2's log.

   [java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.transport.local.LocalTransportFactory createDestination
   [java] INFO: Creating destination for address
local://RosetteTextAnalyzer

It looks you create the same local transport destination in Webapp#2.

AFAIK , if your two application are in the same JVM , the local
transport should work :)


Willem




Benson Margulies wrote:

  

Webapp #1 sets up a service, with an endpoint on the local transport.

 [java] INFO: Creating Service {urn:basistech.com:
rta}RosetteTextAnalyzer
from class com.basistech.rta.ws.RosetteTextAnalyzer
[java] Apr 9, 2008 9:10:55 PM org.apache.cxf.endpoint.ServerImpl
initDestination
[java] INFO: Setting the server's publish address to be
local://RosetteTextAnalyzer

Webapp #2 sets up a client proxy, trying to talk to the same endpoint.
Unhappiness results. First, some diagnostic complaints from the RSFB
while
creating the proxy (this is all JAXWS+JAXB) then we get the complaint
that
no-one and nothing is listening. Will the local transport in fact work
across webapps? For that matter, are the complaints because all I've
given
the proxy factory to work on is an interface, and it doesn't have
param
names? I've been working inside CXF for so long that I'm pretty lost
when I
just try to use it.

 [java] Apr 9, 2008 9:11:34 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
[java] INFO: Creating Service
{urn:basistech.com:rta}RosetteTextAnalyzerService
from class com.basistech.rta.RosetteTextAnalyzer
[java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
[java] INFO: {urn:basistech.com:rta:v1.0}tokenResults part type
QName
null.
[java] {urn:basistech.com:rta:v1.0}languages part type QName null.
[java] {urn:basistech.com:rta:v1.0}matches part type QName null.
[java] {urn:basistech.com:rta:v1.0}glossaries part type QName
null.
[java]
[java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.transport.local.LocalTransportFactory createDestination
[java] INFO: Creating destination for address
local://RosetteTextAnalyzer
[java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.phase.PhaseInterceptorChain doIntercept
[java] INFO: Interceptor has thrown exception, unwinding now
[java] java.lang.IllegalStateException: Local destination does not
have
a MessageObserver on address local://RosetteTextAnalyzer




  


  




Re: Local transport is both up and down at the same time, sort of.

2008-04-10 Thread Willem Jiang

Hi Benson,

I am confused about the Webapp#2's log.

[java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.transport.local.LocalTransportFactory createDestination
[java] INFO: Creating destination for address
local://RosetteTextAnalyzer

It looks you create the same local transport destination in Webapp#2.

AFAIK , if your two application are in the same JVM , the local transport 
should work :)


Willem



Benson Margulies wrote:

Webapp #1 sets up a service, with an endpoint on the local transport.

  [java] INFO: Creating Service {urn:basistech.com:rta}RosetteTextAnalyzer
from class com.basistech.rta.ws.RosetteTextAnalyzer
 [java] Apr 9, 2008 9:10:55 PM org.apache.cxf.endpoint.ServerImpl
initDestination
 [java] INFO: Setting the server's publish address to be
local://RosetteTextAnalyzer

Webapp #2 sets up a client proxy, trying to talk to the same endpoint.
Unhappiness results. First, some diagnostic complaints from the RSFB while
creating the proxy (this is all JAXWS+JAXB) then we get the complaint that
no-one and nothing is listening. Will the local transport in fact work
across webapps? For that matter, are the complaints because all I've given
the proxy factory to work on is an interface, and it doesn't have param
names? I've been working inside CXF for so long that I'm pretty lost when I
just try to use it.

  [java] Apr 9, 2008 9:11:34 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
 [java] INFO: Creating Service
{urn:basistech.com:rta}RosetteTextAnalyzerService
from class com.basistech.rta.RosetteTextAnalyzer
 [java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
 [java] INFO: {urn:basistech.com:rta:v1.0}tokenResults part type QName
null.
 [java] {urn:basistech.com:rta:v1.0}languages part type QName null.
 [java] {urn:basistech.com:rta:v1.0}matches part type QName null.
 [java] {urn:basistech.com:rta:v1.0}glossaries part type QName null.
 [java]
 [java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.transport.local.LocalTransportFactory createDestination
 [java] INFO: Creating destination for address
local://RosetteTextAnalyzer
 [java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.phase.PhaseInterceptorChain doIntercept
 [java] INFO: Interceptor has thrown exception, unwinding now
 [java] java.lang.IllegalStateException: Local destination does not have
a MessageObserver on address local://RosetteTextAnalyzer

  




Re: Webservice client sending null parameters to host

2008-04-02 Thread Willem Jiang
FYI, the jetty engine is just used for implementing the http transport, 
it will not modify any of the Request or Response message.
I think there may be different xml library in the WAR class path and the 
in the jetty embedded class path.


Willem
depstei2 wrote:

Hi Dan, thanks for your help,
You were right about the qualified vs unqualified issue.  The weird thing
is, if I deploy in tomcat or jetty as a WAR it works fine, but if I deploy
in jetty embedded it fails. The message being sent was this:
soap:Envelope
xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;
soap:Body
ns2:createPersonTypeInfo
xmlns:ns2=http://myNamespace;
personTypeInfo name=PersonType1 
and it causes null parameters, so using soap UI I changed the message by

adding a namespace prefix:
soap:Envelope
xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;
soap:Body
ns2:createPersonTypeInfo
xmlns:ns2=http://myNamespace;
ns2:personTypeInfo name=PersonType1 
and it worked.  


I then removed @XmlRootElement from my PersonTypeInfo class and it works
without using the namespace prefix. I wonder why jetty embedded is causing
problems!
Thanks again,
-Daniel


dkulp wrote:
  
I'm pretty sure that if your hitting this, the soap message is invalid 
for the service.  Usually, it's one of two things:


1) A qualified vs unqualified issue.   The elements are coming in 
non-qulalified when the service is expecting qualified or vice-versa.


2) The elements are coming in the wrong order.   I think one of the perl 
soap toolkits does this sometimes. 


In anycase, a testcase would be a big help.

Dan






  




Re: HTTPS and CXF Protocol mismatch: engine's protocol is http, the url protocol is https

2008-03-27 Thread Willem Jiang
We have two configuration system properties to set the configuration 
file, one is cxf.config.file for the configuration file in the class 
path such as -Dcxf.config.file=SercureServer.xml , the other is 
cxf.config.file.url which is used for the point out the 
configuration's URL.
In your case , I think it could be the   error + missing the protocol 
header file:/.


Willem

Glen Mazza wrote:

This may be the problem:  Try -Dcxf.config.file instead of
-Dcxf.config.file.url, perhaps.

Am Donnerstag, den 27.03.2008, 10:00 +0100 schrieb
[EMAIL PROTECTED]:
  
First of all thank you boys! 
I really appreciate your valuable help.




How did you feed the CXF configuration to the server?
  
I am working under eclipse; I have specified this argument (into the 
run section) 
-Dcxf.config.file.url=C:/Documents and Settings/ SecureServer.xml. 
(I have used   )

The file SecureServer.xml is included in the first mail.

I am interested in developing a server which listens on connections 
via https;

this is my server:
package com.hw.server;

String address = https://localhost:9001/helloWorld;;
IHelloWorld implementor = new HelloWorldImpl();
Service.publish(address, implementor);
System.out.println(Server ready);

I am currently using the 2.0.5 snapshot downloaded from cxf website 
but nothing has changed and I continue having the same error (protocol 
mismatch).


Another thing you could explain me: what's the difference between sec:
keyManagers and sec:trustManager and why do I have to specify the 
password twice (inside keyPassoword=  and inside password= ) ?


  sec:keyManagers keyPassword=password
   sec:keyStore type=JKS password=password 
file=C:/certs/cherry.jks/

  /sec:keyManagers
  sec:trustManagers
  sec:keyStore type=JKS password=password
   file=C:/certs/truststore.jks/
  /sec:trustManagers

Thank you.



__

Voce Senza Limiti: chiama in tutta Italia a 0 cent. SOLO 9,90 EURO AL MESE fino 
al 27/03/08!
http://abbonati.tiscali.it/promo/vocesenzalimiti_2603/





  




Re: HTTPS and CXF Protocol mismatch: engine's protocol is http, the url protocol is https

2008-03-26 Thread Willem Jiang

Hi ,

How did you feed the CXF configuration to the server?
Here is a document [1]to show how to supply a  configuration file to CXF.

[1]http://cwiki.apache.org/CXF20DOC/configuration.html

Willem
[EMAIL PROTECTED] wrote:

Hi guys,
I have some problems with CXF and HTTPS.
My configuration file (server side) is:

?xml version=1.0 encoding=UTF-8?

!-- 
  ** This file configures the HTTPS Server.

 --

beans xmlns=http://www.springframework.org/schema/beans;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns:sec=http://cxf.apache.org/configuration/security;
  xmlns:http=http://cxf.apache.org/transports/http/configuration;
  xmlns:httpj=http://cxf.apache.org/transports/http-
jetty/configuration
  xmlns:jaxws=http://java.sun.com/xml/ns/jaxws;
  xsi:schemaLocation=
   http://cxf.apache.org/configuration/security   http:
//cxf.apache.org/schemas/configuration/security.xsd
http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://cxf.apache.org/transports/http-jetty/configuration
http://cxf.apache.org/schemas/configuration/http-jetty.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-
2.0.xsd



  http:destination name={http://package}AnInterfacePort.http-
destination 
  /http:destination


  httpj:engine-factory bus=cxf
   httpj:engine port=9001
httpj:tlsServerParameters
  sec:keyManagers keyPassword=password
   sec:keyStore type=JKS password=password 
file=C:/certs/cherry.jks/

  /sec:keyManagers
  sec:trustManagers
  sec:keyStore type=JKS password=password
   file=C:/certs/truststore.jks/
  /sec:trustManagers
  sec:cipherSuitesFilter
!-- these filters ensure that a ciphersuite with
  export-suitable or null encryption is used,
  but exclude anonymous Diffie-Hellman key change as
  this is vulnerable to man-in-the-middle attacks --
sec:include.*_EXPORT_.*/sec:include
sec:include.*_EXPORT1024_.*/sec:include
sec:include.*_WITH_DES_.*/sec:include
sec:include.*_WITH_NULL_.*/sec:include
sec:exclude.*_DH_anon_.*/sec:exclude
  /sec:cipherSuitesFilter
  sec:clientAuthentication want=true required=true/
/httpj:tlsServerParameters
   /httpj:engine
  /httpj:engine-factory
  


  !-- We need a bean named cxf --
  bean id=cxf class=org.apache.cxf.bus.CXFBusImpl/
/beans

And the server is really simple: it basically does Service.publish
(https://localhost:9001/helloWorld, an implementor)
but then i have this exception:

Caused by: java.io.IOException: Protocol mismatch: engine's protocol 
is http, the url protocol is https


Please help!

Bye



__

Voce Senza Limiti: chiama in tutta Italia a 0 cent. SOLO 9,90 EURO AL MESE fino 
al 27/03/08!
http://abbonati.tiscali.it/promo/vocesenzalimiti_2603/


  




Re: IncompatibleClassChangeError: DefinitionImpl

2008-03-24 Thread Willem Jiang
If you are working on the WebSphere with CXF. Here is one solution[1] 
for your case.

[1]http://cwiki.apache.org/confluence/display/CXF20DOC/AppServerGuide#AppServerGuide-Websphere

Willem

Scott Anderson wrote:

I get this exception when I try to instantiate my Service class:

Exception in thread main java.lang.IncompatibleClassChangeError: Class
com.ibm.wsdl.DefinitionImpl does not implement the requested interface
javax.wsdl.extensions.AttributeExtensible
at org.apache.cxf.wsdl11.WSDLServiceBuilder.copyExtensionAttributes(
WSDLServiceBuilder.java:126)
at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(
WSDLServiceBuilder.java:230)
at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(
WSDLServiceBuilder.java:159)
at org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java
:117)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:116)
at org.apache.cxf.jaxws.ServiceImpl.init(ServiceImpl.java:107)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(
ProviderImpl.java:55)
at javax.xml.ws.Service.init(Service.java:56)

  




Re: service caching

2008-03-20 Thread Willem Jiang

AFAIK, Benson did some service start up performance turning this month.
Please check out the latest snapshot, there must be some great 
improvement in CXF :)


Willem.

Christopher Cheng wrote:

Looks like 2.0.5 is going to release soon, is this service caching in 2.0.5?

On Wed, Mar 5, 2008 at 11:50 AM, Christopher Cheng 
[EMAIL PROTECTED] wrote:

  

Looking forward to have this in the next release 2.0.5 or 2.1 :)



On Tue, Mar 4, 2008 at 11:55 PM, Daniel Kulp [EMAIL PROTECTED] wrote:



Willem,

The issue is that they CAN be modified after that.   One popular
modification is to grab the EndpointInfo out of it and change the
address.   Other things like adding interceptors to the BindingInfo,
changing properties on the service (like to enable schema validation),
etc... are all modifications that affect the servicemodel.

Databinding is less of an issue, but still one.   For example, the
databinding has an mtomThreshold and a namespaceMap that can be set
programatically.

In both of those cases, a modification should only affect the proxy on
which the modification is made.   Thus, the servicemodel would need a
full clone, which may not be easy to do.   It's certainly a lot more
code to add.

That said, I don't think it's a bad idea at all.  On the contrary, it's
a
good idea.   It's just a bit of work.

Dan


On Tuesday 04 March 2008, Willem Jiang wrote:
  

Hi Dan,

I think we could cache the ServiceInfo object and DataBinding object
which will take lots of time to be created and can't be modified after
that. Any thought?

Willem

Daniel Kulp wrote:


On Tuesday 04 March 2008, Christopher Cheng wrote:
  

I haven't read the codes of Axis, but I have been using it for 2
years and it doesn't have this problem.
Having an overhead for 5-8 seconds is not an option for a
production system in term of performance

What you are saying is that all the services must implement
Clonable interface?


No, not the services themselves.   Just our interal service model
stuff that holds all the metadata.  Basically, when creating a new
service, we need to calculate the metadata.   We should cache that
if possible.

Dan

  

On Tue, Mar 4, 2008 at 4:48 AM, Daniel Kulp [EMAIL PROTECTED]


wrote:
  

Christopher,

We cannot just reuse the Service model objects as they are
completely modifiable at runtime. For example, one proxy could be
reconfigured with new address or have additional interceptors
added or similar.  Those shouldn't affect others.

On option that propably would make sense is to add a fast clone
functionality to the entire service model so we could cache one,
and then clone it whenever one is really needed.   All the
individual versions could be modified and not affect the original.
  However, doing that would be quite a bit of work as there are a
LOT of classes that would need to be updated to support that.

Patches towards that end would be great.   :-)

Dan

On Monday 03 March 2008, Christopher Cheng wrote:
  

wsdl is indeed cached in WSDLManagerImpl.definitionsMap

After reading the codes, I have some questions. My workstation is
a PentiumD 3GHz with 1.5GB RAM

In the class
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buil
d Serv iceFromWSDL(String url),
setService(factory.create()); takes 3 seconds
getDataBinding().initialize(getService()); takes 2 seconds

These 2 methods are called even in 2nd calls. Can you also cache
the services perhaps using jakarta commons-pool? or eh-cache?

By the way, I found that the wsdl is put into the definitionMap
twice if  WSDLManagerImpl.getDefinition(URL url) is called.
First in getDefintion(URL url) at line 147 and second in
loadDefinition(String url) at line 201.


On Mon, Mar 3, 2008 at 4:22 PM, Christopher Cheng 

[EMAIL PROTECTED] wrote:


wsdl is indeed cached in WSDLManagerImpl.definitionsMap

After reading the codes, I have some questions. My workstation
is a PentiumD 3GHz with 1.5GB RAM

In the class 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buil
dSer viceFromWSDL(String url),
setService(factory.create()); takes 3 seconds
getDataBinding().initialize(getService()); takes 2 seconds

These 2 methods are called even in 2nd calls. Can you also cache
the services perhaps using jakarta commons-pool? or eh-cache?

By the way, I found that the wsdl is put into the definitionMap
twice if  WSDLManagerImpl.getDefinition(URL url) is called.
First in getDefintion(URL url) at line 147 and second in
loadDefinition(String url) at line 201.



On Mon, Mar 3, 2008 at 9:43 AM, Willem Jiang
[EMAIL PROTECTED]

wrote:
  

Hi,

I just went through the code, we really cache the WSDL
definition in CXF.
Could you send your test case and wsdl file to me ? I may need
to trace it for more information.

Regards,

Willem

Christopher Cheng wrote:


I think the issue is still there. I used a for loop to
execute

Re: Code Fisrt + JSON: xmlbinding problem

2008-03-05 Thread Willem Jiang
You could fill a jira and attach the test case with it.
Willem

On 3/5/08, Luca Ceppelli [EMAIL PROTECTED] wrote:
   
   !--
   @page { size: 21cm 29.7cm; margin: 2cm }
   P { margin-bottom: 0.21cm }
   --
   Hi all.


 I'm trying to use CXF as
 backed for a web base application (Flex). Cxf has to expose json over
 http  endpoint. The approach should be code first instead wsdl
 first for speeding up the development  process.


 CXF has some problem with
 this (or maybe I was not able to run it properly), the problem is
 related with the xmlbinding. Did someone have the same experience?
 I have created a test
 case, how I could share it? Do I send it to this mailing list?




 Thanks,
 Luca.


 P.S. The problem happens
 with:


 2.0-incubator
 2.0.4-incubator
 2.0.4.0-fuse
 2.1-incubator-SNAPSHOT






   ___
 L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail:
 http://it.docs.yahoo.com/nowyoucan.html



Re: Accessing WebService that requires username/password

2008-03-05 Thread Willem Jiang

Does the WSDL_LOCATION also point to the server which you need to access?
If so , here is my explain of this issue.
In CXF we just use WSDL4J and use a common URL class to load the wsdl, 
so what you set on the client side will not affect the WSDL4J's URL.
CXF will build a service model with the WSDL before you client hit the 
server , so you got that error.


Willem

Glen Mazza wrote:

Sadly, I was able to get this portion of your code below to work for
Metro but not CXF:

rc.put(BindingProvider.USERNAME_PROPERTY, userName);
rc.put(BindingProvider.PASSWORD_PROPERTY, password);

I have been meaning to look at this to find out the reason why.  But in
the meantime, CXF has an alternate method of supplying this information,
documented here[1].

Glen

[1] http://tinyurl.com/ytc77j

Am Mittwoch, den 05.03.2008, 15:37 -0800 schrieb xbranko:
  

How should a webservice that requires basic username/password for
authentication be accessed? The CXF service class that is autogenerated
extends the javax.xml.ws.Service class. So when the client tries to
instantiate it, it fails because it gets java.io.IOException: Server
returned HTTP response code: 401 for URL.

Looking at the documentation, and on the web, it seems that what is needed
is to add something like this:

//Create a dispatch instance
DispatchSOAPMessage dispatch = 
   createDispatch(WebService1, SOAPMessage.class,

Service.Mode.MESSAGE);

// Use Dispatch as BindingProvider
BindingProvider bp = (BindingProvider) dispatch;

// Optionally Configure RequestContext to send SOAPAction HTTP
Header
MapString, Object rc = bp.getRequestContext();
rc.put(BindingProvider.USERNAME_PROPERTY, userName);
rc.put(BindingProvider.PASSWORD_PROPERTY, password);

before the service hits the url. However, given that service derives from
javax.xml.ws.Service class whose constructor is protected, how do I do that,
given that constructor looks like:

public WebServiceX() {
super(WSDL_LOCATION, SERVICE);
}

and in the super's constructor (javax.xml.ws.Service), the class tries to
connect to the url that needs the username and password, and due to java,
call to super must be the first call in the deriver class's constructor.

Note that this is not an https service, but just an http service that works
well when I invoke it from the browser (once I provide username and password
in the dialog box provided by the browser).

Any help greatly appreciated!




  




Re: service caching

2008-03-04 Thread Willem Jiang

Hi Dan,

I think we could cache the ServiceInfo object and DataBinding object 
which will take lots of time to be created and can't be modified after that.

Any thought?

Willem

Daniel Kulp wrote:

On Tuesday 04 March 2008, Christopher Cheng wrote:
  

I haven't read the codes of Axis, but I have been using it for 2 years
and it doesn't have this problem.
Having an overhead for 5-8 seconds is not an option for a production
system in term of performance

What you are saying is that all the services must implement Clonable
interface?



No, not the services themselves.   Just our interal service model stuff 
that holds all the metadata.  Basically, when creating a new service, we 
need to calculate the metadata.   We should cache that if possible.


Dan


  

On Tue, Mar 4, 2008 at 4:48 AM, Daniel Kulp [EMAIL PROTECTED] wrote:


Christopher,

We cannot just reuse the Service model objects as they are
completely modifiable at runtime. For example, one proxy could be
reconfigured with new address or have additional interceptors added
or similar.  Those shouldn't affect others.

On option that propably would make sense is to add a fast clone
functionality to the entire service model so we could cache one, and
then clone it whenever one is really needed.   All the individual
versions could be modified and not affect the original.   However,
doing that would be quite a bit of work as there are a LOT of
classes that would need to be updated to support that.

Patches towards that end would be great.   :-)

Dan

On Monday 03 March 2008, Christopher Cheng wrote:
  

wsdl is indeed cached in WSDLManagerImpl.definitionsMap

After reading the codes, I have some questions. My workstation is
a PentiumD 3GHz with 1.5GB RAM

In the class
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.build
Serv iceFromWSDL(String url),
setService(factory.create()); takes 3 seconds
getDataBinding().initialize(getService()); takes 2 seconds

These 2 methods are called even in 2nd calls. Can you also cache
the services perhaps using jakarta commons-pool? or eh-cache?

By the way, I found that the wsdl is put into the definitionMap
twice if  WSDLManagerImpl.getDefinition(URL url) is called.
First in getDefintion(URL url) at line 147 and second in
loadDefinition(String url) at line 201.


On Mon, Mar 3, 2008 at 4:22 PM, Christopher Cheng 

[EMAIL PROTECTED] wrote:


wsdl is indeed cached in WSDLManagerImpl.definitionsMap

After reading the codes, I have some questions. My workstation
is a PentiumD 3GHz with 1.5GB RAM

In the class 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buil
dSer viceFromWSDL(String url),
setService(factory.create()); takes 3 seconds
getDataBinding().initialize(getService()); takes 2 seconds

These 2 methods are called even in 2nd calls. Can you also cache
the services perhaps using jakarta commons-pool? or eh-cache?

By the way, I found that the wsdl is put into the definitionMap
twice if  WSDLManagerImpl.getDefinition(URL url) is called.
First in getDefintion(URL url) at line 147 and second in
loadDefinition(String url) at line 201.



On Mon, Mar 3, 2008 at 9:43 AM, Willem Jiang
[EMAIL PROTECTED]

wrote:
  

Hi,

I just went through the code, we really cache the WSDL
definition in CXF.
Could you send your test case and wsdl file to me ? I may need
to trace it for more information.

Regards,

Willem

Christopher Cheng wrote:


I think the issue is still there. I used a for loop to
execute the
  

same



call, all takes approximately the same time to create
service. I guess
  

that



the service itself is not cached.

On Sun, Mar 2, 2008 at 11:43 AM, Willem Jiang
[EMAIL PROTECTED]

wrote:
  

Here is the JIRA[1] which describe the same thing that you
want. I don't know if it was really resolved, could you try
the latest released CXF 2.0.4 for it.

If the issue is still there, please let me know , I will
put it to my next week todo list.

[1]https://issues.apache.org/jira/browse/CXF-699
[2]http://cwiki.apache.org/CXF/download.html

Willem.

Christopher Cheng wrote:


I am migrating from Axis1.2 to CXF 2.0.3

I understand that it will take a long time to build for
the first
  

time.



What



I am wondering is that why it takes so long for the second
and third
  

time?



Is there any caching of services? Axis does not seem to
have this
  

issue.



Christopher Cheng wrote:
  

Attached is the log

- Original Message -
From: Willem Jiang [EMAIL PROTECTED]
To: cxf-user@incubator.apache.org
Sent: Saturday, March 01, 2008 8:53 PM
Subject: Re: service caching?



Hi

Could you set the logger level to FINE ?
So we can get more information about the service
publishing.

Willem.

Christopher Cheng wrote:
  

When I

Re: Rampart and CXF

2008-03-04 Thread Willem Jiang

Hi,

You just use the FooService (client) as usual. The cxfClient will build 
up the interceptors each time before it send out the message when you 
invoke the client proxy method.

I will update the wiki as you suggested.

BTW,  You could also add the interceptor through the  
ClientProxyFactoryBean by calling

clientProxyFactoryBean.getInInterceptor().add(myInterceptor);

Willem.

John-M Baker wrote:

Hi,

Thanks for your response. Having read the Wiki, I still appear to be 
missing something:


FooService client = ... ; // created from ClientProxyFactoryBean or 
generated JAX-WS client

MyInterceptor myInterceptor = new MyInterceptor();

Client cxfClient = ClientProxy.getClient(client);
cxfClient.getInInterceptor().add(myInterceptor);

What do I do with cxfClient? How do I make a call on FooService (client) 
and invoke the interceptor? I'm assuming the call is made through Client. 
Does it really involve the invoke methods on Client? I think that by 
adding an example call to the end fo that code sample, the Wiki would make 
a little more sense.



John Baker
  




Re: Maven generate-sources target issues

2008-03-04 Thread Willem Jiang

Hi,

Please add the below repository into your pom:
repositories
  repository
 idjava.net/id
 urlhttp://download.java.net/maven/1//url
 layoutlegacy/layout
   /repository
/repositories
Then you will get the jar.

Willem

Bjorn Townsend wrote:

Hello,

I'm trying to generate sources for a client using the wsdl2java Maven 
plugin for CXF with the generate-sources target described in the docs, 
and it seems to depend on a nonexistent dependency:


Missing:
--
1) com.sun.xml.bind:jaxb-impl:jar:2.0.5

  Try downloading the file manually from the project website.

  Then, install it using the command:
  mvn install:install-file -DgroupId=com.sun.xml.bind 
-DartifactId=jaxb-impl \

  -Dversion=2.0.5 -Dpackaging=jar -Dfile=/path/to/file

  Path to dependency:
  1) com.mydomain:myproject:jar:1.0.0
  2) org.apache.cxf:cxf-rt-core:jar:2.0.4-incubator
  3) com.sun.xml.bind:jaxb-impl:jar:2.0.5

--
1 required artifact is missing.

for artifact:
  com.mydomain:myproject:jar:1.0.0

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  apache.incubating.releases 
(http://people.apache.org/repo/m2-incubating-repository)



Googling around has shown me that this issue has cropped up when 
trying to build the 2.0.5 snapshots, but I'm using the 2.0.4 release 
version. Is there any way I can work around this problem?


Thanks,
Bjorn





Re: service caching

2008-03-03 Thread Willem Jiang

Yes,  create the service and initialize the data binding take lots of time.

Since CXF build a new service and data binding for each endpoint , I 
think we could cached the service object with the service name. This 
feature is useful for a big WSDL with one service and several ports.


Any thought?

For the WSDLManagerImpl.getDefinition(), one put is taking the URL as the KEY 
and the other put is using the url.toString() as the Key.


Willem.

Christopher Cheng wrote:

wsdl is indeed cached in WSDLManagerImpl.definitionsMap

After reading the codes, I have some questions. My workstation is a PentiumD
3GHz with 1.5GB RAM

In the class 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(String
url),
setService(factory.create()); takes 3 seconds
getDataBinding().initialize(getService()); takes 2 seconds

These 2 methods are called even in 2nd calls. Can you also cache the
services perhaps using jakarta commons-pool? or eh-cache?

By the way, I found that the wsdl is put into the definitionMap twice if 
WSDLManagerImpl.getDefinition(URL url) is called. First in
getDefintion(URL url) at line 147 and second in loadDefinition(String
url) at line 201.


On Mon, Mar 3, 2008 at 4:22 PM, Christopher Cheng 
[EMAIL PROTECTED] wrote:

  

wsdl is indeed cached in WSDLManagerImpl.definitionsMap

After reading the codes, I have some questions. My workstation is a
PentiumD 3GHz with 1.5GB RAM

In the class 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(String
url),
setService(factory.create()); takes 3 seconds
getDataBinding().initialize(getService()); takes 2 seconds

These 2 methods are called even in 2nd calls. Can you also cache the
services perhaps using jakarta commons-pool? or eh-cache?

By the way, I found that the wsdl is put into the definitionMap twice if 
WSDLManagerImpl.getDefinition(URL url) is called. First in
getDefintion(URL url) at line 147 and second in loadDefinition(String
url) at line 201.



On Mon, Mar 3, 2008 at 9:43 AM, Willem Jiang [EMAIL PROTECTED]
wrote:



Hi,

I just went through the code, we really cache the WSDL definition in
CXF.
Could you send your test case and wsdl file to me ? I may need to trace
it for more information.

Regards,

Willem
Christopher Cheng wrote:
  

I think the issue is still there. I used a for loop to execute the


same
  

call, all takes approximately the same time to create service. I guess


that
  

the service itself is not cached.

On Sun, Mar 2, 2008 at 11:43 AM, Willem Jiang [EMAIL PROTECTED]
wrote:




Here is the JIRA[1] which describe the same thing that you want.
I don't know if it was really resolved, could you try the latest
released CXF 2.0.4 for it.

If the issue is still there, please let me know , I will put it to my
next week todo list.

[1]https://issues.apache.org/jira/browse/CXF-699
[2]http://cwiki.apache.org/CXF/download.html

Willem.

Christopher Cheng wrote:

  

I am migrating from Axis1.2 to CXF 2.0.3

I understand that it will take a long time to build for the first


time.
  

What

  

I am wondering is that why it takes so long for the second and third



time?

  

Is there any caching of services? Axis does not seem to have this


issue.
  


Christopher Cheng wrote:




Attached is the log

- Original Message -
From: Willem Jiang [EMAIL PROTECTED]
To: cxf-user@incubator.apache.org
Sent: Saturday, March 01, 2008 8:53 PM
Subject: Re: service caching?




  

Hi

Could you set the logger level to FINE ?
So we can get more information about the service publishing.

Willem.

Christopher Cheng wrote:




When I call the service as a client, it takes 5 seconds to load.
  

I am
  

not
sure whether it takes 5 seconds to create the service or it takes
  

5
  

seconds
to look up for ciper filters. I am wondering if the services are
cached...
 Feb 29, 2008 2:14:42 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
INFO: Creating Service
{https://webservices.sabre.com/websvc}OTA_HotelAvailServicehttps://webservices.sabre.com/websvc%7DOTA_HotelAvailService
  

https://webservices.sabre.com/websvc%7DOTA_HotelAvailServicefrom WSDL:
  

file:/C:/Java/abacus-webconnect-1.14.0.rc1

  

/wsdl/OTA_HotelAvailLLS1.4.1RQ.wsdl

  

Feb 29, 2008 2:14:47 PM org.apache.cxf.transport.https.SSLUtils
getCiphersuites
INFO: The cipher suites have not been configured, falling back to

  

cipher

  

suite filters.
Feb 29, 2008 2:14:47 PM org.apache.cxf.transport.https.SSLUtils
getCiphersFromList
INFO: The cipher suites have been set to
  

SSL_RSA_WITH_RC4_128_MD5,
  

SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_DES_CBC_SHA,
SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA

Re: Illegal Protocol https for HTTP URLConnection Factory

2008-03-02 Thread Willem Jiang

What's your 2nd CXF Client 's configuration?
Did you set the Client Parameters for it ?
Here is one http conduit per client in CXF.

Willem

yulinxp wrote:

My excitement for my first CXF client connection didn't last long.
Now I have another problem for my 2nd CXF client connection to 
https://mdf.ingenixmedpoint.com/mdfwebservices/hpretriever.asmx?WSDL


 
The same exception happens even after I set httpconduit SSL.

Why it would get a HTTP URLConnection Factory at the first  place??
:confused: 


org.apache.cxf.interceptor.Fault: Could not send Message.
at
org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:48)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
at $Proxy27.getHealthProfileNDA(Unknown Source)
at
https.mdf_ingenixmedpoint_com.mdfwebservices.hpretriever.HPRetrieverWSSoap_HPRetrieverWSSoap_Client.main(HPRetrieverWSSoap_HPRetrieverWSSoap_Client.java:57)
Caused by: java.io.IOException: Illegal Protocol https for HTTP
URLConnection Factory.
at
org.apache.cxf.transport.http.HttpURLConnectionFactoryImpl.createConnection(HttpURLConnectionFactoryImpl.java:44)
at 
org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:474)
at
org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
... 7 more
Exception in thread main javax.xml.ws.soap.SOAPFaultException: Could not
send Message.
at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
at $Proxy27.getHealthProfileNDA(Unknown Source)
at
https.mdf_ingenixmedpoint_com.mdfwebservices.hpretriever.HPRetrieverWSSoap_HPRetrieverWSSoap_Client.main(HPRetrieverWSSoap_HPRetrieverWSSoap_Client.java:57)
Caused by: org.apache.cxf.interceptor.Fault: Could not send Message.
at
org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:48)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
... 2 more
Caused by: java.io.IOException: Illegal Protocol https for HTTP
URLConnection Factory.
at
org.apache.cxf.transport.http.HttpURLConnectionFactoryImpl.createConnection(HttpURLConnectionFactoryImpl.java:44)
at 
org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:474)
at
org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
... 7 more

  




Re: service caching

2008-03-01 Thread Willem Jiang

Here is the JIRA[1] which describe the same thing that you want.
I don't know if it was really resolved, could you try the latest 
released CXF 2.0.4 for it.


If the issue is still there, please let me know , I will put it to my 
next week todo list.


[1]https://issues.apache.org/jira/browse/CXF-699
[2]http://cwiki.apache.org/CXF/download.html

Willem.

Christopher Cheng wrote:

I am migrating from Axis1.2 to CXF 2.0.3

I understand that it will take a long time to build for the first time. What
I am wondering is that why it takes so long for the second and third time?
Is there any caching of services? Axis does not seem to have this issue.



Christopher Cheng wrote:
  

Attached is the log

- Original Message - 
From: Willem Jiang [EMAIL PROTECTED]

To: cxf-user@incubator.apache.org
Sent: Saturday, March 01, 2008 8:53 PM
Subject: Re: service caching?




Hi

Could you set the logger level to FINE ?
So we can get more information about the service publishing.

Willem.

Christopher Cheng wrote:
  

When I call the service as a client, it takes 5 seconds to load. I am
not
sure whether it takes 5 seconds to create the service or it takes 5 
seconds
to look up for ciper filters. I am wondering if the services are 
cached...

 Feb 29, 2008 2:14:42 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
INFO: Creating Service
{https://webservices.sabre.com/websvc}OTA_HotelAvailService from WSDL:
file:/C:/Java/abacus-webconnect-1.14.0.rc1/wsdl/OTA_HotelAvailLLS1.4.1RQ.wsdl
Feb 29, 2008 2:14:47 PM org.apache.cxf.transport.https.SSLUtils
getCiphersuites
INFO: The cipher suites have not been configured, falling back to cipher
suite filters.
Feb 29, 2008 2:14:47 PM org.apache.cxf.transport.https.SSLUtils
getCiphersFromList
INFO: The cipher suites have been set to SSL_RSA_WITH_RC4_128_MD5,
SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_DES_CBC_SHA,
SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA,
SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA,
SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA,
SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, SSL_RSA_WITH_NULL_MD5,
SSL_RSA_WITH_NULL_SHA, SSL_DH_anon_WITH_RC4_128_MD5,
TLS_DH_anon_WITH_AES_128_CBC_SHA, SSL_DH_anon_WITH_3DES_EDE_CBC_SHA,
SSL_DH_anon_WITH_DES_CBC_SHA, SSL_DH_anon_EXPORT_WITH_RC4_40_MD5,
SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA, TLS_KRB5_WITH_DES_CBC_SHA,
TLS_KRB5_WITH_DES_CBC_MD5, TLS_KRB5_EXPORT_WITH_RC4_40_SHA,
TLS_KRB5_EXPORT_WITH_RC4_40_MD5, TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA,
TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5.  Feb 29, 2008 2:14:48 PM
org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
 I have put this in my cxf.xml as in
http://cwiki.apache.org/CXF20DOC/client-http-transport.html, but it 
doesn't

help... http:conduit name=*.http-conduit
http:tlsClientParameters secureSocketProtocol=SSL
sec:cipherSuitesFilter
!-- these filters ensure that a ciphersuite with
export-suitable or null encryption is used,
but exclude anonymous Diffie-Hellman key change as
this is vulnerable to man-in-the-middle attacks --
sec:include.*_EXPORT_.*/sec:include
sec:include.*_EXPORT1024_.*/sec:include
sec:include.*_WITH_DES_.*/sec:include
sec:include.*_WITH_NULL_.*/sec:include
sec:exclude.*_DH_anon_.*/sec:exclude
/sec:cipherSuitesFilter
/http:tlsClientParameters
/http:conduit


  
 http://www.nabble.com/file/p15773252/cxf.log cxf.log 




  




Re: soap address question

2008-02-20 Thread Willem Jiang


yulinxp wrote:

Using browser, when type in the url defined in soap:address,
browser should be able to locate the page, right?
  

It depends on the service implementation.
CXF support to use http get method to access the service , you can find 
more information  here[1]

1) For example, for ebay wsdl
http://developer.ebay.com/webservices/latest/ShoppingService.wsdl

wsdlsoap:address location=http://open.api.ebay.com/shopping/

using browser to access http://open.api.ebay.com/shopping

Not Found
The requested URL /shopping was not found on this server.

Is this still correct? 


2) I have another NET wsdl which define soap:address like this,
soap:address location=http://aaa.company.com/service/request.asmx/
Use browser to access http://aaa.company.com/service/request.asmx , it
returns

Server not found
Firefox can't find the server at aaa.company.com.

Is this right? Is the error the same with previouse ebay example?
 Using CXF client to connect, it returns  
Caused by: java.net.UnknownHostException: aaa.company.com 
  

Can you get the IP address by ping aaa.company.com?


[1]The James Mao Chinese blog
http://maomaode.bokeland.com/blog/3/187/2006/12/02/103205

Willem.


Re: client code to access java_first_jaxws on tomcat

2008-02-19 Thread Willem Jiang

Hi Dan,

You set the wrong endpointAddress.

http://localhost:8080/helloworld/services/hello_world?wsdl; is the 
service wsdl url. 

you need to set the endpointAddress to be 
http://localhost:8080/helloworld/services/hello_world;


Willem 



Daniel Lipofsky wrote:

I am trying to learn CXF, I have installed the java_first_jaxws
sample on Tomcat 5.5 and can see the wsdl at
http://localhost:8080/helloworld/services/hello_world?wsdl

But what I don't understand is how I can run webservices
against that server.  Does anyone have client code that will
allow me to test?  I tried modifying Client.java like this:

private static final QName SERVICE_NAME
= new QName(http://server.hw.demo/;, HelloWorld);
private static final QName PORT_NAME
= new QName(http://server.hw.demo/;, HelloWorldPort);

public static void main(String args[]) throws Exception {
Service service = Service.create(SERVICE_NAME);
String endpointAddress =
http://localhost:8080/helloworld/services/hello_world?wsdl;;
service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING,
endpointAddress);
HelloWorld hw = service.getPort(HelloWorld.class);
System.out.println(hw.sayHi(World));
}

but all I got was

org.apache.cxf.binding.soap.SoapFault:
http://schemas.xmlsoap.org/wsdl/;,
the namespace on the definitions element, is not a valid SOAP version.

I tried a bunch of variations too with no success.
How does one make this work?  (I'd also appreciate
an example for wsdl_first_soap12 or any of the others)

Thanks,
Dan

  




Re: JAX-RS in 2.0.4-incubator?

2008-02-17 Thread Willem Jiang

Hi Tom,

JAX-RS support is only in the CXF 2.1.

Willem.
Tom Davies wrote:
Is JAX-RS support in 2.0.4, or only in 2.1? If it is in 2.0.4, which 
jars do I need (I can't find cxf-rt-frontend-jaxrs)


Thanks,
  Tom
--
ATLASSIAN - http://www.atlassian.com
Our products help over 8,500 customers in more than 95 countries to 
collaborate











Re: how to configure HTTPConduit for client using java code

2008-02-14 Thread Willem Jiang

Hi ,

I think the default Data Binding in the ServiceFactory is JaxbDatabinding.
That's why you need to do when you want to use AegisDatabinding.

Willem.

yulinxp wrote:

Why/when is it needed to set AegisDatabinding for client at all ?

  ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
  factory.setServiceClass(HelloWorld.class);
  factory.setAddress();
  factory.getServiceFactory().setDataBinding(new AegisDatabinding()); 
  HelloWorld hw = (HelloWorld)factory.create();
  




Re: Lazy instantiation of Web Service Client

2008-02-12 Thread Willem Jiang

Hi Richard
Hi

For the client instantiation, it just need to create the service 
model[1] first.


If you add the wsdlLocation attribute in your SEI's WebService 
annotation or specify the wsdlLocation property for the 
JaxWsProxyFactoryBean with your service endpoint's address, the client 
will hit the service before you call the proxy's operation.


Otherwise the client will not access service endpoint the before your 
start to call the proxy's operation.


[1]http://cwiki.apache.org/CXF20DOC/cxf-architecture.html#CXFArchitecture-TheServiceModel

Willem

rsheldon wrote:

I've just started using CXF with Spring. I'm only using it to create SOAP WS
clients (code generated from WSDL using CXF maven tools). 


I'd like to be able to have the services not connect on startup, but wait
until they are first used - ie. lazy instantiation. Can this be done in CXF?
Here's my very simple client configuration:

bean id=accountProxyFactory
class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean
  property name=serviceClass value=my.web.service.AccountService/
  property name=address value=${account.service}/
/bean

bean id=accountService class=my.web.service.AccountService
  factory-bean=accountProxyFactory factory-method=create/

I can't see any attribute I can set on JaxWsProxyFactoryBean or it's parent
ClientProxyFactoryBean that looks like it would work. There is a
properties property, but I can't find a reference to the valid
properties/values I can put into this map. 


Can anyone help?? Is there an attribute or property I can set to prevent
immediate creation of the service?  


Many thanks,
Richard

Thanks
Richard
  




Re: JMS connect exception, but service published

2008-02-06 Thread Willem Jiang

Hi ,

Currently , CXF the destination active method do not throw the Exception 
, and the JMSDestination just swallows the exceptions.

You can fill a JIRA to add a feature request for it.

Willem.

Mayank Thakore wrote:

Hi,

When publishing a web service on jms transport, if activemq is not running,
an exception log is printed but the service creation is still successful.

I checked service got created using this code:

Endpoint impl = Endpoint.publish(url, object);
if ((impl != null)  impl.isPublished()) {
// success
}

How to check that there has been a problem with the service creation in this
case?

And this is the exception trace:

Feb 6, 2008 9:32:52 AM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
INFO: Creating Service {tmf854.v1.ws}FaultService from WSDL:
wsdl/mtosi1.1/wsdl/services/FaultService.wsdl
Feb 6, 2008 9:32:53 AM org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be jms://AlarmRetrieval
Feb 6, 2008 9:32:53 AM org.apache.cxf.transport.jms.JMSDestination activate
INFO: JMSServerTransport activate() 
Feb 6, 2008 9:32:54 AM org.apache.cxf.transport.jms.JMSDestination activate
SEVERE: JMS connect failed with JMSException : 
javax.jms.JMSException: Could not connect to broker URL:

tcp://localhost:61616. Reason: java.net.ConnectException: Connection
refused: connect
at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java
:33)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(Activ
eMQConnectionFactory.java:280)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(Activ
eMQConnectionFactory.java:214)
at
org.apache.activemq.ActiveMQConnectionFactory.createTopicConnection(ActiveMQ
ConnectionFactory.java:191)
at
org.apache.cxf.transport.jms.JMSProviderHub.connect(JMSProviderHub.java:91)
at
org.apache.cxf.transport.jms.JMSDestination.activate(JMSDestination.java:109
)
at
org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObser
vable.java:47)
at
org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFac
tory.java:166)
at
org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactor
y.java:616)
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:122)
at
org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:232)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179)
at
org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.
java:74)
at javax.xml.ws.Endpoint.publish(Endpoint.java:156)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at
org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:335
)
at
org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:303
)
at
org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:49)
at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:54)
at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:54)
at
org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiato
r.java:66)
at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:54)
at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:54)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(Activ
eMQConnectionFactory.java:265)
... 33 more


Regards
Mayank



 This e-mail and attachments contain confidential information from HUAWEI,
which is intended only for the person or entity whose address is listed
above. Any use of the information contained herein in any way (including,
but not limited to, total or partial disclosure, reproduction, or
dissemination) by persons other than the intended recipient's) is
prohibited. If you receive this e-mail in error, please notify the sender by
phone or email immediately and delete it!




  




Re: Issue with CXF: Marshalling Error: Error writing request body to server

2008-02-05 Thread Willem Jiang

Please take a look at  the wiki page[1],

If you wanted to use MTOM to send the binary part of the message as an 
optimized attachment you would need to add the 
xmime:expectedContentTypes attribute to the element containing the 
binary data. This attribute is defined in the 
http://www.w3.org/2005/05/xmlmime^ namespace and specifies the MIME 
types that the element is expected to contain. You can specify a comma 
separated list of MIME types. The setting of this attribute will change 
how the code generators create the JAXB class for the data. For most 
MIME types, the code generator will create a DataHandler. Some MIME 
types, such as those for images, have defined mappings.


Please make sure the code generator create the right DataHandler :)

[1]http://cwiki.apache.org/CXF20DOC/mtom.html

Willem.
Tor Arne Kvaløy wrote:

Hey, and thanks for answering so quickly.

No, I don't have MTOM enabled, but I do have a byte[] datatype which is
expressed as
xs:element minOccurs=0 name=data type=xs:base64Binary/ in the wsdl.

I do wish to use MTOM in the future, but for now I wish to send it as
base64.

Do I need to enable MTOM in order to send a simple byte[] as base64?

Regards,
Tor


Tor Arne Kvaløy wrote:
  

Hello!

I have ran into a serious problem with CXF on the client side.  I have
tried quite a few things but I am right now quite stuck, and I hope that
you guys have any suggestions. The full stacktrace is in this mail.

I get the same error both with 2.0.3 and 2.0.4. Can it be an issue with
JAXB, I am using jaxb-impl 2.0.5 from the sun-site.

The following error is given when I invoke the web service method.
SubmitDataService service = new SubmitDataService();
ISubmitData port = service.getSubmitDataPort();
boolean ret = port.submitData(setId, setName, fileName, getData(fileName),
list);


INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: Error writing request
body to server
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:207)
at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:63)
at
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:84)
at
org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
at $Proxy26.submitData(Unknown Source)
at com.pointcarbon.mule.SubmitDataClient.main(SubmitDataClient.java:85)
Caused by: javax.xml.bind.MarshalException
 - with linked exception:
[java.io.IOException: Error writing request body to server]
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:297)
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:221)
at
javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:70)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:360)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:187)
... 10 more
Caused by: java.io.IOException: Error writing request body to server
at
sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:2261)
at
sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:2244)
at
org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:45)
at
org.apache.cxf.io.CacheAndWriteOutputStream.write(CacheAndWriteOutputStream.java:64)
at
com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.flushBuffer(UTF8XmlOutput.java:351)
at
com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.text(UTF8XmlOutput.java:304)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Base64Data.writeTo(Base64Data.java:263)
at
com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.text(UTF8XmlOutput.java:251)
at
com.sun.xml.bind.v2.runtime.XMLSerializer.leafElement(XMLSerializer.java:312)
at
com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$PcdataImpl.writeLeafElement(RuntimeBuiltinLeafInfoImpl.java:140)
at
com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.writeLeafElement(TransducedAccessor.java:214)
at
com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.serializeBody(SingleElementLeafProperty.java:62)
at
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:286)
at

Re: Query About Request Context

2008-02-04 Thread Willem Jiang

FYI,  currently we have some a JIRA[1] for tracing this issue.

https://issues.apache.org/jira/browse/CXF-1410


Willem.

SantoshAkhilesh wrote:

Hi,
So far I had an idea that request context is put in thread local but I
realized it is not.

Why the request context is not threadlocal ?

If I want to send multiple client requests and each request having different
JMS header using same BindingProvider instance then do I need to synchronize
the context or not ?

I think now it needs to synchronized else it is overwritten by subsequent
calls.

Can anyone shed a light on this.

Regards,
Santosh

  




Re: Query About Request Context

2008-02-04 Thread Willem Jiang

This link [1] may help your to get the whole story.
[1]http://www.nabble.com/Request-ResponseContext-of-JaxWsClientProxy-td10327781.html#a10335673

Willem.
Sky-Tiger wrote:

See this:

public class JaxWsClientProxy extends org.apache.cxf.frontend.ClientProxy
implements
InvocationHandler, BindingProvider {

private static final Logger LOG =
LogUtils.getL7dLogger(JaxWsClientProxy.class);

protected MapString, Object requestContext = new
ConcurrentHashMapString, Object();

protected ThreadLocal MapString, Object responseContext =
new ThreadLocalMapString, Object();


Anybody can tell me why responseContext  is threadlocal but requestContext 
is not? That means BindingProvider  is not thread-safe!


Is it a bug?
  




Re: Issue with CXF: Marshalling Error: Error writing request body to server

2008-02-04 Thread Willem Jiang

Hi,

Did you enable the MTOM feature?
Please refer the below link for more information.
http://cwiki.apache.org/CXF20DOC/mtom.html

Willem.
Tor Arne Kvaløy wrote:

Hello!

I have ran into a serious problem with CXF on the client side.  I have tried
quite a few things but I am right now quite stuck, and I hope that you guys
have any suggestions. The full stacktrace is in this mail.

I get the same error both with 2.0.3 and 2.0.4. Can it be an issue with
JAXB, I am using jaxb-impl 2.0.5 from the sun-site.

The following error is given when I invoke the web service method.
SubmitDataService service = new SubmitDataService();
ISubmitData port = service.getSubmitDataPort();
boolean ret = port.submitData(setId, setName, fileName, getData(fileName),
list);


INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: Error writing request
body to server
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:207)
at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:63)
at
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:84)
at
org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
at $Proxy26.submitData(Unknown Source)
at com.pointcarbon.mule.SubmitDataClient.main(SubmitDataClient.java:85)
Caused by: javax.xml.bind.MarshalException
 - with linked exception:
[java.io.IOException: Error writing request body to server]
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:297)
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:221)
at
javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:70)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:360)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:187)
... 10 more
Caused by: java.io.IOException: Error writing request body to server
at
sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:2261)
at
sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:2244)
at
org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:45)
at
org.apache.cxf.io.CacheAndWriteOutputStream.write(CacheAndWriteOutputStream.java:64)
at
com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.flushBuffer(UTF8XmlOutput.java:351)
at
com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.text(UTF8XmlOutput.java:304)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Base64Data.writeTo(Base64Data.java:263)
at
com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.text(UTF8XmlOutput.java:251)
at
com.sun.xml.bind.v2.runtime.XMLSerializer.leafElement(XMLSerializer.java:312)
at
com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$PcdataImpl.writeLeafElement(RuntimeBuiltinLeafInfoImpl.java:140)
at
com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.writeLeafElement(TransducedAccessor.java:214)
at
com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.serializeBody(SingleElementLeafProperty.java:62)
at
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:286)
at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:619)
at
com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:113)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:98)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:127)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:244)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:251)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:33)
at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:461)
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:292)
... 14 more
Exception in thread Main Thread javax.xml.ws.soap.SOAPFaultException:
Marshalling Error: Error writing request body to server
at 

Re: WebSecurity error when using Simple Frontend / Aegis binding

2008-02-04 Thread Willem Jiang

Hi ,

There are some difference between the simple front end and jaxws front 
end to detail with the fault message.


The WebFault annotation will take effect when you are using the jaxws 
front end ,
but when you using simple front you need let the exception class 
inherit  the org.apache.cxf.frontend.FaultInfoException class.


You can find some more information by digging the 
RefactionServiceFactoryBean [1] 's initializeFaults() method.


[1] 
https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java


Willem.

yulinxp wrote:

Looking at src for FaultOutInterceptor.java, BindingOperationInfo op is null!
This only happens for  Simple Frontend/Aegis binding, not for JAX-WS
Frontend/JAXB binding.
Is there a way to let it work? I am using cxf-2.0.3.


  public FaultInfo getFaultForClass(BindingOperationInfo op, Class class1) {
for (BindingFaultInfo bfi : op.getFaults()) {

FaultInfo faultInfo = bfi.getFaultInfo();
Class? c =
(Class)faultInfo.getProperty(Class.class.getName());
if (c.isAssignableFrom(class1)) {
return faultInfo;
}
}

return null;
}

---

///tomcat CXF server exception
 
INFO: Interceptor has thrown exception, unwinding now

java.lang.NullPointerException
at
org.apache.cxf.interceptor.FaultOutInterceptor.getFaultForClass(FaultOutInterceptor.java:
128)
at
org.apache.cxf.interceptor.FaultOutInterceptor.handleMessage(FaultOutInterceptor.java:61)

at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
at
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultCha
inInitiatorObserver.java:90)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:224)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:7
3)
at
org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:79)

at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.ja
va:256)
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
at
org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:170)
at
org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:148)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja
va:584)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)

What's working for JAX-WS Frontend / JAXB binding does not work for Simple
Frontend / Aegis binding.
Is there anything wrong with my xml? How to fix it?


  




Re: HttpSession and Endpoints

2008-02-03 Thread Willem Jiang
Basically we store the stateful information into the message context, 
and the interceptor get the stateful information from the message context.
Maybe you can put your own SessionManager into the message context and 
pass it to the interceptor that you use.


Willem.

Chris Campbell wrote:

If I understand the code correctly, the HttpConduit holds the
session in a private field with no accessor method, and manages the
session itself. So I think I have to use an interceptor to set the
cookie on the other proxies.

My current work around (I think similar to what you suggested) is to
turn off the maintainSession on the conduit and have my own
SessionManager that an inbound interceptor can access and set when
the Set-Cookie comes back from the first request, and an outbound
interceptor can access and set the cookie header for any other
request, whichever proxy is making the request.

So the SessionManager is stateful, but not the interceptors. But the
interceptors do call into my application code, is that a bad practice?

Willem Jiang wrote:
  

It is not easy to share the http conduit between the different proxy,
since you need to hack the HttpTransportFactory and handle
theconfiguration of the http conduit.

I don't think using the interceptor could resolve the problem that you
met. Because when you using the
interceptor to hold the first session cookie, you will make the
interceptor stateful. We do not want the interceptor
be stateful to avoid lock the multi thread calling.

My suggestion is
We could put the cookie into the message context for application code to
access and reset.
Then you can get the cookie from the first proxy in your application
code and then set cookie to the
second proxy to get around it.

Thoughts?

Willem.


Chris Campbell wrote:


That would have to be on the client side, correct? I think I would
need to have a client side inInterceptor to do that.

I tend to load the proxies as needed, is there a way to probe the
bus to get any other loaded proxies so that a lazily instantiated
proxy can get a previously acquired session cookie from another?
Maybe the inInterceptor can just stash away the first session cookie
acquired, and an outInterceptor can apply it to any request. Any
thoughts as to what the best practice would be?

I guess a feature request would be to be able to share an
http-conduit between proxies. I kind of think of the http-conduit as
an http client, is that bad analogy?

Thanks for the insight, definitely narrowing in on a solution.


Daniel Kulp wrote:
 
  

Oh.  Yea.   That would definitely do it.  Good catch.   Each client
proxy holds it's own conduit and thus the cookie for the session is
stored there is unique for each proxy.

Most likely, you will need to do some cookie management your self. 
Grab the protocol headers from the response headers and set them in

the request headers for all the proxies. You can use the
org.apache.cxf.transport.http.Cookie class to help with the
parsing/setting.

Dan


On Friday 01 February 2008, Chris Campbell wrote:
   


The problem is that I get a different session for different
endpoints, maybe its how I set the client up? I do set the client up
in java code rather than with xml config, so maybe I am doing
something wrong there. Is it possible that each service interface is
getting a different http-conduit?

Daniel Kulp wrote:
 
  

On Friday 01 February 2008, Chris Campbell wrote:
   


I am using CXFServlet in tomcat, and intend to load balance
instances of them with apache mod_jk, and want to use sticky
sessions.

I figure I have to create a session somewhere, as I do not see a
session created (JSESSIONID ?) automatically. For reasons not worth
going into, I do not need the session for state, beyond making sure
that the sticky-ness works on the load-balancer.

I have tried getting the HttpServletRequest in an interceptor
(USER_LOGICAL phase) and creating an HttpSession if there is none,
and it seems to work.

The problem is that I have a few soap endpoints at different URLs,
and the session seems to be created for each endpoint, so calls to
Service /Foo gets on session and /Bar another. This causes my
sticky session load balancer to send /Foo to one of the load
balanced CXFServlet and /Bar to another .

Is there some way to create the Session so that it is valid for all
the service endpoints? Is setting the Session in an interceptor a
bad idea?
  
  

That should be completely fine assuming that works with tomcat.
This really is a tomcat question which I don't really know much
about.   I would assume if all the endpoints are on the CXFServlet
instance they would have properly shared the session.   If they are
in separate wars, maybe not.   I don't know know enough about the
servlet spec to know what the rules are around that.




  
  



  




Re: HttpSession and Endpoints

2008-02-02 Thread Willem Jiang

It is not easy to share the http conduit between the different proxy,
since you need to hack the HttpTransportFactory and handle 
theconfiguration of the http conduit.


I don't think using the interceptor could resolve the problem that you 
met. Because when you using the
interceptor to hold the first session cookie, you will make the 
interceptor stateful. We do not want the interceptor

be stateful to avoid lock the multi thread calling.

My suggestion is
We could put the cookie into the message context for application code to 
access and reset.
Then you can get the cookie from the first proxy in your application 
code and then set cookie to the

second proxy to get around it.

Thoughts?

Willem.


Chris Campbell wrote:

That would have to be on the client side, correct? I think I would
need to have a client side inInterceptor to do that.

I tend to load the proxies as needed, is there a way to probe the
bus to get any other loaded proxies so that a lazily instantiated
proxy can get a previously acquired session cookie from another?
Maybe the inInterceptor can just stash away the first session cookie
acquired, and an outInterceptor can apply it to any request. Any
thoughts as to what the best practice would be?

I guess a feature request would be to be able to share an
http-conduit between proxies. I kind of think of the http-conduit as
an http client, is that bad analogy?

Thanks for the insight, definitely narrowing in on a solution.


Daniel Kulp wrote:
  
Oh.  Yea.   That would definitely do it.  Good catch.   Each client proxy 
holds it's own conduit and thus the cookie for the session is stored 
there is unique for each proxy.


Most likely, you will need to do some cookie management your self.  Grab 
the protocol headers from the response headers and set them in the 
request headers for all the proxies. You can use the 
org.apache.cxf.transport.http.Cookie class to help with the 
parsing/setting.


Dan


On Friday 01 February 2008, Chris Campbell wrote:


The problem is that I get a different session for different
endpoints, maybe its how I set the client up? I do set the client up
in java code rather than with xml config, so maybe I am doing
something wrong there. Is it possible that each service interface is
getting a different http-conduit?

Daniel Kulp wrote:
  

On Friday 01 February 2008, Chris Campbell wrote:


I am using CXFServlet in tomcat, and intend to load balance
instances of them with apache mod_jk, and want to use sticky
sessions.

I figure I have to create a session somewhere, as I do not see a
session created (JSESSIONID ?) automatically. For reasons not worth
going into, I do not need the session for state, beyond making sure
that the sticky-ness works on the load-balancer.

I have tried getting the HttpServletRequest in an interceptor
(USER_LOGICAL phase) and creating an HttpSession if there is none,
and it seems to work.

The problem is that I have a few soap endpoints at different URLs,
and the session seems to be created for each endpoint, so calls to
Service /Foo gets on session and /Bar another. This causes my
sticky session load balancer to send /Foo to one of the load
balanced CXFServlet and /Bar to another .

Is there some way to create the Session so that it is valid for all
the service endpoints? Is setting the Session in an interceptor a
bad idea?
  
That should be completely fine assuming that works with tomcat. 
This really is a tomcat question which I don't really know much

about.   I would assume if all the endpoints are on the CXFServlet
instance they would have properly shared the session.   If they are
in separate wars, maybe not.   I don't know know enough about the
servlet spec to know what the rules are around that.




  




Re: Leaving CXF for Glasshfish Metro

2008-02-01 Thread Willem Jiang
AFAIK you just have trouble to create the DynamicClientFactory instance, 
which mainly create the CXF bus instance.


I think you can try out to deploy the basic simples into your Tomcat6. 
May be it will show you the key of the issue.


You can download the CXF kit here[1] , and try the 
$CXF_HOME\samples\wsdl_first


[1]http://cwiki.apache.org/CXF/download.html

Willem.

Phil Gibbs wrote:

Being a selfish soul, I'd like to see a Dynamic Client example.  I saw one on
this forum and sort of used that code to create my own but it throws an
exception creating an instance of DynamicClientFactory as in,
DynamicClientFactory dcf = DynamicClientFactory.newInstance();
The exception provides zero info and there's nothing in the log (on Tomcat
6)
By the way I'm trying to invoke a service that I wrote in my XFire days. 
Using Dynamic Client in XFire it works fine.

Any help greatly appreciated.  Oh, I'm also trying to build with Maven as i
did when using XFire, but I cannot get it to work even when pointing to the
CXF artifacts.


dkulp wrote:
  
OK.   Let's flip this around a bit...   Describe the type of example that 
would (or would have) helped you do what you wanted to do.  We can work 
to get one in place.


CXF has a bunch of samples already that cover a large variety of 
different configuations and samples.  Knowing where they are deficient 
can help us get them improved.


Dan


On Thursday 31 January 2008, Phil Gibbs wrote:


Well, I have to agree.  The docs seem to be the last thing that a
developer thinks about - because it's so obvious right?  CXF, like a
lot of software, badly needs some end to end examples at the very
least.
Currently, it's very lacking, as was XFire!

Mayank Thakore-2 wrote:
  

well, i have spent a lot of time getting cxf to work.
but migrating from xfire, our code reduced from about 1200 lines to
200 lines.
and i find cxf to be very extensible

but it's not just coincidence that someone was talking about a book
on cxf just today...

Regards
Mayank

On Jan 23, 2008 8:36 PM, jonathan doklovic [EMAIL PROTECTED] wrote:


The point being that since this is a users list (not a dev list) I
thought I'd share my user experience in hopes that it could help
the future of the project.

If all anyone hears about a project is how great it is and never
hears why people choose not to use it, then it never progresses.

I was never able to get CXF working properly simply because of the
lack of simple docs and end-to-end examples.  Maybe it's just that
I don't get it or something, but I feel there are probably a lot of
me's out there that struggle with getting things up and running.

- Jonathan

On Wed, 2008-01-23 at 14:47 +, Sergey Beryozkin wrote:
  

After spending about 2 weeks trying to get a very simple
service to return JSON in CXF, I found the Glassfish Metro
project and it's jaxws-json plugin.
  

What's the point of this post ? Say to the world that you're not
happpy with CXF ?
Or tell everyone that you could've commited a patch after
spending 2 days on it but just didn't get enough time :-) ?

Cheers, Sergey



- Original Message -
From: jonathan doklovic [EMAIL PROTECTED]
To: cxfuser cxf-user@incubator.apache.org
Sent: Wednesday, January 23, 2008 2:37 PM
Subject: Leaving CXF for Glasshfish Metro



Hi,

After spending about 2 weeks trying to get a very simple
service to return JSON in CXF, I found the Glassfish Metro
project and it's jaxws-json plugin.

I gave it a shot and after 2 hours had my service up and
running. Not only that, but the plugin generates pretty api
docs at the
  

endpoint



for me as well as generates a javascript client on the fly.

It was just too easy to make me stick with CXF.

I think CXF is probably a good framework, but the docs and
examples
  

are



in pieces and without real life end-to-end tutorials, it's
really
  

hard



to get things working.

- Jonathan
  


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


Ireland
  


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





  




Re: HttpSession and Endpoints

2008-02-01 Thread Willem Jiang

Yes , CXF do not share the http conduit between the different client proxy.
If you want to share the session between the client proxy, I am afraid 
you need to hack the CXF http conduit code to handle the cookie in you 
application code.


Willem.

Chris Campbell wrote:

The problem is that I get a different session for different
endpoints, maybe its how I set the client up? I do set the client up
in java code rather than with xml config, so maybe I am doing
something wrong there. Is it possible that each service interface is
getting a different http-conduit?

Daniel Kulp wrote:
  

On Friday 01 February 2008, Chris Campbell wrote:


I am using CXFServlet in tomcat, and intend to load balance
instances of them with apache mod_jk, and want to use sticky sessions.

I figure I have to create a session somewhere, as I do not see a
session created (JSESSIONID ?) automatically. For reasons not worth
going into, I do not need the session for state, beyond making sure
that the sticky-ness works on the load-balancer.

I have tried getting the HttpServletRequest in an interceptor
(USER_LOGICAL phase) and creating an HttpSession if there is none,
and it seems to work.

The problem is that I have a few soap endpoints at different URLs,
and the session seems to be created for each endpoint, so calls to
Service /Foo gets on session and /Bar another. This causes my sticky
session load balancer to send /Foo to one of the load balanced
CXFServlet and /Bar to another .

Is there some way to create the Session so that it is valid for all
the service endpoints? Is setting the Session in an interceptor a
bad idea?
  
That should be completely fine assuming that works with tomcat.  This 
really is a tomcat question which I don't really know much about.   I 
would assume if all the endpoints are on the CXFServlet instance they 
would have properly shared the session.   If they are in separate wars, 
maybe not.   I don't know know enough about the servlet spec to know 
what the rules are around that.







  




Re: jms header properties

2008-01-27 Thread Willem Jiang

Hi Mayank,

Here is a systest [1] testContextPropogation() for setting the JMS header.

[1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java

Willem.

Mayank Thakore wrote:

Hi,

How to set header/property fields in outgoing jms messages?

There is lot of configuration examples to set jms destination
properties. But I didn't find any for message properties.

Thanks and Regards
Mayank

  




Re: Problem: When invoke HttpServletRequet.getRemoteAddr(), it return the old client IP...

2008-01-25 Thread Willem Jiang

Hi

Cam you show me how can you get the ctx object ?
If the ctx that you use is get from WebServiceContext which has a thread 
local variable , it is injected to CXF for getting the message context.

I don't know if this can relate to the issue that you met.


Willem.

Prinston wrote:

Dears:

I put some code into a web method to get client IP.

ex:
public boolean recordIP() {
try {
debugInfo.append( ).append(
((HttpServletRequest) ctx
.get(AbstractHTTPDestination.HTTP_REQUEST))
.getRemoteAddr());
return true;
} catch (Exception e) {
return false;
}
}

When the first client from IP1 call this method, it record the IP1 address.
No problem.
But then the second client from IP2 call this method, it SOMETIMES still
record the IP1 address (the old one).
This situation might occur in some condition (ex: after browsing some other
jsp page in other web ap in the same web instance). I am not sure what
condition may cause this problem exactly.

Has anyone got this problem before? Thanks!

My AP configuration: Apache 2.2.24+Tomcat5.5.20(using AJP13
connector)+CXF2.0.1
  




Re: problem using local transport

2008-01-22 Thread Willem Jiang

Hi,

Did you do any setting up the transportIds for the local transport  in 
CXF bus?
You need to override the CXF bus default loading transport factory to 
local transport.


Here are an example of setting the bus with code in the jaxws front end 
test module[1],

and a spring configuration file [2] for the local transport factory.

[1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java
[2]https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml

Willem.

Mayank Thakore wrote:

Hi,
I am trying to use local transport. Like this:

String url = local://HelloService;
Endpoint.publish(url, new HelloServiceImpl());

This client code I found at bottom of user guide's local transport page:
ClientProxyFactoryBean cf = new ClientProxyFactoryBean();
cf.setAddress(url);
cf.setServiceClass(HelloService.class);
HelloService h = (HelloService) cf.create();
System.out.println(h.inverse(false));

HelloService is defined as below:
@WebService
public interface HelloService {
public boolean inverse(
boolean value);

}

I have placed the client code immediately below the publish code. But I get
an exception:



Exception in thread main org.apache.cxf.binding.soap.SoapFault: null while
invoking public boolean
com.huawei.imap.nbiframework.testutil.webservice.HelloServiceImpl.inverse(bo
olean) with params [null].
at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessa
ge(Soap11FaultInInterceptor.java:70)
at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessa
ge(Soap11FaultInInterceptor.java:35)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain
.java:207)
at
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(Abs
tractFaultChainInitiatorObserver.java:90)
at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage
(ReadHeadersInterceptor.java:179)
at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage
(ReadHeadersInterceptor.java:56)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain
.java:207)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:402)
at
org.apache.cxf.transport.local.LocalDestination$SynchronousConduit$1.run(Loc
alDestination.java:88)
at java.lang.Thread.run(Unknown Source)



Regards
Mayank



 This e-mail and attachments contain confidential information from HUAWEI,
which is intended only for the person or entity whose address is listed
above. Any use of the information contained herein in any way (including,
but not limited to, total or partial disclosure, reproduction, or
dissemination) by persons other than the intended recipient's) is
prohibited. If you receive this e-mail in error, please notify the sender by
phone or email immediately and delete it!




  




Re: CXF Servlet setup problem

2008-01-17 Thread Willem Jiang

Yes , here is another way which will not use the

org.springframework.web.context.ContextLoaderListener to start the endpoints.

You can find the example form CXF's hello world examples [1]
As Dan Kulp has said , you don't need imports any of
classpath:META-INF/cxf-.

[1] 
https://svn.apache.org/repos/asf/incubator/cxf/trunk/distribution/src/main/release/samples/wsdl_first/



Willem.
Daniel Kulp wrote:
The CXF servlet always looks for WEB-INF/cxf-servlet.xml and loads it.   
However, it does that after inializing the bus you any imports you 
have to classpath:META-INF/cxf-. should be removed as they would 
already be grabbed.


Dan


On Thursday 17 January 2008, yulinxp wrote:
  

All the sample use the following to start Spring and loads beans.xml
file. context-param
param-namecontextConfigLocation/param-name
param-valueWEB-INF/beans.xml/param-value
/context-param

listener
listener-class
org.springframework.web.context.ContextLoaderListener
/listener-class
/listener

In my existing application, there is a customized springLoader in
place. Thus I can't use ContextLoaderListener anymore. Neither can I
plug in cxf into customized springLoader. Is there any otherway to
load beans.xml? I remember in XFire, we only define servlet-class and
servlet-mapping, then it will automatically look for
META-INF/xfire/services.xml. Can we do that in CXF? how?

web-app

  servlet
servlet-nameXFireServlet/servlet-name
display-nameXFire Servlet/display-name
servlet-class
org.codehaus.xfire.transport.http.XFireConfigurableServlet
/servlet-class
  /servlet

  servlet-mapping
servlet-nameXFireServlet/servlet-name
url-pattern/services/*/url-pattern
  /servlet-mapping
/web-app





  




Re: Use Tomcat

2008-01-15 Thread Willem Jiang

Hi Pawel,

I think you just need to remove the below lines in the beans.xml

bean class=org.apache.cxf.transport.local.LocalTransportFactory 
lazy-init=false
 property name=transportIds
 list
 valuehttp://cxf.apache.org/transports/local/value
 valuehttp://schemas.xmlsoap.org/soap/http/value
 valuehttp://schemas.xmlsoap.org/wsdl/soap/http/value
 /list
 /property
 /bean

These lines will use LocalTransportFactory to replace the other transport 
factorys.
And it is often to see in the test code.


Willem.

Pawel Janusz wrote:

I'm sending files

Willem Jiang pisze:

Hi Pawel

Did you use CXFServlet transport which delegate the http transport to 
a CXFServlet ?

If so , could you show me your Web.xml  and Beans.xml?

In you case I think you still start a new Jetty engine for listening 
the port.


Willem.
Pawel Janusz wrote:

Hello
How to setup CXF not to use Jetty when defining adress in 
jaxws:endpoint. When I try to pass such:
address=/service i got error. Only when I give full address port 
(port has to be different from Tomcat's).


eg. (this one works fine)

jaxws:endpoint id=MyServiceService
 implementor=#MyServiceServiceImpl
   address=http://localhost:8081/MyService
/


I want to use this one but not working :(

jaxws:endpoint id=MyServiceService
 implementor=#MyServiceServiceImpl
   address=/MyService/









Re: Simple Front end/Aegis binding server side set up problem

2008-01-15 Thread Willem Jiang

They are the spring description files of cxf components.

import resource=classpath:META-INF/cxf/cxf.xml /  this is the cxf core 
component.
import resource=classpath:META-INF/cxf/cxf-extension-soap.xml /  this is 
the soap component configuration file.
import resource=classpath:META-INF/cxf/cxf-servlet.xml /   this is the cxf 
servlet transport component configuration file.

You can find them from the cxf modules class path.

Willem.


yulinxp wrote:

I need to add these:
import resource=classpath:META-INF/cxf/cxf.xml /
import resource=classpath:META-INF/cxf/cxf-extension-soap.xml /
import resource=classpath:META-INF/cxf/cxf-servlet.xml /

Can anybody tell me what they are and how they're found and referenced?

-


yulinxp wrote:
  

When deploying in tomcat, it's complaining about Caused by:
java.net.MalformedURLException: no protocol: /hello_world
Did I not get the schema for simple? where can I find it?

SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'helloWorld':
 Invocation of init method failed; nested exception is
org.apache.cxf.service.factory.ServiceConstructionException
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustom
InitMethod(AbstractAutowireCapableBeanFactory.java:1240)
.
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.net.MalformedURLException: no protocol: /hello_world
at java.net.URL.init(URL.java:567)
at java.net.URL.init(URL.java:464)
at java.net.URL.init(URL.java:413)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.init(JettyHTTPDestination.java
:88)
at
org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTP
TransportFactory.java:116)
at
org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTra
nsportFactory.java:103)
at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java
:74)
at
org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90)
at org.apache.cxf.endpoint.ServerImpl.init(ServerImpl.java:69)
at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:109)
... 41 more  
---


beans xmlns=http://www.springframework.org/schema/beans;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns:simple=http://cxf.apache.org/simple;
  xmlns:soap=http://cxf.apache.org/bindings/soap;
  xsi:schemaLocation=
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schemas/configuration/soap.xsd
http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd;

  simple:server id=helloWorld serviceClass=demo.spring.HelloWorld
address=/hello_world
simple:dataBinding
   bean class=org.apache.cxf.aegis.databinding.AegisDatabinding /
/simple:dataBinding
simple:serviceBean
bean class=demo.spring.HelloWorldImpl /
/simple:serviceBean
  /simple:server
/beans




  




Re: Some basic question on wsdl generated services

2008-01-10 Thread Willem Jiang

Hi Mayank

My comments are in the mail.

Mayank Thakore wrote:

Hi,

Few basic questions:

1. If we generate service implementation objects using wsdl2java, is it
possible to avoid it referring back to the wsdl file in the annotations?
  
You just need to remove the wsdlLocation attribute from the WebService 
annotation.



2. The generated implementation mentions the port name in the annotations.
So how can we use the same implementation for two ports (say one http, other
jms)? Will we have to delegate the calls to some common class?
  
The implementation part is a kind of physical part of the wsdl. I don't 
think you can use the same implementation for the two ports without 
changing the annotation.
But if you use the JaxWsServerFactoryBean API [1] not the JAXWS API , 
may be you can override it.

[1]http://cwiki.apache.org/CXF20DOC/server-service-and-client-factorybeans.html


Thanks!

Regards
Mayank 
 



 This e-mail and attachments contain confidential information from HUAWEI,
which is intended only for the person or entity whose address is listed
above. Any use of the information contained herein in any way (including,
but not limited to, total or partial disclosure, reproduction, or
dissemination) by persons other than the intended recipient's) is
prohibited. If you receive this e-mail in error, please notify the sender by
phone or email immediately and delete it!




  

Willem.


Re: WS-Security

2008-01-09 Thread Willem Jiang

Hi

Which CXF version are you using?
Please check your class to make sure cxf module jars are consistent.
If they are CXF 2.0.3 please make sure there is no any CXF 2.0.2 or CXF 
2.1 jars in your class path.


I just checked the CXF codes, there some changes of 
org.apache.cxf.wsdl11.WSDLManagerImpl in Nov 2007 which may relate to 
your issue.



Willem.
priya j wrote:

Hi All,
Thanks a lot for the CXF Support team.

I have used CXF to web Service my application, now i need to include
security to my application.
When i tried the callback in the CXF Sample im getting an error in import
org.apache.callback.* , i hav included the cxf-manifest-incubator.jar.

Please do help in solving this.
I even tried the WS-Security in
http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/

the server runs fine, when i try executing my client i get the following
error.

Jan 8, 2008 9:50:30 AM org.apache.cxf.configuration.spring.ConfigurerImpl
init
INFO: Could not find the configuration file cxf.xml on the classpath.
Jan 8, 2008 9:50:30 AM org.apache.cxf.bus.spring.SpringBusFactory createBus
WARNING: Failed to create application context.
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.apache.cxf.wsdl.WSDLManager' defined in class path resource
[META-INF/cxf/cxf.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw
exception; nested exception is java.lang.NoSuchFieldError: SCHEMA_QNAME
Caused by: org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor
threw exception; nested exception is java.lang.NoSuchFieldError:
SCHEMA_QNAME
Caused by: java.lang.NoSuchFieldError: SCHEMA_QNAME
at org.apache.cxf.wsdl11.WSDLManagerImpl.init(WSDLManagerImpl.java:80)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at 
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85)
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:756)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:721)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:384)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.apache.cxf.bus.spring.BusApplicationContext.init(BusApplicationContext.java:71)
at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:84)
at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65)
at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:54)
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:106)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:97)
at
org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:54)
at javax.xml.ws.Service.init(Unknown Source)
at
sg.sphsearch.sfe.callback.server.SportsService_Service.init(SportsService_Service.java:45)
at sg.sphsearch.sfe.callback.client.WsClient.main(WsClient.java:24)
Exception in thread main java.lang.RuntimeException:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.apache.cxf.wsdl.WSDLManager' defined in class path resource
[META-INF/cxf/cxf.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class 

Re: cxf without spring

2008-01-09 Thread Willem Jiang

Yes, you could init a bus without the spring just as Glen shows.
Here is one thing that I should say about the

bus = BusFactory.newInstance().createBus();

The BusFactory will check your class path ,  if it can find some spring 
relate class , it will use SpringBusFactory to load bus.

Unless you can the upper code to be

BusFactory busFactory = new CXFBusFactory();
bus = busFactory.createBus();

In you case , I think you still want to use spring , am I right :)

So what I am interested now is what kind of issue that 
Jsr250PostProcessor caused.


We fixed some Spring 2.5 relate issues[1][2] in CXF 2.0.4 snapshot, 
please feel free to try it out.


[1]http://issues.apache.org/jira/browse/CXF-1187
[2]http://issues.apache.org/jira/browse/CXF-1249

Willem.

Glen Mazza wrote:

cxf.xml is for bus (generic service/client endpoing) configuration--I
don't know what you're trying to do to be able to answer your question
directly.

The Service configuration files section of [1] gives you two separate
ways of configuring a CXF-based web service.  Also, Willem recently
created a CXFNonSpringServlet[2] which may be what you're looking for.
Unfortunately AFAIK its usage has not been documented yet, but if you
ask Willem enough questions he may become motivated to write up about
it.

HTH,
Glen

[1] http://cwiki.apache.org/CXF20DOC/configuration.html
[2]
http://www.mail-archive.com/[EMAIL PROTECTED]/msg03018.html


Am Mittwoch, den 02.01.2008, 17:09 -0600 schrieb Patidar, Manoj:
  

Hi All,

can we configure  cxf without using following xml as  we are facing
issue with intiallizing the  beans of our product if we import cxf.xml
in our application-context.xml.   Jsr250PostProcessor.java is creating
some issue and none of our beans are intialized. 
So my questions is can we avoid including cxf.xml. If yes how?


cxf.xml 
cxf-extension.xml 
cxf-property-editors.xml 



your help is apreciated.

Thanks
Manoj patidar




  




Re: WS-Security

2008-01-09 Thread Willem Jiang
I think you can use ssl to secure your RESTful  service and  don't know 
if there is other way to do it.
AFAIK Jervis just commit a sample of it [1], please check it out from 
2.1 snapshot ;)


BTW,
I think we need keep our conversion in the CXF user group,  to share the 
knowledge more wildly.


[1]http://svn.apache.org/viewvc?rev=609880view=rev

Willem.

[EMAIL PROTECTED] wrote:
Thanks a lot william. my application works fine, i just changed the version to 2.0.3. with 2.1 it doesnt work. but this example is for the SOAP thing, is there any security we can enable for the RESTful http service. 


Can you help me in doing this. As well as on the key generation for the SOAP WS

willem.jiang wrote:
  

Hi

Which CXF version are you using?
Please check your class to make sure cxf module jars are consistent.
If they are CXF 2.0.3 please make sure there is no any CXF 2.0.2 or CXF 
2.1 jars in your class path.


I just checked the CXF codes, there some changes of 
org.apache.cxf.wsdl11.WSDLManagerImpl in Nov 2007 which may relate to 
your issue.



Willem.
priya j wrote:


Hi All,
Thanks a lot for the CXF Support team.

I have used CXF to web Service my application, now i need to include
security to my application.
When i tried the callback in the CXF Sample im getting an error in import
org.apache.callback.* , i hav included the cxf-manifest-incubator.jar.

Please do help in solving this.
I even tried the WS-Security in
http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/

the server runs fine, when i try executing my client i get the following
error.

Jan 8, 2008 9:50:30 AM org.apache.cxf.configuration.spring.ConfigurerImpl
init
INFO: Could not find the configuration file cxf.xml on the classpath.
Jan 8, 2008 9:50:30 AM org.apache.cxf.bus.spring.SpringBusFactory
createBus
WARNING: Failed to create application context.
org.springframework.beans.factory.BeanCreationException: Error creating
bean
with name 'org.apache.cxf.wsdl.WSDLManager' defined in class path
resource
[META-INF/cxf/cxf.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate
bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw
exception; nested exception is java.lang.NoSuchFieldError: SCHEMA_QNAME
Caused by: org.springframework.beans.BeanInstantiationException: Could
not
instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]:
Constructor
threw exception; nested exception is java.lang.NoSuchFieldError:
SCHEMA_QNAME
Caused by: java.lang.NoSuchFieldError: SCHEMA_QNAME
at org.apache.cxf.wsdl11.WSDLManagerImpl.init(WSDLManagerImpl.java:80)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85)
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:756)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:721)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:384)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.apache.cxf.bus.spring.BusApplicationContext.init(BusApplicationContext.java:71)
at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:84)
at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65)
at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:54)
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:106)
at 

Re: Parameter size limit?

2008-01-09 Thread Willem Jiang

Hi Chad,

I don't think CXF has the parameter size limit, since I am successful to 
send the more than 60K binary parameter to CXF server.

Did you try to call the service with CXF client ?
Maybe you can compare the CXF client and Flex requests' different.

Just my two cents.

Willem.

Trarman wrote:

Hello,

I'm using a Flex 2 web service client to send data to a CXF 2.0.3 server. 
It works fine so long as the data (which could be binary, text, or XML

depending on which method is being invoked) isn't larger than 20k.  The
data, whatever format it happens to be, gets truncated at 20k by the time it
reaches my POJO.  I've used a packet sniffer to verify Flex is sending
complete and well formatted data to the server.

Is this a known limitation?

Thanks,
Chad
  




Re: Using HTTPClient as a transport

2008-01-09 Thread Willem Jiang

Hi Barrie,

We do not use HTTPClient to send the request in CXF HTTP transport.
If you want to replace the CXF's HTTPConduit[1] with HTTPClient , I 
think you need to implement the Conduit[2] API with HTTPClient.

Anyway , you can fill a JIRA[3] for it and the patches are welcome ;)

[1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
[2]https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/AbstractConduit.java
[3]http://issues.apache.org/jira/browse/CXF

Willem.

Barrie Selack wrote:

To authenticate against a digest-authentication web service, I've found the 
only way is using HTTPClient 3.

1)   Is there a way to tell CXF to use HTTPClient as the HTTP transport 
instead of the default?
2)   Or is there a way to have the default do digest-authentication

Thanks,
Barrie



Disclaimer: This e-mail message is intended only for the personal use of
the recipient(s) named above. If you are not an intended recipient, you
may not review, copy or distribute this message. If you have received this
communication in error, please notify us immediately by e-mail and delete
the original message.

This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or distributed
without this statement.

  




Re: exposed methods with Aegis binding

2008-01-08 Thread Willem Jiang

Hi,

Aegis Binding is a data binding , it will not effect which method will 
be export to the web service.
If you are using JaxWs front end , you could use the annotation to 
define your SEI ( which will be mapped to the WSDL operation)

You can find the example here[1].

[1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/Hello.java

Willem.

tcs wrote:

I'm using CXF (with Aegis Binding) to create a simple Web Service.  My web
service impl. class extends other classes.  Not only are the methods in my
web service impl. class exposed in the WSDL generated by CXF, but methods
from the parent class are also exposed.  


Is there a way to control which methods are exposed using the default Aegis
Binding. 


thanks,

  




Re: Cannot get WebServiceContext or access the httpservletrequest

2008-01-06 Thread Willem Jiang

Hi ,

It looks like Spring 2.5 will take the charge of the dependency 
injection of the WebServiceContext.
CXF can do it with itself Resource Injector, but Spring can't resolve 
the WebServiceContext instance.


If you can turn off the Spring 2.5 annotation resource injection feature 
, I think you can resolve this issue.


Willem.
gweb79 wrote:

Hello,

Setup:
Spring 2.5 (Configured using annotations)
CXF 2.0.3
Tomcat 6.0.14


I need to access the HTTPServletRequest from the web service impl class. I
have had a look at all the docs which say to add the code: 


@Resource
private WebServiceContext context;

which the request can be retrieved. However in my setup I get the following
error:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No unique bean of type [javax.xml.ws.WebServiceContext] is defined:
Unsatisfied dependency of type [interface javax.xml.ws.WebServiceContext]:
expected at least 1 matching bean
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveDependency(AbstractAutowireCapableBeanFactory.java:417)
at
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:384)
at
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:463)
at
org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:123)
at
org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:61)
at
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:259)
... 53 more


Can anybody explain what the problem is? The docs make it seem very simple.
I have setup the web.xml with
org.springframework.web.context.request.RequestContextListener.  


If this is not possible with my setup is there any other way to access the
request from the web service? I need to access the user information in
multiple places for each individual request?

Thanks.






  




Re: Cannot get WebServiceContext or access the httpservletrequest

2008-01-06 Thread Willem Jiang

Hi Graham,

I can show your the code how does CXF inject the WebServiceContext.
It's  the JaxWsServerFactoryBean[1]'s injectResources method.
Maybe you can find a way to configure the resource resolver with this code.

BTW, Why are you want to use Spring 2.5 ? 
CXF can work with Spring 2.0.x  more peacefully :)


[1] 
https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java


Willem.

gweb79 wrote:

Hi Willem,

Thanks, but I was hoping to not have to turn off the annotation injection
for spring, that would mean quite a lot of work re-configuring all my beans.
Is there no other way? Maybe by configuring spring so that it knows about
WebServiceContext?

Thanks,
Graham


willem.jiang wrote:
  

Hi ,

It looks like Spring 2.5 will take the charge of the dependency 
injection of the WebServiceContext.
CXF can do it with itself Resource Injector, but Spring can't resolve 
the WebServiceContext instance.


If you can turn off the Spring 2.5 annotation resource injection feature 
, I think you can resolve this issue.


Willem.
gweb79 wrote:


Hello,

Setup:
Spring 2.5 (Configured using annotations)
CXF 2.0.3
Tomcat 6.0.14


I need to access the HTTPServletRequest from the web service impl class.
I
have had a look at all the docs which say to add the code: 


@Resource
private WebServiceContext context;

which the request can be retrieved. However in my setup I get the
following
error:

Caused by:
org.springframework.beans.factory.NoSuchBeanDefinitionException:
No unique bean of type [javax.xml.ws.WebServiceContext] is defined:
Unsatisfied dependency of type [interface
javax.xml.ws.WebServiceContext]:
expected at least 1 matching bean
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveDependency(AbstractAutowireCapableBeanFactory.java:417)
at
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:384)
at
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:463)
at
org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:123)
at
org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:61)
at
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:259)
... 53 more


Can anybody explain what the problem is? The docs make it seem very
simple.
I have setup the web.xml with
org.springframework.web.context.request.RequestContextListener.  


If this is not possible with my setup is there any other way to access
the
request from the web service? I need to access the user information in
multiple places for each individual request?

Thanks.






  
  





  




Re: How to substitute the placeholders in the config files ?

2007-12-26 Thread Willem Jiang

Hi Alex ,

Here is an example for your replace the ${} palceholders in the spring 
configuration file.

Code :
[1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/EngineLifecycleTest.java
Configuration file :
[2]https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/jetty-engine.xml

Willem.

Alex Shneyderman wrote:

I have a cxf.xml that contains a section like this :

sec:trustManagers
sec:keyStore type=${securitystore.type}
  password=${securitystore.password}
  file=${securitystore.file} /
/sec:trustManagers

how do I substitute all those ${} placeholders ?

I tried to use PropertyPlaceholderConfigurer that of course did not work.

Any ideas ?

  




Re: JAX-WS handler attachment options within Apache CXF

2007-12-25 Thread Willem Jiang
For the server side, you may set the HandlerChain after the 
endpoint.publish is called.


Willem.

James Mao wrote:

Probably this way is safer

getBinding().getHandlerChain().add(YourHandler)

James


Glen,

The answer is YES, you can do it programmatically

Service side API

Endpoint.getBinding().setHandlerChain(ListHandler)


Client side API

BindingProvider.getBinding().setHandlerChain(ListHandler)

Besides, the Service API

Service.setHandlerResolver()

Hope it helps,
James


Hello,

The JAX-WS specification--as well as our jax-ws handler
sample[1]--specify/show two ways to attach a JAX-WS handler to a CXF
client or service:

1.) For the service, configuration via annotations and an XML file
(e.g., under /commons in [1]).

2.) For the client, programmatically within the Java class making the
web service call.

Question:  Does anyone know of additional ways one can attach a JAX-WS
handler to the web service or client?  For example, can I
programmatically attach handlers to the web service implementation, or
do XML configuration of handler chains on the *client* side?

Thanks,
Glen

[1] http://tinyurl.com/2ps3y2


  









Re: Problems integrating CXF and Grails

2007-12-23 Thread Willem Jiang

Hi Alex,

CXF need to use XercesImpl 2.8.1.jar.
Please make sure this jar be loaded first.

Willem.

Alex Shneyderman wrote:

I am using Grails framework in conjunction with CXF and I am getting
the following error trying to instantiate a SOAP interface to the
remote service:

Message: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager'
defined in class path resource [META-INF/cxf/cxf.xml]: Instantiation
of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]:
Constructor threw exception; nested exception is
java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to
javax.xml.parsers.DocumentBuilderFactory

Caused by: java.lang.RuntimeException:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in
class path resource [META-INF/cxf/cxf.xml]: Instantiation of bean
failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]:
Constructor threw exception; nested exception is
java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to
javax.xml.parsers.DocumentBuilderFactory

Does anyone know what could be a problem? Seems like a conflicting jar
problem but what jar ?

Alex.

  




Re: Problems integrating CXF and Grails

2007-12-23 Thread Willem Jiang

Hi Alex ,

We use 2.8.1 on the development environment ,  you can try out the 2.9.1 
but I don't test it yet.


Willem.

Alex Shneyderman wrote:

Does it have to be exactly that version ? or 2.9.1 will do as well ?

On Dec 23, 2007 2:07 PM, Willem Jiang [EMAIL PROTECTED] wrote:
  

Hi Alex,

CXF need to use XercesImpl 2.8.1.jar.
Please make sure this jar be loaded first.

Willem.



  




Re: CXF and JSON

2007-12-20 Thread Willem Jiang

Hi ,
You can find the example in the CXF_KIT/samples/restful_http_binding

Willem.
Vespa, Anthony J wrote:

I'm considering implementing (or re-implementing) a service from
REST/SOAP to JSON.  I'm wondering if someone has a workable example (the
docs I've found are a bit sparse) in terms of how to configure my
beans.xml and how to set up the SEI.

Thanks!

  




Re: Strange error with JAX-WS and JDK 1.5

2007-12-20 Thread Willem Jiang

Hi ,

I think Resin 3.1.3 may ship a earlier version of jaxws-api.jar and CXF 
need to use the jaxws-api.2.0.jar.
As you know , JDK 1.60_02 ships with jaxws-api.2.0 jar , so Resin's 
jaxws-api jar will get no chance to be loaded.
But there is no any jaxws-api.jar in JDK 1.5.0_06, and the Resin's 
jaxws-api is loaded.


You just need to endorse the jaxws-api.jar or let the war's lib jars 
load first.


Here are some documents for you [1]

[1]http://cwiki.apache.org/CXF20DOC/appserverguide.html

Willem.

Atif Khan wrote:

I have a simple Hello World application that is configured following:

HelloWorld.java Interface

@WebService
public interface HelloWorld
{
  String sayHello( @WebParam(name=text) String text );
}

HelloWorldImpl.java
@WebService(endpointInterface = test.jws.HelloWorld)
public class HelloWorldImpl
  implements HelloWorld

and the Spring configuration looks like:

  import resource=classpath:META-INF/cxf/cxf.xml /
  import resource=classpath:META-INF/cxf/cxf-extension-soap.xml /
  import resource=classpath:META-INF/cxf/cxf-servlet.xml /
  import resource=classpath:META-INF/cxf/cxf-extension-xml.xml /
  import resource=classpath:META-INF/cxf/cxf-extension-http-binding.xml
/
  jaxws:endpoint id=helloWorld implementor=test.jws.HelloWorldImpl
address=/HelloWorld /


I am bundling this as a WAR and running on Caucho Resin 3.1.3. When I start
the application server under JDK 1.6.0_02, it works fine and serves
requests. The problem occurs while starting the application server under JDK
1.5.0_06. I am getting the UnsupportedOperationException when Spring tries
to initialize the HelloWorldImpl bean. Here is the stack trace:

[17:39:45.436] Could not find the configuration file cxf.xml on the
classpath.
[17:40:23.107] org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'helloWorld': Instantiation of bean failed;
nested exception is java.lang.ExceptionInInitializerError
[17:40:23.107] Caused by: java.lang.ExceptionInInitializerError
[17:40:23.107] at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
[17:40:23.107] at sun.reflect.NativeConstructorAccessorImpl.newInstance(
NativeConstructorAccessorImpl.java:39)
[17:40:23.107] at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
DelegatingConstructorAccessorImpl.java:27)
[17:40:23.107] at java.lang.reflect.Constructor.newInstance(
Constructor.java:494)
[17:40:23.107] at org.springframework.beans.BeanUtils.instantiateClass(
BeanUtils.java:85)
[17:40:23.107] at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate
(SimpleInstantiationStrategy.java:87)
[17:40:23.107] at
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor
(ConstructorResolver.java:186)
[17:40:23.107] at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor
(AbstractAutowireCapableBeanFactory.java:795)
[17:40:23.107] at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance
(AbstractAutowireCapableBeanFactory.java:713)
[17:40:23.107] at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
(AbstractAutowireCapableBeanFactory.java:386)
[17:40:23.107] at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(
AbstractBeanFactory.java:249)
[17:40:23.107] at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton
(DefaultSingletonBeanRegistry.java:155)
[17:40:23.107] at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
AbstractBeanFactory.java:246)
[17:40:23.107] at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
AbstractBeanFactory.java:160)
[17:40:23.107] at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons
(DefaultListableBeanFactory.java:291)
[17:40:23.107] at
org.springframework.context.support.AbstractApplicationContext.refresh(
AbstractApplicationContext.java:352)
[17:40:23.107] at
org.springframework.web.context.ContextLoader.createWebApplicationContext(
ContextLoader.java:245)
[17:40:23.107] at
org.springframework.web.context.ContextLoader.initWebApplicationContext(
ContextLoader.java:188)
[17:40:23.107] at
org.springframework.web.context.ContextLoaderListener.contextInitialized(
ContextLoaderListener.java:49)
[17:40:23.107] at com.caucho.server.webapp.WebApp.start(WebApp.java
:1793)
[17:40:23.107] at com.caucho.server.deploy.DeployController.startImpl(
DeployController.java:646)
[17:40:23.107] at
com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(
StartAutoRedeployAutoStrategy.java:72)
[17:40:23.107] at com.caucho.server.deploy.DeployController.startOnInit(
DeployController.java:528)
[17:40:23.107] at com.caucho.server.deploy.DeployContainer.start(
DeployContainer.java:163)
[17:40:23.107] at 

Re: Strange error with JAX-WS and JDK 1.5

2007-12-20 Thread Willem Jiang
I have never used  Resin,  I just got some experience from some other 
web containers, they provide some kind of configuration to load your 
application JAR first.

May be you can ask help from Resin.

Willem.

Atif Khan wrote:

Thanks. Putting jaxws-api.jar in jre/lib/ext did the trick. The problem I
have is that I can not put the jar file production environment in the jre
directory. Also, loading war libs first is out of question. Is there a way
to configure Resin to load the jar from a different directory before the app
server libs?

On Dec 20, 2007 6:14 PM, Willem Jiang [EMAIL PROTECTED] wrote:

  

Hi ,

I think Resin 3.1.3 may ship a earlier version of jaxws-api.jar and CXF
need to use the jaxws-api.2.0.jar.
As you know , JDK 1.60_02 ships with jaxws-api.2.0 jar , so Resin's
jaxws-api jar will get no chance to be loaded.
But there is no any jaxws-api.jar in JDK 1.5.0_06, and the Resin's
jaxws-api is loaded.

You just need to endorse the jaxws-api.jar or let the war's lib jars
load first.

Here are some documents for you [1]

[1]http://cwiki.apache.org/CXF20DOC/appserverguide.html

Willem.

Atif Khan wrote:


I have a simple Hello World application that is configured following:

HelloWorld.java Interface

@WebService
public interface HelloWorld
{
  String sayHello( @WebParam(name=text) String text );
}

HelloWorldImpl.java
@WebService(endpointInterface = test.jws.HelloWorld)
public class HelloWorldImpl
  implements HelloWorld

and the Spring configuration looks like:

  import resource=classpath:META-INF/cxf/cxf.xml /
  import resource=classpath:META-INF/cxf/cxf-extension-soap.xml /
  import resource=classpath:META-INF/cxf/cxf-servlet.xml /
  import resource=classpath:META-INF/cxf/cxf-extension-xml.xml /
  import resource=classpath:META-INF/cxf/cxf-
  

extension-http-binding.xml


/
  jaxws:endpoint id=helloWorld implementor=test.jws.HelloWorldImpl
address=/HelloWorld /


I am bundling this as a WAR and running on Caucho Resin 3.1.3. When I
  

start


the application server under JDK 1.6.0_02, it works fine and serves
requests. The problem occurs while starting the application server under
  

JDK


1.5.0_06. I am getting the UnsupportedOperationException when Spring
  

tries


to initialize the HelloWorldImpl bean. Here is the stack trace:

[17:39:45.436] Could not find the configuration file cxf.xml on the
classpath.
[17:40:23.107] org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'helloWorld': Instantiation of bean
  

failed;


nested exception is java.lang.ExceptionInInitializerError
[17:40:23.107] Caused by: java.lang.ExceptionInInitializerError
[17:40:23.107] at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
[17:40:23.107] at
  

sun.reflect.NativeConstructorAccessorImpl.newInstance(


NativeConstructorAccessorImpl.java:39)
[17:40:23.107] at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
DelegatingConstructorAccessorImpl.java:27)
[17:40:23.107] at java.lang.reflect.Constructor.newInstance(
Constructor.java:494)
[17:40:23.107] at
  

org.springframework.beans.BeanUtils.instantiateClass(


BeanUtils.java:85)
[17:40:23.107] at

  

org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate


(SimpleInstantiationStrategy.java:87)
[17:40:23.107] at

  

org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor


(ConstructorResolver.java:186)
[17:40:23.107] at

  

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor


(AbstractAutowireCapableBeanFactory.java:795)
[17:40:23.107] at

  

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance


(AbstractAutowireCapableBeanFactory.java:713)
[17:40:23.107] at

  

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean


(AbstractAutowireCapableBeanFactory.java:386)
[17:40:23.107] at

  

org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(


AbstractBeanFactory.java:249)
[17:40:23.107] at

  

org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton


(DefaultSingletonBeanRegistry.java:155)
[17:40:23.107] at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
AbstractBeanFactory.java:246)
[17:40:23.107] at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
AbstractBeanFactory.java:160)
[17:40:23.107] at

  

org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons


(DefaultListableBeanFactory.java:291)
[17:40:23.107] at
org.springframework.context.support.AbstractApplicationContext.refresh(
AbstractApplicationContext.java:352)
[17:40:23.107

Re: any irc channel for equivalent to this mailing list?

2007-12-19 Thread Willem Jiang

It is [EMAIL PROTECTED]

Willem.

Nino Saturnino Martinez Vazquez Wael wrote:
And subject should have been any irc channel equivalent to this 
mailing list? Sorry for my poor spelling today.


Nino Saturnino Martinez Vazquez Wael wrote:

are there?







Re: SOAP flow Compression?

2007-12-18 Thread Willem Jiang
You just need to remove the LoggingInInterceptor from the interceptor 
chain,

but I do not know how do you add the interceptor into the bus?

BTW:
We fixed the CachedOutputStream error in CXF 2.0.3.
I think you just need to move to a new version of it :)

Willem.

Tophebboy wrote:

I searched for the CachedOutputStream error.
I found that:
http://www.nabble.com/Created-3A--28CXF-986-29-Cached-file-was-deleted-2C-java.io.FileNotFoundException-in-SWA-with-Logging-on.-to12588481.html
Maybe I should turn off the LoggingInInterceptor, but how can I do that?
Thx in advance!



Tophebboy wrote:
  

That's what I've done!! But it won't work! Anyway, I tried this:
==
 bean id=cxf class=org.apache.cxf.bus.CXFBusImpl
!--property name=inInterceptors
list
ref bean=GZIPStream/
/list
/property
property name=inFaultInterceptors
list
ref bean=GZIPStream/
/list
/property--
property name=outInterceptors
list
ref bean=GZIPStream/
/list
/property
!--property name=outFaultInterceptors
list
ref bean=GZIPStream/
/list
/property--
/bean
==
Instead of:
==
 cxf:bus
   cxf:inInterceptors
   list
   ref bean=GZIPStream/
   /list
   /cxf:inInterceptors
   cxf:outInterceptors
   list
   ref bean=GZIPStream/
   /list
   /cxf:outInterceptors
   /cxf:bus
==
And it works thanks to the imports you told me to put!:-)
But, I have now another problem!
My interceptor is here to compress the SOAP flow because I may transport
quite big informations.
When I make a request which leads to a little response, there is no
problem. But when the request leads to a big response, I have this error
on the server side:
==

java.io.IOException: Cached file was deleted,
java.io.FileNotFoundException:
C:\DOCUME~1\C7EB6~1.BOU\LOCALS~1\Temp\att1310tmp (Le fichier spécifié est
introuvable)
at
org.apache.cxf.io.CachedOutputStream.getInputStream(CachedOutputStream.java:283)
at
com.structis.edoc.services.utils.interceptors.StreamInterceptor.handleMessage(StreamInterceptor.java:48)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
at
org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:74)
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)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
==
and as a consequence, on the client side:

Re: SOAP flow Compression?

2007-12-17 Thread Willem Jiang

Hi,

Can I see your bus configuration file ?
The NPE is caused by you do not set the bus rightly.
I just checked the code ,  you may not include the right bus.

Willem.
Tophebboy wrote:

On top of that, on the server side, launching Tomcat now gives me 2 errors:
17 déc. 2007 14:45:35 org.apache.cxf.transport.servlet.CXFServlet
loadSpringBus
INFO: load the bus with application context
14:45:35,482 ERROR [main]
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/EDocRequest]
- StandardWrapper.Throwable
java.lang.NullPointerException
at
org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:162)
at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
at 
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:448)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
14:45:35,482 ERROR [main]
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/EDocRequest]
- La servlet /EDocRequest a généré une exception load()
java.lang.NullPointerException
at
org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:162)
at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
at 
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:448)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 

Re: Dynamic client basic auth

2007-12-09 Thread Willem Jiang

Hi Guillaume,

Please see my comments in the mail.
tog wrote:

Hi Willem,

Can you explain in details your sentence: The AuthorizationPolicy
only works for HTTP Conduit of HTTP Destination. as I am not familiar
with CXF internals.

  
CXF http transport is implemented by two component HTTP Conduit (client 
side) and

HTTP Destination (server side).
But in the Service creation phase these two component are not involved , 
because CXF

just use the URL connection to  get the WSDL file.

CXF delegate the WSDL creation to WSDL4J and it use the blow code to 
create the WSDL

definition.
URL contextURL = (contextURI != null)
  ? StringUtils.getURL(null, contextURI)
  : null;
 URL url = StringUtils.getURL(contextURL, wsdlURI);
 InputStream inputStream = StringUtils.getContentAsInputStream(url);
 InputSource inputSource = new InputSource(inputStream);
 inputSource.setSystemId(url.toString());
 Document doc = getDocument(inputSource, url.toString());

I don't know if there is a way to set the basic authorization for the 
url by using system properties.

In my case I am not using a proxy so the flag you are mentioning won't
help much. My server is waiting for the following http header:
Authorization: Basic ... and not Proxy-Authorization
  
OK, this is my mistake. I think you can write codes to get the WSDL from 
the service which need use
HTTP basic authorization, and store this WSDL in the temp directory , 
then pass the temp WSDL file's URL

to the service.

I might need to dig a bit in order to see what is the effect on the
http request of setting the username and password of
AutorizationPolicy :-)

Cheers
Guillaume
  


Willem.

On Dec 9, 2007 9:32 PM, Willem2 [EMAIL PROTECTED] wrote:
  

Hi Guillaume

The AuthorizationPolicy only works for HTTP Conduit of HTTP Destination.
In your case , I don't think this policy will take effect, since CXF just
uses URL to get wsdl when create the service from wsdl.

Maybe you need to use JVM's proxy setting such as
-DproxySet=true -DproxyHost=PROXYSERVER -DproxyPort=PORT

Willem.



tog wrote:


Hum I can believe this ...
What I am looking for is a way to set up the Authorization header in
the HTTP request (prior to get the wsdl).
I know how to set-up the Proxy-Authorization header and I found
AuthorizationPolicy

AuthorizationPolicy auth = conduit.getAuthorization();
auth.setUserName(username);
auth.setPassword(password);

Will that do the job ?
Then the problem is to do this prior to the creation of the client ...
which is the first thing I do !

Any thought ?

Guillaume


On Dec 9, 2007 3:34 AM, Glen Mazza [EMAIL PROTECTED] wrote:
  

I'm not sure the Java artifacts would have a defined place for such
information.

Glen

Am Sonntag, den 09.12.2007, 01:15 +0800 schrieb tog:



the same question apply for the wsdl2java. I did not see anything for
setting up username/passwd in the options

On Dec 9, 2007 1:13 AM, tog [EMAIL PROTECTED] wrote:
  

Hi

I need basic auth to retrieve a wsdl.
I currently use the dynamic client. All the constructors take


directly


a string for the wsdl url.
Is there a way to set username/passwd before actually calling the


server ?


Thanks

--

Best Regards
Guillaume
http://cheztog.blogspot.com




  



--

Best Regards
Guillaume
http://cheztog.blogspot.com


  

--
View this message in context: 
http://www.nabble.com/Dynamic-client---basic-auth-tp14230385p14238535.html
Sent from the cxf-user mailing list archive at Nabble.com.







  


Re: HTTP Binding for RESTful service

2007-12-06 Thread Willem Jiang

Hi,

You need include the below line in your configuration file which will 
load the http binding for you to use.

import resource=classpath:META-INF/cxf/cxf-extension-http-binding.xml/

Willem.
priya j wrote:

Hi all,

This is priya, I am using CFX for my application.
I have successfully implemented the CXF, now i hav to go in for the HTTP
Binding for RESTful service.
I just followed the steps below and also the CXF document.

This is my config file:

beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:jaxws=http://cxf.apache.org/jaxws;
   xsi:schemaLocation=
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd;

   import resource=classpath:META-INF/cxf/cxf.xml /
   import resource=classpath:META-INF/cxf/cxf-extension-soap.xml /
   import resource=classpath:META-INF/cxf/cxf-servlet.xml /

   jaxws:endpoint
   id=customer
  
implementor=sg.sphsearch.sfe.webService.server.CustomerServiceImpl

   address=/Customer
   bindingUri=http://apache.org/cxf/binding/http;
   jaxws:serviceFactory
 bean id=JaxWsServiceFactoryBean
  
class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean

  property name=wrapped value=false/
 /bean
   /jaxws:serviceFactory
   /jaxws:endpoint
/beans

This is my client bean

beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:jaxws=http://cxf.apache.org/jaxws;
   xsi:schemaLocation=
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd;

   bean id=client class=sg.server.Customer
 factory-bean=clientFactory factory-method=create 
  /bean

bean id=clientFactory
class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean
 property name=serviceClass value=sg.server.Customer/
 property name=address
value=http://localhost:8080/sfe/Customer/
   /bean

/beans

i am getting the following error, can you help me in solving this

2007-12-07 09:55:11,568 ERROR org.springframework.web.context.ContextLoader
- Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'customer': Invocation of init method failed; nested exception is
org.apache.cxf.service.factory.ServiceConstructionException: Could not
resolve a binding for http://apache.org/cxf/binding/http
Caused by:
org.apache.cxf.service.factory.ServiceConstructionException: Could not
resolve a binding for http://apache.org/cxf/binding/http
   at
org.apache.cxf.frontend.AbstractEndpointFactory.createBindingInfo(AbstractEndpointFactory.java:302)
   at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.createBindingInfo(JaxWsServerFactoryBean.java:137)
   at
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpointInfo(AbstractEndpointFactory.java:179)
   at
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:110)
   at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:107)
   at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:147)
   at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:287)
   at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:227)
   at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179)
   at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:340)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1240)
   at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1205)
   at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
   at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
   at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
   at

Re: org.apache.cxf.interceptor.Fault: Marshalling Error with NFL/GroovyWS

2007-12-05 Thread Willem Jiang

Hi Guillaume

The exception is caused by my patch for removing 


@Resource(name = activationNamespaces)

to support Spring 2.5.
I did a quick fixing for it few days ago , so the exception will go way 
when you get the latest snapshot.


BTW, 
This exception only happened when your are useing CXFBusFactory instead 
of SpringBusFactory.


Willem.

tog wrote:

Hi Dan,

This is ok, I looked at your code, I was doing similar things in my
GroovyWS client. Keep me informed when the snapshot will be published
?
Btw, the current snapshot give me this exception ... Am I doing
something wrong when creating my client ?

Cheers
Guillaume


java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at 
org.apache.cxf.common.injection.ResourceInjector.invokePostConstruct(ResourceInjector.java:305)
at 
org.apache.cxf.common.injection.ResourceInjector.construct(ResourceInjector.java:86)
at 
org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:160)
at 
org.apache.cxf.bus.extension.ExtensionManagerImpl.activateViaNS(ExtensionManagerImpl.java:84)
at org.apache.cxf.bus.extension.DeferredMap.get(DeferredMap.java:47)
at 
org.apache.cxf.transport.ConduitInitiatorManagerImpl.getConduitInitiator(ConduitInitiatorManagerImpl.java:100)
at 
org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:70)
at 
org.apache.cxf.endpoint.UpfrontConduitSelector.selectConduit(UpfrontConduitSelector.java:71)
at org.apache.cxf.endpoint.ClientImpl.getConduit(ClientImpl.java:420)
at groovyx.net.ws.WSClient.init(WSClient.java:156)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at 
org.codehaus.groovy.runtime.MetaClassHelper.doConstructorInvoke(MetaClassHelper.java:465)
at 
groovy.lang.MetaClassImpl.doConstructorInvoke(MetaClassImpl.java:2086)
at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1022)
at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:952)
at 
org.codehaus.groovy.runtime.Invoker.invokeConstructorOf(Invoker.java:126)
at 
org.codehaus.groovy.runtime.InvokerHelper.invokeConstructorOf(InvokerHelper.java:103)
at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNewN(ScriptBytecodeAdapter.java:233)
at nfl.run(nfl.groovy:3)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at 
org.codehaus.groovy.reflection.CachedMethod.invokeByReflection(CachedMethod.java:107)
at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:127)
at 
org.codehaus.groovy.runtime.metaclass.StdMetaMethod.invoke(StdMetaMethod.java:18)
at 
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:538)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:749)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:589)
at org.codehaus.groovy.runtime.Invoker.invokePogoMethod(Invoker.java:98)
at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:79)
at 
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:74)
at 
org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:374)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at 
org.codehaus.groovy.reflection.CachedMethod.invokeByReflection(CachedMethod.java:107)
at 
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:127)
at 
org.codehaus.groovy.runtime.metaclass.StdMetaMethod.invoke(StdMetaMethod.java:18)
at 
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:538)
at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:873)
at 

Re: PropertyPlaceHolderConfigurer and cxf.xml

2007-12-04 Thread Willem Jiang

Hi ,

You can find an example in CXF systest [1]

[1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty/EngineLifecycleTest.java

Willem.

Bc. Jiří Mikulášek wrote:

Hi all,
I would like to use PropertyPlaceHolder inc cxf.xml tu enable some parameters 
modification from properties.


So I would like to use something like:
http-conf:client AllowChunking=false
			property 
name=ConnectionTimeoutvalue${ConnectionTimeout}/value/property

property 
name=ReceiveTimeoutvalue${ReceiveTimeout}/value/property
/http-conf:client

which obviously doesn't work.

Please give me some advice how to handle this situation correctly.

Thanks a lot
  


Re: Addressing namespace compatability issue with WCF

2007-12-03 Thread Willem Jiang

Hi Paul,

I just went through the ws-rm's code , there are some hard codes which 
set the addressing namespace to be


http://schemas.xmlsoap.org/ws/2004/08/addressing;

and there is a comment in the VersionTransformer.java file.
 The motivation for using different native and exposed types
 is usually to facilitate a WS-* standard based on an earlier 
 version of WS-Adressing (for example WS-RM depends on the
 2004/08 version).  
Since CXF ws-rm implement years ago before WS-RM 1.1 draf4 released, I think you can fill a JIRA for it.


BTW 
Just a quick question. Which version of WS-RM does WCF support?


Willem.

paul.freeman wrote:
There is a patch for this issue in JIRA - but it doesn't seem to work. 
Looking at the code around the patch, there are explicit calls to classes in

the org.apache.cxf.ws.addressing.v200408 package.
https://issues.apache.org/jira/browse/CXF-1216

The class in question is
org/apache/cxf/ws/addressing/VersionTransformer.java
It is located in \rt\ws\addr\src\main\java

It uses many classes in the org.apache.cxf.ws.addressing.v200408 package to
construct the returned objects.  This should really be upgraded to a newer
namespace.

Paul


dkulp wrote:
  
http://www.w3.org/2005/08/addressing namespace, so I'm not sure why you 
are getting the 2004/08.   




On Friday 30 November 2007, paul.freeman wrote:


I am trying to test compatibility with .net's WCF implementation.  I
have successfully configured reliable messaging in both CXF and .net. 
The client is .net and the service is CXF.  .net makes the initial

request to create a sequence and expects the response to contain a
RelatesTo header tag.  The namespace for this header tag is an
addressing namespace.

It turns out that CXF returns the addressing namespace
http://schemas.xmlsoap.org/ws/2004/08/addressing

But WCF sent the request with the this namespace:
http://www.w3.org/2005/08/addressing

So the result is that WCF cannot find the RelatesTo header tag.  Is
there a way to change this in CXF to the newer addressing namespace?

I wrote the wsdl with this namespace, which is all together different
as well:
http://www.w3.org/2006/05/addressing/wsdl

Here is the entire message exchange captured by wireshark:
==
POST /saas-identity-2.0-CXF-WSDLFirst/services/IdentityService
HTTP/1.1

Content-Type: text/xml; charset=utf-8

SOAPAction: http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence;

Host: ad1vm-saasdev

Content-Length: 695

Expect: 100-continue

Connection: Keep-Alive



HTTP/1.1 100 Continue



s:Envelope xmlns:s=http://schemas.xmlsoap.org/soap/envelope/;
xmlns:a=http://www.w3.org/2005/08/addressing;s:Headera:Action
s:mustUnderstand=1http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSe
quence/a:Actiona:MessageIDurn:uuid:c211d39e-e26b-4345-8c4a-a5c931ec
210d/a:MessageIDa:To
s:mustUnderstand=1http://ad1vm-saasdev/saas-identity-2.0-CXF-WSDLFi
rst/services/IdentityService/a:To/s:Headers:BodyCreateSequence
xmlns=http://schemas.xmlsoap.org/ws/2005/02/rm;AcksToa:Addressht
tp://www.w3.org/2005/08/addressing/anonymous/a:Address/AcksToOffer
  

Identifierurn:uuid:a7418b78-869a-4dcf-a99e-3ebdbc5e6862/Identifier


/Offer/CreateSequence/s:Body/s:EnvelopeHTTP/1.1 200 OK

Date: Fri, 30 Nov 2007 16:42:27 GMT

Server: Microsoft-IIS/6.0

X-Powered-By: ASP.NET

X-Powered-By: Servlet 2.4; JBoss-4.2.0.GA (build:
SVNTag=JBoss_4_2_0_GA date=200705111440)/Tomcat-5.5

SOAPAction: http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence;

Content-Type: text/xml;charset=utf-8

Content-Length: 538



soap:Envelope
xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;soap:HeaderM
essageID
xmlns=http://schemas.xmlsoap.org/ws/2004/08/addressing;urn:uuid:297a
0df9-d5d6-4ff9-850d-7ff7a9740178/MessageIDRelatesTo
xmlns=http://schemas.xmlsoap.org/ws/2004/08/addressing;
RelationshipType=replyurn:uuid:c211d39e-e26b-4345-8c4a-a5c931ec210d
/RelatesToAction
xmlns=http://schemas.xmlsoap.org/ws/2004/08/addressing;http://schema
s.xmlsoap.org/ws/2005/02/rm/CreateSequenceResponse/Action/soap:Heade
rsoap:Body //soap:Envelope
  


--
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog





  


Re: Annotations

2007-12-02 Thread Willem Jiang

Hi,
I do not think JAXB's annotation can implment the behavior that you want.
Maybe you can define a parent class to be used in the method A, and a 
child class which extends the parent class with addition attributes to 
be used in the method B.


Cheers,
Willem.

Thorsten Kraus wrote:
Thanks a lot for your answer! The overview of the annotation types 
helpes me very much.
Perhaps you could give me an advice for the following problem: I have 
two methods which use the same bean class. In one method, I want to 
use all attributes of the bean. In the other method, I want to use 
only a subset of the bean attributes in my web service request. Is 
there a possibility to annotate the attributes or the corresponding 
methods to implement this behaviour?


Regards,
TMK

Jiang, Ning (Willem) schrieb:

Hi,

You can take a look at this doc[1] which is useful for working on the 
JAXB2 annotation.

[1]http://www.caucho.com/resin-3.1/doc/jaxb-annotations.xtp

Willem.

-Original Message-
From: Thorsten Kraus [mailto:[EMAIL PROTECTED]
Sent: Sun 12/2/2007 1:48
To: cxf-user@incubator.apache.org
Subject: Annotations
 
Hello,


I have a method which has a custom bean object in its signature. This 
method should be accessable via SOAP.
I want to mark some attributes of this bean object as required and 
some other attributes I don't want to include in the request -- 
these attributes should not exist in the generated WSDL.
Can someone tell me how I can annotate this attributes that the 
needed behaviour is generated?


Regards,
TMK

  




Re: odd injection error in running sample jms project

2007-11-29 Thread Willem Jiang

Can you fill a JIRA[1] and submit your test case ?
It will helpful for use to trace the bug.

[1]http://issues.apache.org/jira/browse

Willem.
ahwulf wrote:

If I turn off FINE and thus ignore the error, the server app still doesn't
load - it loops endlessly apparently reloading all the beans. I replaced the
Spring version with 2.0.7 but it made no difference.

This is the section that repeats.

INFO: Pre-instantiating singletons in
[EMAIL PROTECTED]:
defining beans
[cxf,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.transport.local.LocalTransportFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache.cxf.transport.servlet.ServletTransportFactory,org.apache.cxf.transport.jms.JMSTransportFactory,{http://service.test/}HelloWorldPort.jms-conduit,{http://service.test/}HelloWorldPort.jms-destination];
root of factory hierarchy
Nov 28, 2007 8:23:05 AM
org.springframework.context.support.AbstractApplicationContext
prepareRefresh
INFO: Refreshing [EMAIL PROTECTED]:
display name [EMAIL PROTECTED];
startup date [Wed Nov 28 08:23:05 CST 2007]; root of context hierarchy
Nov 28, 2007 8:23:05 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [cxf.xml]
Nov 28, 2007 8:23:05 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf.xml]
Nov 28, 2007 8:23:05 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf-extension-soap.xml]
Nov 28, 2007 8:23:05 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf-extension-local.xml]
Nov 28, 2007 8:23:05 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf-extension-http.xml]
Nov 28, 2007 8:23:05 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf-servlet.xml]
Nov 28, 2007 8:23:05 AM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf-extension-jms.xml]
Nov 28, 2007 8:23:05 AM
org.springframework.beans.factory.support.DefaultListableBeanFactory
registerBeanDefinition
INFO: Overriding bean definition for bean 'cxf': replacing [Root bean: class
[org.apache.cxf.bus.CXFBusImpl]; scope=singleton; abstract=false;
lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0;
factoryBeanName=null; factoryMethodName=null; initMethodName=null;
destroyMethodName=null; defined in class path resource
[META-INF/cxf/cxf.xml]] with [Root bean: class
[org.apache.cxf.bus.CXFBusImpl]; scope=singleton; abstract=false;
lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0;
factoryBeanName=null; factoryMethodName=null; initMethodName=null;
destroyMethodName=null]
Nov 28, 2007 8:23:05 AM
org.springframework.context.support.AbstractApplicationContext
obtainFreshBeanFactory
INFO: Bean factory for application context
[EMAIL PROTECTED]:
[EMAIL PROTECTED]
Nov 28, 2007 8:23:05 AM
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not
eligible for getting processed by all BeanPostProcessors (for example: not
eligible for auto-proxying)
Nov 28, 2007 8:23:05 AM
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is not
eligible for getting 

Re: restful_http_binding and WebServiceContext

2007-11-28 Thread Willem Jiang

FYI , DI happens in JaxWsServerFactoryBean's[1] init() method.

[1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java

Willem.

Davide Gesino wrote:

Hi,

It's quite strange, the context should be injected... I think the only way
to obtain the WebServiceContext is through DI, I have not found a way to
obtai ntha same programmatically.
Did you provide getters and setters for the WebServiceContext? May depend on
that.

Davide



Michael Nelson-5 wrote:
  

I am trying to figure out how to get access to WebServiceContext in the
restful_http_binding sample that comes with CXF. In
CustomerServiceImpl.java,
I've added:

@Resource
private WebServiceContext wsContext;

to the CustomerServiceImpl class.

But wsContext isn't set when methods are invoked. I've looked through the
archives and the only issue I've seen seems to be if you use Spring and
transactions (CXF-1074).

I am new to CXF, so I may be doing something fundamentally wrong here.

Any ideas?

Thanks,
-mike





  


Re: disable-address-updates breaks ServiceName?wsdl url

2007-11-27 Thread Willem Jiang


I just find the base-address parameters that you set is start with 
https, cxf_servlet do not support this configuration.


After I went through the  servlet control code, I found the key of your 
issue.
If you set the  disable-address-updates parameter to be true, servlet 
control will not update the endpoint address.
For your case , if you want to override the endpoint address with the 
url that you want , you should not use

the disable-address-updates parameter.

private synchronized void updateDests(HttpServletRequest request) {
   if (disableAddressUpdates) {
   return;
   }
   String base = forcedBaseAddress == null ? getBaseURL(request) : 
forcedBaseAddress;
  
   if (base.equals(lastBase)) {

   return;
   }
   SetString paths = transport.getDestinationsPaths();
   for (String path : paths) {
   ServletDestination d2 = transport.getDestinationForPath(path);
   String ad = d2.getEndpointInfo().getAddress();
   if (ad.equals(path)
   || ad.equals(lastBase + path)) {
   d2.getEndpointInfo().setAddress(base + path);
   if (d2.getEndpointInfo().getExtensor(AddressType.class) 
!= null) {
   
d2.getEndpointInfo().getExtensor(AddressType.class).setLocation(base + 
path);

   }
   }
   }
   lastBase = base;
   }


Willem.


Christian Vest Hansen wrote:

2007/11/27, Willem Jiang [EMAIL PROTECTED]:
  

Can I see your whole web.xml and endpoint configuration file (bean.xml
or cxf-servlet.xml)?
I think there must be something wrong with them.



See mail attachment. I'm attaching these files as-is without any
obfuscation, so excuse if they're a bit big.

  

BTW,
Can you get the wsdl by removing the disable-address-updates and
base-addresses parameters in your web.xml?



Yes.

  

Willem.

Christian Vest Hansen wrote:


I tried this, but I can't seem to hit home on any of these base-addresses:
http://localhost:8080/myapp
http://localhost:8080/myapp/
http://localhost:8080/myapp/services
http://localhost:8080/myapp/services/

Regardless, my point was that I still wanted to access the wsdl at the
same url, just without having updated endpoint urls in the wsdl.


2007/11/25, Willem2 [EMAIL PROTECTED]:

  

If you set the disable-address-updates , you also need to set the
base-address like http://localhost:8080/myapp
Since CXF servlet will not update the endpoint address with the request url,
you need to specify the base-address to build up a real accessible address
for the endpoint.

Willem.


Christian Vest Hansen wrote:



Usually, you can access the WSDL of a service by appending ?wsdl to
the endpoint url and end up with something like this:
http://localhost:8080/myapp/ServiceName?wsdl

However, if you add the disable-address-updates init-param to your
CXFServlet in web.xml like this:


servlet
servlet-nameCXFServlet/servlet-name
display-nameCXF Servlet/display-name

servlet-classorg.apache.cxf.transport.servlet.CXFServlet/servlet-class
init-param
param-namedisable-address-updates/param-name
param-valuetrue/param-value
/init-param
load-on-startup1/load-on-startup
/servlet

Then you're no longer able to access the WSDL file at the address above.

Is this correct behaviour? I'de rather like to be able to access the
WSDL regardless of the presence of this init-param.



--
Venlig hilsen / Kind regards,
Christian Vest Hansen.



  

--
View this message in context: 
http://www.nabble.com/disable-address-updates-breaks-ServiceName-wsdl-url-tf4862292.html#a13931696
Sent from the cxf-user mailing list archive at Nabble.com.






  



  


Re: New Servlet

2007-11-27 Thread Willem Jiang

Hi Guillaume

You can find the samples in the Servlet systest[1] (Spring or Non-Spring).

[1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet

Cheers,
Willem.

tog wrote:

Hiya,

Is there somewhere an example of the on spring servlet usage ?

Cheers
Guillaume

  


Re: disable-address-updates breaks ServiceName?wsdl url

2007-11-26 Thread Willem Jiang
Can I see your whole web.xml and endpoint configuration file (bean.xml 
or cxf-servlet.xml)?

I think there must be something wrong with them.
BTW, 
Can you get the wsdl by removing the disable-address-updates and 
base-addresses parameters in your web.xml?


Willem.

Christian Vest Hansen wrote:

I tried this, but I can't seem to hit home on any of these base-addresses:
http://localhost:8080/myapp
http://localhost:8080/myapp/
http://localhost:8080/myapp/services
http://localhost:8080/myapp/services/

Regardless, my point was that I still wanted to access the wsdl at the
same url, just without having updated endpoint urls in the wsdl.


2007/11/25, Willem2 [EMAIL PROTECTED]:
  

If you set the disable-address-updates , you also need to set the
base-address like http://localhost:8080/myapp
Since CXF servlet will not update the endpoint address with the request url,
you need to specify the base-address to build up a real accessible address
for the endpoint.

Willem.


Christian Vest Hansen wrote:


Usually, you can access the WSDL of a service by appending ?wsdl to
the endpoint url and end up with something like this:
http://localhost:8080/myapp/ServiceName?wsdl

However, if you add the disable-address-updates init-param to your
CXFServlet in web.xml like this:


servlet
servlet-nameCXFServlet/servlet-name
display-nameCXF Servlet/display-name

servlet-classorg.apache.cxf.transport.servlet.CXFServlet/servlet-class
init-param
param-namedisable-address-updates/param-name
param-valuetrue/param-value
/init-param
load-on-startup1/load-on-startup
/servlet

Then you're no longer able to access the WSDL file at the address above.

Is this correct behaviour? I'de rather like to be able to access the
WSDL regardless of the presence of this init-param.



--
Venlig hilsen / Kind regards,
Christian Vest Hansen.


  

--
View this message in context: 
http://www.nabble.com/disable-address-updates-breaks-ServiceName-wsdl-url-tf4862292.html#a13931696
Sent from the cxf-user mailing list archive at Nabble.com.






  


Re: restful_http_binding and WebServiceContext

2007-11-25 Thread Willem Jiang

Hi Mike,

I just checked the code , you need to specify the Service Bean object to 
be injected with the WebServiceContext.


Here is an example for you:
private static void createRestService(Object serviceObj) {
   // Build up the server factory bean
   JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
   sf.setServiceClass(CustomerService.class);
   // Use the HTTP Binding which understands the Java Rest Annotations
   sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
   sf.setAddress(http://localhost:8080/xml/;);
   // *** just set the service object as the service bean directly 
, to get the webservice context object to been injected.

   sf.setServiceBean(serviceObj);

   // Turn the wrapped style off. This means that CXF won't generate
   // wrapper XML elements and we'll have prettier XML text. This
   // means that we need to stick to one request and one response
   // parameter though.
   sf.getServiceFactory().setWrapped(false);

   sf.create();
   }

Willem.

Michael Nelson wrote:

I am trying to figure out how to get access to WebServiceContext in the
restful_http_binding sample that comes with CXF 2.0.3. In
CustomerServiceImpl.java, I've added:

@Resource
private WebServiceContext wsContext;

to the CustomerServiceImpl class.

But wsContext isn't set when methods are invoked. I've looked through the
archives and the only issue I've seen seems to be if you use Spring and
transactions.

I am new to CXF, so I may be doing something fundamentally wrong here.

Any ideas?

Thanks,
-mike

  


Re: How to export non-annotated service in spring

2007-11-20 Thread Willem Jiang

Hi,

You can use the simple front end custom server bean definition.
Please see [1] for more information.

[1] http://cwiki.apache.org/CXF20DOC/simple-frontend.html

Willem.
ojs wrote:

Hello,

I'm trying to switch from xfire to cxf - don't had much luck so far...

My xfire configuration (in spring) looks like:

bean name=/myService
class=org.codehaus.xfire.spring.remoting.XFireExporter
property name=serviceInterface value=myBean/
property name=serviceBean ref=myBeanImpl/
property name=xfire ref=xfire/
/bean

So Spring's DispatcherServlet handles the request and forward request to
/myService to this bean. The service I'm exporting isn't (and shouldn't be)
annotated. Is there a similar thing in cxf to export a service as it is
possible with xfire?


Best

Oliver
  


Re: How to export non-annotated service in spring

2007-11-20 Thread Willem Jiang

Hi,

Can you show me your web.xml ?
There must be something wrong with your web.xml.

Willem.
ojs wrote:

Willem2 wrote:
  

You can use the simple front end custom server bean definition.
Please see [1] for more information.

[1] http://cwiki.apache.org/CXF20DOC/simple-frontend.html



I tried that, but it seems that simple front end tries to start a separate
http server (jetty) instance?! Or did I misunderstand something?

  


Re: Gzip encoding

2007-11-09 Thread Willem Jiang

Hi Richard,

Which version of CXF do you use?
I think it probably is a bug of the JaxWsClientProxyFactoryBean.

Willem.
Shaw, Richard A wrote:

I've tried this and it doesn't seem to work. My config file is shown below. The 
http-conf works fine but not the jaxws:client. I've tried uisng a features 
instead of the inInterceptor but it makes no difference. The only time it works 
is when I use the config at the bottom which adds the interceptor to the bus.

?xml version=1.0 encoding=UTF-8?
beans xmlns=http://www.springframework.org/schema/beans;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns:http-conf=http://cxf.apache.org/transports/http/configuration;
  xmlns:jaxws=http://cxf.apache.org/jaxws;
  xmlns:sec=http://cxf.apache.org/configuration/security;
  xsi:schemaLocation=http://cxf.apache.org/transports/http/configuration 
http://cxf.apache.org/schemas/configuration/http-conf.xsd
  http://cxf.apache.org/jaxws 
http://cxf.apache.org/schemas/jaxws.xsd
  http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd;

http-conf:conduit 
name={http://datex2.eu/wsdl/clientPull/1_0}clientPullSoapEndPoint.http-conduit;
http-conf:client AcceptEncoding=gzip, deflate/
http-conf:authorization
sec:UserNameme/sec:UserName
sec:Passwordpassword/sec:Password
/http-conf:authorization
/http-conf:conduit

bean id=GZIPStream 
class=com.atkinsglobal.mosaic.cxf.extensions.GZipInterceptor/

jaxws:client name={http://datex2.eu/wsdl/clientPull/1_0}clientPullSoapEndPoint; 
createdFromAPI=true
!-- jaxws:features
 bean class=com.atkinsglobal.mosaic.cxf.extensions.GZipFeature/
 /jaxws:features--
   jaxws:inInterceptors
ref bean=GZIPStream/
   /jaxws:inInterceptors
/jaxws:client

!-- We are adding the interceptors to the bus as we will have only one endpoint/service/bus. 
bean id=cxf class=org.apache.cxf.bus.CXFBusImpl

property name=inInterceptors
list
ref bean=GZIPStream/
/list
/property
property name=outInterceptors
list
ref bean=GZIPStream/
/list
/property
/bean 
--
/beans 



Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems 

Atkins Highways and Transportation 
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW


Tel: +44 (0) 1372 756407 
Fax: +44 (0) 1372 740055
Mob: 07740 817586 
E-mail: [EMAIL PROTECTED]


www.atkinsglobal.com/its

-Original Message-
From: Liu, Jervis [mailto:[EMAIL PROTECTED] 
Sent: 05 November 2007 03:03

To: cxf-user@incubator.apache.org
Cc: Shaw, Richard A
Subject: RE: Gzip encoding

Hi Shaw, you can configure your client side interceptors using feature. An 
example can be found from dispatch system test: 
\trunk\systests\src\test\java\org\apache\cxf\systest\dispatch\TestDispatchFeature.java
 and client-config.xml.

Cheers,
Jervis

  

-Original Message-
From: Daniel Kulp [mailto:[EMAIL PROTECTED]
Sent: 2007?11?3? 1:43
To: cxf-user@incubator.apache.org
Cc: Shaw, Richard A
Subject: Re: Gzip encoding



Hmm...   not really sure how to add it to the dispatch style suff via 
spring.   Interesting.   

That said, bus level might make sense if the interceptor was updated 
to
handle the case where it's not gzip as well.   
Basically, Accept-Encoding is a hint and the server may not respond 
in
gzip form.   Thus, the interceptor should check the request 
header and
if the headers don't say it's gzipped, skip it. 

The interceptor may also need to reset the Message.CONTENT_TYPE and 
Message.ENCODING properties.   Not really sure though.


Dan


On Friday 02 November 2007, Shaw, Richard A wrote:

In reply to my previous message I can see that there is an example 
interceptor to GZIP. I've copied this but now I don't know
  

how to add


it to my dispatch call.

The example adds it to the bus, but I have other services on the bus 
which are not using GZIP.


I've found an example that adds it to a jaxws:client but it needs a 
serviceClass and I don't have one because I'm using the dispatch 
interface.


Can anybody help. Ideally I'd like to add it to my spring
  

config. But


if I have to add it to my code I can live with that to get
  

it working.


Thanks


Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤
  

ø,¸¸,ø¤


Richard Shaw
Technical Design Authority - Information Solutions Consultancy 
Intelligent Transport Systems


Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407
Fax: +44 (0) 1372 740055
Mob: 07740 

Re: Return direct XML

2007-11-07 Thread Willem Jiang

Hi,

You can try it.  I am also looking forward that the DynamicClientFactory 
can work with Aegis Binding.

And the patch of it is welcome :)

Willem.

Benjamin Coiffe wrote:

Hi,

I was trying to use Aegis Binding on the Dynamic client
(DynamicClientFactory.createClient()) but it is hard coded to use JAXB.
Is there a specific reason for this or could I confidently modify the
source code of my distribution and expect it to run using Aegis
bindings?

Thanks,

Ps: benson, the fix for CXF-1168 works for me in 2.0.1. Thx!

-Original Message-
From: Benson Margulies [mailto:[EMAIL PROTECTED] 
Sent: 07 November 2007 02:38

To: cxf-user@incubator.apache.org
Subject: RE: Return direct XML

I believe that Aegis allows you to have a return type of
org.w3c.Document or the JDOM equivalent, and XML will appear.

  

-Original Message-
From: Liu, Jervis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 06, 2007 9:32 PM
To: cxf-user@incubator.apache.org
Subject: RE: Return direct XML

In your case, looks like the easiest way is to use JAX-WS Provider API
with XML Binding. You will find a bunch of different type of Provider
implementations under system test:



https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/j
av
  

a/org/apache/cxf/systest/provider/. Of course the limitation is that


the
  

input of your function has to be in XML format as well (can be
Source/SOAPMessage/DataSource, depend on your mode and binding), in


some
  

cases you may find its hard to parse input from XML by yourself.

Cheers,
Jervis



-Original Message-
From: Roshan A. Punnoose [mailto:[EMAIL PROTECTED]
Sent: 2007?11?7? 4:08
To: cxf-user@incubator.apache.org
Subject: Return direct XML


Hi,



What is the easiest way to return XML directly? For example, in my
function, if I create XML, I want to be able to send that object
directly back to the calling client. Is this possible?



Roshan


  


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


Ireland

  


Re: client https and server http

2007-11-07 Thread Willem Jiang

One comment about configuring the http conduit with Java code.
The configure the http conduit with Java code should work, you just need 
set the right endpoint address.

Please check out the CXF systest [1] 's testHttpsBasicConnection().

[1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/HTTPConduitTest.java


Willem.

Abid Hussain wrote:

Hi again,

I finally got it. I had to put the http:conduit in my configuration:

http:conduit 
name={http://ws.kvv.mi.fuberlin.de/}KvvServiceImplService.http-conduit;

http:tlsClientParameters secureSocketProtocol=SSL /
/http:conduit

Sorry for that.

But I find that xfire is really hard to handle, cause it uses all this 
spring stuff which is quite confusing, if you're not familiar to 
spring (like me).
Everytime something isn't working, I wonder if it's some mysterious 
spring behaviour and don't recognise that the solution (like above) is 
pretty easy.


I'm trying to set up a services and clients using CXF for a couple of 
weeks. Before I was using XFire. Till now my experience is that XFire 
was MUCH easier to configure and to handle.


Best regards,

Abid


Abid Hussain schrieb:

Hi everybody,

I have the following problem:
My web application contains
- a Web Service and
- a client (which calls another Web Service).

The client calls the remote service using https whereas the service 
deployed in my application should use http.


I have configured the service as following:
beans xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:jaxws=http://cxf.apache.org/jaxws;
xsi:schemaLocation=http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
  http://cxf.apache.org/jaxws 
http://cxf.apache.org/schemas/jaxws.xsd;


import resource=classpath:META-INF/cxf/cxf.xml /
import resource=classpath:META-INF/cxf/cxf-extension-soap.xml /
import resource=classpath:META-INF/cxf/cxf-servlet.xml /

jaxws:endpoint id=moduleServiceImpl
implementor=modulverwaltung.service.ModuleServiceImpl
address=/ModuleService /
/beans

I did the clients's https configuration in the program code:
Client client = ClientProxy.getClient(port);
HTTPConduit conduit = (HTTPConduit) client.getConduit();
TLSClientParameters tlsParams = new TLSClientParameters();
conduit.setTlsClientParameters(tlsParams);

When I try to call the remote service from my client, the following 
happens:

INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
at 
org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:48) 

at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) 


at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
at 
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)

at $Proxy33.getLecturers(Unknown Source)
at 
kvv.service.client.KvvServiceClient.getLecturers(KvvServiceClient.java:74) 

at 
modulverwaltung.tools.AdaptLecturersToKvv.main(AdaptLecturersToKvv.java:29) 

Caused by: java.io.IOException: Illegal Protocol http for HTTPS 
URLConnection Factory.
at 
org.apache.cxf.transport.https.HttpsURLConnectionFactory.createConnection(HttpsURLConnectionFactory.java:124) 

at 
org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:475)
at 
org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46) 


... 8 more

Would be thankful for any help...

Best regards,

Abid Hussain





Re: Return direct XML

2007-11-07 Thread Willem Jiang
Yep, I think the initial thought  just wanted  it works only by setting 
the JAXB Context with the WSDL dynamically,

it may skip the part of JAXB DataBinding.
Maybe we can get it workable by refactoring the DynamicClientFactory to 
accept different DataBinding Context ?

I don't know if Aegis  can generate the type class from WSDL just like XJC.
Or we do not need do it  for Aegis DataBinding.

Any other thought?

Willem.

Benson Margulies wrote:

The dynamic client is situated in the source in a place that surprised
me, and this aspect fits with that. Go ahead and give it a try, it
should just have a DataBinding instance that could be made settablr.

  

-Original Message-
From: Benjamin Coiffe [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 07, 2007 3:45 AM
To: cxf-user@incubator.apache.org
Subject: RE: Return direct XML

Hi,

I was trying to use Aegis Binding on the Dynamic client
(DynamicClientFactory.createClient()) but it is hard coded to use


JAXB.
  

Is there a specific reason for this or could I confidently modify the
source code of my distribution and expect it to run using Aegis
bindings?

Thanks,

Ps: benson, the fix for CXF-1168 works for me in 2.0.1. Thx!

-Original Message-
From: Benson Margulies [mailto:[EMAIL PROTECTED]
Sent: 07 November 2007 02:38
To: cxf-user@incubator.apache.org
Subject: RE: Return direct XML

I believe that Aegis allows you to have a return type of
org.w3c.Document or the JDOM equivalent, and XML will appear.



-Original Message-
From: Liu, Jervis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 06, 2007 9:32 PM
To: cxf-user@incubator.apache.org
Subject: RE: Return direct XML

In your case, looks like the easiest way is to use JAX-WS Provider
  

API
  

with XML Binding. You will find a bunch of different type of
  

Provider
  

implementations under system test:

  

https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/j
  

av


a/org/apache/cxf/systest/provider/. Of course the limitation is that
  

the


input of your function has to be in XML format as well (can be
Source/SOAPMessage/DataSource, depend on your mode and binding), in
  

some


cases you may find its hard to parse input from XML by yourself.

Cheers,
Jervis

  

-Original Message-
From: Roshan A. Punnoose


[mailto:[EMAIL PROTECTED]
  

Sent: 2007?11?7? 4:08
To: cxf-user@incubator.apache.org
Subject: Return direct XML


Hi,



What is the easiest way to return XML directly? For example, in my
function, if I create XML, I want to be able to send that object
directly back to the calling client. Is this possible?



Roshan





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

Ireland



  


Re: JMS configuration for consumer

2007-11-07 Thread Willem Jiang

Hi Patrick,

I don't think CXF JMS transport will recognize the address that you 
wrote in the soap:address.
Now CXF JMS transport just consumer the address information which define 
as jms:address which is defined by CXF itself.

You can find some example wsdl here [1].

BTW It looks like your address is coming form soap/jms binding. 
Currently CXF do not support it yet.

[1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_doc_lit.wsdl

Willem.

Patrick Mulligan wrote:

This also applies to the binding element as well in terms of generic 
applicability, standards, etc.  :-)


From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: JMS configuration for consumerDate: 
Wed, 7 Nov 2007 08:09:39 -0500


Hi, In the JMS configuration docuement (for consumer only in this case), it specified that the configuration can be done either by WSDL or 
configuration file.   Can this be mixed with a portion in wsdl and configuration? Is the WSDL configuration for JMS consumers standard?  That is, is 
the syntax of the port element contents standardized or are they specific to a JMS impl? This is a snip from a commercial JMS that I need to connect 
to: wsdl:port binding=tns:ESB_VehicleManagementSOAP_JMS_Binding name=SOAP_JMS_Portsoap:address 
location=jms:/queue?destination=jms/SoapOutputamp;connectionFactory=jms/outboundSoapJmsQCFamp;replyToDestination=jms/SoapInputamp;targetService=ESB_VehicleManagement_DialogPlus//wsdl:port
 Does a cxf jms consumer need to know the cxf JMS namespace if definded by wsdl? BTW, we want to have the default tempory queue setup for 
request/reply.

Peek-a-boo FREE Tricks  Treats for You! Get 'em! 
_

Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline
  


Re: Bus has no BindingFactoryManager extension in AbstractBindingFactory.registerWithBindingManager

2007-11-06 Thread Willem Jiang

Hi Tom,

Can you try your application with the Spring 2.0.6?
We did not develop and test CXF with Spring 2.5-rc1.

Willem.

Tom Davies wrote:
I'm using apache-cxf-2.0.3-incubator-20071102.144221-7 (although I see 
the same problem with 2.0.2) and Spring 2.5-rc1


I have a simple servlet configuration exactly as described here: 
http://cwiki.apache.org/CXF20DOC/servlet-transport.html

 and the cxf component of my spring config looks like this:

   import resource=classpath:META-INF/cxf/cxf.xml/
  import resource=classpath:META-INF/cxf/cxf-extension-soap.xml/
  import resource=classpath:META-INF/cxf/cxf-servlet.xml/

jaxws:endpoint id=rpcReviewService
implementor=com.atlassian.crucible.spi.rpc.RpcReviewServiceImpl
address=/review
   /

RpcReviewServiceImpl.java Is:

@Component
@WebService(endpointInterface=com.atlassian.crucible.spi.rpc.RpcReviewService) 


@SOAPBinding(style=Style.RPC, use= Use.LITERAL)
public class RpcReviewServiceImpl implements RpcReviewService {
private ReviewService reviewService;

public ReviewData createReview(ReviewData review) {
return reviewService.createReview(review);
}

public ListReviewData getAllReviews() {
return reviewService.getAllReviews();
}

public void setReviewService(ReviewService reviewService) {
this.reviewService = reviewService;
}
}

When I start my app (running in Jetty) I have an NPE here:

[java] java.lang.NullPointerException
 [java] at 
org.apache.cxf.binding.AbstractBindingFactory.registerWithBindingManager(AbstractBindingFactory.java:60) 

 [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
 [java] at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 

 [java] at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 


 [java] at java.lang.reflect.Method.invoke(Method.java:585)
 [java] at 
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:209) 

 [java] at 
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:180) 

 [java] at 
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:98) 

 [java] at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:322) 

 [java] at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1299) 

 [java] at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:532) 

 [java] at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:238) 

 [java] at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:167) 

 [java] at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:235) 

 [java] at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:167) 

 [java] at 
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:867) 

 [java] at 
org.apache.cxf.configuration.spring.SpringBeanMap.get(SpringBeanMap.java:193) 

 [java] at 
org.apache.cxf.configuration.spring.SpringBeanMap$Entry.getValue(SpringBeanMap.java:258) 

 [java] at 
org.springframework.beans.TypeConverterDelegate.convertToTypedMap(TypeConverterDelegate.java:469) 


...

meaning that in:
public abstract class AbstractBindingFactory...
...
 @PostConstruct
void registerWithBindingManager() {
BindingFactoryManager manager = 
bus.getExtension(BindingFactoryManager.class);

for (String ns : activationNamespaces) {
manager.registerBindingFactory(ns, this);
}
}

bus.getExtension(BindingFactoryManager.class) is returning null.

Any advice would be welcome.

Thanks,
  Tom

--
ATLASSIAN - http://www.atlassian.com
Our products help over 8,500 customers in more than 95 countries to 
collaborate








Re: Transactional web service using CXF, Spring and JPA

2007-11-05 Thread Willem Jiang

Yep,  CXF has the invoker[1]  to take care the whole invoking stuff.
Jeff just showed you the basic use  scenario which treats the 
implementor as a singleton in the default bean Invoker.
All the client sides concurrency invocations will be end up in this 
singleton invoker, so we can still use the spring to transaction 
management here.


[1]http://cwiki.apache.org/CXF20DOC/invokers.html

Willem.

Jeff Yu wrote:

Hi,

You need to delegate the transaction to spring, not the cxf.

like:

   jaxws:endpoint id=myService 
implementorClass=net.java.dev.service.MyServiceImpl 
implementor=#myService address=/theService

   /jaxws:endpoint

   bean id=myService class=net.java.dev.service.MyServiceImpl
   /bean

  ...

here the myService is with transaction, with other spring-specific 
config to add transaction.


Best Regards
Jeff

Karl Goldstein wrote:

Greetings,
 I've been experimenting with creating a transactional web service
using CXF, Spring and JPA/Hibernate.  The basic examples I've seen of
such services look like this:
 @Transactional
@WebService(...)
public class MyService implements MyServiceInterface {
@PersistenceContext
  private EntityManager em;
public void myOperation() throws DataAccessException {
...
// use injected entity manager
em.find(...)
...
  }
}
  and the Spring config has this:
  tx:annotation-driven transaction-manager=transactionManager /
  ...
  jaxws:server id=myService serviceClass=MyServiceInterface
  address=/Service
  jaxws:serviceBean
bean id=myServiceBean
  class=MyService autowire=autodetect /
  /jaxws:serviceBean
/jaxws:server
 Here's what I would expect to happen with a transactional web 
service

based on JPA:
  - Request begins
 - System begins new unit of database work by creating a new 
EntityManager

 - All database interactions in the request use the same EntityManager
 - Request finishes processing
 - Transaction commits or rolls back (if an error occurred)
 - Response sent
 As far as I can tell, Spring is only creating one instance of my
service bean, and injecting a single EntityManager into it when it
does so.  This clearly won't work when handling multiple concurrent
requests, since EntityManager is not thread-safe and a new one needs
to be instantiated for each unit of work.
 Is the above setup actually right?  Can anyone point me to an 
example of how to wire this all together correctly?  I'm about to 
give up on using Spring transactional support and go back to just 
implementing my own simple transactional wrapper and making the 
EntityManager available to DAOs through a ThreadLocal.

 Thanks,
 Karl


 __
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com   




Re: other spring cxf resources ?

2007-11-05 Thread Willem Jiang

Hi ,

Actually,  you could change the client's service URL per message.
You can find more information here [1]

[1]http://www.nabble.com/Client-question-tf4357978.html#a12419843

Willem.

Mohammad Shamsi wrote:

Hi Glen,

Sorry, my application is not really a distributed app. i just run it on 9
servers, all 9 server connect to  one database, but they are work
standalone. and they don't know about each other.

for some reason i wan't to collect some info from each app server and show
them together in  one client. Service in all 9 Server is same, but at least
in URL, they are deferent.

http://server1:port/MyService

http://server2:port2/MyService

http://server3:port3/MyService
.
.
.




On 11/4/07, Glen Mazza [EMAIL PROTECTED] wrote:
  

Do you have a WSDL?  Just follow the links I gave.  That fact that you
have 9 servers or 900 shouldn't matter--the URL in the WSDL would be the
same for all the servers your app is distributed on (just as it is the
same for your web application as a whole, correct?)

Glen

Am Sonntag, den 04.11.2007, 21:42 +0330 schrieb Mohammad Shamsi:


Hi All,

   I have a spring based Java EE application,
   this application destirbuted on 9 servers,  i want to add a Web
  

Service


to this application,

i want now how to call these 9 servers web service with a client ?

i read spring cxf sample, client part of this sample in beans.xmlare
somthing like this :

bean id=client class=demo.spring.HelloWorldImpl
  factory-bean=clientFactory factory-method=create/

bean id=clientFactory class=
org.apache.cxf.jaxws.JaxWsProxyFactoryBean
  property name=serviceClass value=demo.spring.HelloWorld/
  property name=address value=
http://localhost:8080/cxf/wscxf/HelloWorld/
/bean

with this guide, i have to define 9 bean like this client bean and 9
clientFactory bean.

is there any simpler way to do this?
  




  


Re: ClientFactoryBean AbstractMethodError

2007-11-05 Thread Willem Jiang

Hi ,

Can you check xercesImpl-2.8.1.jar is in the class path of your test 
with JUnit?

I can find the method

org.apache.xerces.dom.DocumentImpl.getInputEncoding() in that jar.

Willem.

Todd Orr wrote:

hanks. That doesn't really explain, to me, why the server starts up
fine when deployed but fails with the error shown when run in a JUnit
test. The demo is able to create a service in JUnit without problem.
In this particular JUnit, rather than relying on Spring configuration,
I was attempting to create the server myself using the following code:

private Server createRestServer(SessionFactory sessionFactory) {
MyServiceImpl service = new MyServiceImpl();
service.setSessionFactory(sessionFactory);

JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
sf.setServiceClass(MyServiceInterface.class);
sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
sf.setAddress(http://localhost:8080/rest/;);
sf.getServiceFactory().setInvoker(new BeanInvoker(service));
sf.getServiceFactory().setWrapped(true);

return sf.create();
}

This is almost exactly the same as the server code from the demo - the
code that works. However, in my example I receive the stack trace from
above on the sf.create() method.

On 11/4/07, Liu, Jervis [EMAIL PROTECTED] wrote:
  

I probabaly should remove JAX-WS style client codes from restful_http_binding 
demo, as it constantly causes confusions. In theory, JAX-WS style client APIs 
should work with RESTful services that published using CXF HTTP binding, as 
this is symmetric to what the server side has to do to marshal/unmarshal 
request/response. But in reality, this does not work because a). This JAX-WS 
style client APIs support is not completed yet. b). I don't think there will be 
much value added by supporting JAX-WS style client APIs. This JAX-WS style 
client APIs wont work without a WSDL, most RESTful services wont have a WSDL. 
More comments about client side REST API support can be found in [1].

[1].  
http://www.nabble.com/Using-verbs-other-than-GET-from-a-RESTful-client-application-tf4628659.html

Cheers,
Jervis



-Original Message-
From: Todd Orr [mailto:[EMAIL PROTECTED]
Sent: 2007?11?5? 10:41
To: cxf-user@incubator.apache.org
Subject: ClientFactoryBean AbstractMethodError


I have been trying to get a REST service up and running. I believe the
server is up. However, creating the client is problematic. Using the
following code borrowed from the bundled rest sample:

JaxWsProxyFactoryBean sf = new JaxWsProxyFactoryBean();
sf.setServiceClass(MyServiceInterface.class);

// Turn off wrapped mode to make our xml prettier
sf.getServiceFactory().setWrapped(false);

// Use the HTTP Binding which understands the Java Rest Annotations
sf.getClientFactoryBean().setBindingId(HttpBindingFactory.HTTP
  

_BINDING_ID);


sf.setAddress(http://localhost:8080/rest/;);
this.service = (MyServiceInterface) sf.create();


I receive the following exception:

java.lang.AbstractMethodError:
org.apache.xerces.dom.DocumentImpl.getInputEncoding()Ljava/lan
  

g/String;


  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
  

orImpl.java:39)


  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
  

odAccessorImpl.java:25)


  at java.lang.reflect.Method.invoke(Method.java:597)
  at
org.apache.ws.commons.schema.utils.DOMUtil.getInputEncoding(DO
MUtil.java:594)
  at
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchem
aCollection.java:348)
  at
org.apache.cxf.databinding.source.AbstractDataBinding.addSchem
aDocument(AbstractDataBinding.java:73)
  at
org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding
  

.java:224)


  at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.bu
ildServiceFromClass(ReflectionServiceFactoryBean.java:293)
  at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.in
itializeServiceModel(ReflectionServiceFactoryBean.java:333)
  at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.cr
eate(ReflectionServiceFactoryBean.java:151)
  at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(Ja
  

xWsServiceFactoryBean.java:93)


  at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.creat
eEndpoint(AbstractWSDLBasedEndpointFactory.java:74)
  at
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactory
  

Bean.java:51)


  at
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientPr
  

oxyFactoryBean.java:89)


  at com.foo.bar.RestTest.injectDependencies(RestTest.java:30)
  at
org.springframework.test.AbstractDependencyInjectionSpringCont
extTests.prepareTestInstance(AbstractDependencyInjectionSpring
  

ContextTests.java:158)


  at

Re: Mulitple protocols on one IMPL?

2007-11-05 Thread Willem Jiang

Hi,

You can use JAXWS API to publish different transport with a single 
implementor.
eg. 


Endpoint.publish(Address some where, implemetor);

But for your JMS transport , you need to do some configuration to setup 
the JMS address.
You can find some information here [1] and some discussions in the 
cxf-dev mail list[2]


[1]http://cwiki.apache.org/CXF20DOC/jax-ws-java-first-with-jms-transport.html
[2]http://www.nabble.com/SOAP-over-JMS-Questions-tf4744699.html#a13567840

Willem.


Patrick Mulligan wrote:

Hi,
 
Is it possible to have multiple protocols on a single running instance of an IMPL in CXF?  Or do I need to start two seperate instances?  For example, ServiceA running soap/http and ServiceA running JMS.
 
This questions applies to standalone server and spring deployments.

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline
  


Re: groovy/grails, CXF and generated classes

2007-11-01 Thread Willem Jiang

Hi,

The exception is thrown from org.apache.cxf.wsdl11.WSDLManagerImpl which 
uses a DocumentBuilderFactory to load the WSDL.
You class path may do no include a right version of jaxp and you need to 
put the XecesImpl 2.8.1.jar in you class path.


Willem.

Jason Botwick wrote:

It is . . . sorry, forgot to mention that.

Any other suggestions?

On Oct 27, 2007, at 11:37 PM, Willem2 wrote:



Hi,

It may relate to the Xerces Implementation.
CXF can work with xecesImpl 2.8.1 , please make sure this jar is in your
class path.

Willem.


jwagon wrote:


I'm trying to get a simple service client running against the following
WSDL:


I used SoapUI 1.7.6 to generate the service classes, one of which is 
this:


@WebServiceClient(name = api, targetNamespace =
http://api.bronto.com;, wsdlLocation =
http://api.bronto.com/?q=mail_3wsdl;)
public class Api extends Service {

private final static URL WSDL_LOCATION;
private final static QName SERVICE = new
QName(http://api.bronto.com;, api);
private final static QName ApiPort = new
QName(http://api.bronto.com;, apiPort);
static {
URL url = null;
try {
url = new URL(http://api.bronto.com/?q=mail_3wsdl;);
} catch (MalformedURLException e) {
System.err.println(Can not initialize the default wsdl
from http://api.bronto.com/?q=mail_3wsdl;);
// e.printStackTrace();
}
WSDL_LOCATION = url;
}

public Api(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}

public Api() {
super(WSDL_LOCATION, SERVICE);
}

/**
 *
 * @return
 * returns ApiPort
 */
@WebEndpoint(name = apiPort)
public ApiPortType getApiPort() {
return (ApiPortType)super.getPort(ApiPort, ApiPortType.class);
}

}

But when I execute the following code in a brand new Grails app
(Grails 0.6, Groovy 1.1b):

I get the error below. Not even where to start looking to solve this
one (except Google, which I already tried). Any suggestions?

org.codehaus.groovy.runtime.InvokerInvocationException:
java.lang.RuntimeException:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in
class path resource [META-INF/cxf/cxf.xml]: Instantiation of bean
failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]:
Constructor threw exception; nested exception is
java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
at
org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:64) 


at
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) 


at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689)
at 
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531)
at groovy.lang.Closure.call(Closure.java:290)
at groovy.lang.Closure.call(Closure.java:285)
at
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:526) 


at
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:385) 


at
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:240) 


at
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:152) 


at
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88) 


at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45) 


at
org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:241) 


at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755) 


at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396) 


at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350) 


at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)




--
View this message in context: 
http://www.nabble.com/groovy-grails%2C-CXF-and-generated-classes-tf4700854.html#a13449798 


Sent from the cxf-user mailing list archive at Nabble.com.






Re: possible problems in mixing https and http?

2007-11-01 Thread Willem Jiang

Hi Christian,

I think we could achieve you goal by letting service that CXF published 
the WSDL with user defined , so you could add what you want https or 
http protocol string on the address or the xsd including part.


Here is a JIRA[1] of trace it, if you have time to write a patch , I can 
give your some points from my view.

[1]https://issues.apache.org/jira/browse/CXF-341

Willem.

Christian Vest Hansen wrote:

We're planning on exposing a number of web services through HTTPS,
however, many of the WSDLs will refer to and import schema files that
we have stored in a central repository - and this repository is
accessed through ordinary HTTP.

In other words, our clients access a WSDL through HTTPS - this WSDL
has references to a schema that the client has to access through plain
HTTP.

Will this cause any problems with HTTPConduits and other
configurations that clients will have in order to access the otherwise
HTTPS enabled web service?



  


Re: groovy/grails, CXF and generated classes

2007-11-01 Thread Willem Jiang

Hi,

It may relate to your environments. Xerces should be the first one in 
the class path.

Can you list them, such as CXF version, JDK version ,Groovy's version ?
A simple test case will be helpful for debugging.

Willem.

Jason Botwick wrote:
The Xerces 2.8.1 JAR is in the classpath. Do I also need some other 
version of JAXP?


I have seldom met an intelligent person whose views were not narrowed 
and distorted by religion.

~ James Buchanan


On Nov 1, 2007, at 3:31 AM, Willem Jiang wrote:


Hi,

The exception is thrown from org.apache.cxf.wsdl11.WSDLManagerImpl 
which uses a DocumentBuilderFactory to load the WSDL.
You class path may do no include a right version of jaxp and you need 
to put the XecesImpl 2.8.1.jar in you class path.


Willem.

Jason Botwick wrote:

It is . . . sorry, forgot to mention that.

Any other suggestions?

On Oct 27, 2007, at 11:37 PM, Willem2 wrote:



Hi,

It may relate to the Xerces Implementation.
CXF can work with xecesImpl 2.8.1 , please make sure this jar is in 
your

class path.

Willem.


jwagon wrote:


I'm trying to get a simple service client running against the 
following

WSDL:


I used SoapUI 1.7.6 to generate the service classes, one of which 
is this:


@WebServiceClient(name = api, targetNamespace =
http://api.bronto.com;, wsdlLocation =
http://api.bronto.com/?q=mail_3wsdl;)
public class Api extends Service {

private final static URL WSDL_LOCATION;
private final static QName SERVICE = new
QName(http://api.bronto.com;, api);
private final static QName ApiPort = new
QName(http://api.bronto.com;, apiPort);
static {
URL url = null;
try {
url = new URL(http://api.bronto.com/?q=mail_3wsdl;);
} catch (MalformedURLException e) {
System.err.println(Can not initialize the default wsdl
from http://api.bronto.com/?q=mail_3wsdl;);
// e.printStackTrace();
}
WSDL_LOCATION = url;
}

public Api(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}

public Api() {
super(WSDL_LOCATION, SERVICE);
}

/**
 *
 * @return
 * returns ApiPort
 */
@WebEndpoint(name = apiPort)
public ApiPortType getApiPort() {
return (ApiPortType)super.getPort(ApiPort, 
ApiPortType.class);

}

}

But when I execute the following code in a brand new Grails app
(Grails 0.6, Groovy 1.1b):

I get the error below. Not even where to start looking to solve this
one (except Google, which I already tried). Any suggestions?

org.codehaus.groovy.runtime.InvokerInvocationException:
java.lang.RuntimeException:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in
class path resource [META-INF/cxf/cxf.xml]: Instantiation of bean
failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]:
Constructor threw exception; nested exception is
java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
at
org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:64) 


at
org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) 


at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689)
at 
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531)
at groovy.lang.Closure.call(Closure.java:290)
at groovy.lang.Closure.call(Closure.java:285)
at
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:526) 


at
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:385) 


at
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:240) 


at
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:152) 


at
org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88) 


at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45) 


at
org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:241) 


at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755) 


at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396) 


at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350) 


at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)




--
View this message

Re: possible problems in mixing https and http?

2007-11-01 Thread Willem Jiang
AFAIK,  HTTPConduit will  not  take  any charge to load WSDL  related 
information.

We just use java's URL to get wsdl not the HTTPConduit.

Willem.

Christian Vest Hansen wrote:

I'm not quite sure fixing that jira will solve this particular issue.

It seems to me that CXF has trouble connecting to anything HTTP once
it has been configured to use HTTPS.



2007/11/1, Willem Jiang [EMAIL PROTECTED]:
  

Hi Christian,

I think we could achieve you goal by letting service that CXF published
the WSDL with user defined , so you could add what you want https or
http protocol string on the address or the xsd including part.

Here is a JIRA[1] of trace it, if you have time to write a patch , I can
give your some points from my view.
[1]https://issues.apache.org/jira/browse/CXF-341

Willem.

Christian Vest Hansen wrote:


We're planning on exposing a number of web services through HTTPS,
however, many of the WSDLs will refer to and import schema files that
we have stored in a central repository - and this repository is
accessed through ordinary HTTP.

In other words, our clients access a WSDL through HTTPS - this WSDL
has references to a schema that the client has to access through plain
HTTP.

Will this cause any problems with HTTPConduits and other
configurations that clients will have in order to access the otherwise
HTTPS enabled web service?




  



  


Re: the matching wildcard is strict, but no declaration can be found for element jaxws.endpoint

2007-11-01 Thread Willem Jiang

Hi Troy,

Which CXF version are you working with ?
I just went through your beans.xml and can't tell any thing wrong there.
Maybe a simple test case can give us some clues.

Willem.


Troy Bull wrote:

On 11/1/07, Troy Bull [EMAIL PROTECTED] wrote:
  

Greetings

I have a couple web services that I wrote.  I followed the tutorial
from the apache site for creating a spring based ws using cfx.  This
morning  I checked my web services out of subversion and I can no
longer build them (in eclipse).  In my applicationBeans.xml I get the
message :

the matching wildcard is strict, but no declaration can be found for
element jaxws.endpoint

I sure dont know what I did to break these but I am in a real bind, if
anyone could tell me what to do to fix this I would really appreciate
it.

For reference here is my beans.xml file that eclipse complains about:

beans xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:jaxws=http://cxf.apache.org/jaxws;
xsi:schemaLocation=
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws 
http://cxf.apache.org/schemas/jaxws.xsd;

import resource=classpath:META-INF/cxf/cxf.xml /
import resource=classpath:META-INF/cxf/cxf-extension-soap.xml /
import resource=classpath:META-INF/cxf/cxf-servlet.xml /

jaxws:endpoint
  id=helloWorld
  implementor=#helloWorldBean
  address=/HelloWorld
/jaxws:endpoint


/beans

Please help, Thanks in advance.

Troy




I just redid the example from

http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html

it now fails with the same error message at the step where I create
beans.xml.  I know this used to work because I wrote several of these
that are currently deployed and working, I can not redeploy them now
(it appears).

  


Re: Server returned HTTP response code: 411

2007-10-31 Thread Willem Jiang

Hi ,

O, if you import the file in the Spring applicaiton context, the 
configure will not take any effect in the CXF which version is below 
2.0.3. We just fixed it in the 2.0.3 SNAPSHOT.


Here is the JIRA[1] which traced the issue.

[1] http://issues.apache.org/jira/browse/CXF-922

Willem.


Basharaj wrote:

I am trying to write a cxf java client that consumes a PERL webservice. I am
getting the following error every time I try to send a message:
Server returned HTTP response code: 411 for URL (Full stack trace is at the
end of this message).

I understand that this might be caused by Authochunking set to true by
default, so I created the following cxf.xml file in my classpath: 


beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:jaxws=http://cxf.apache.org/jaxws;
   xmlns:http=http://cxf.apache.org/transports/http/configuration;
   xsi:schemaLocation=
   http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
   http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
   http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd;

  http:conduit name=*.http-conduit
  http:client AllowChunking=false /
   /http:conduit
/beans

And I imported this file in Spring application context. However I am still
getting the same 411 error. Any ideas?

Full stack trace:


javax.xml.ws.soap.SOAPFaultException: Could not send Message.
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
at $Proxy29.get_ip_for_station(Unknown Source)
at
com.vms.locationservice.VDMClientTest.testUpdateAssetCount(VDMClientTest.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at
org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at
org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at
org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at
org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
at
org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at
org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
Caused by: org.apache.cxf.interceptor.Fault: Could not send Message.
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
at
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
... 26 more
Caused by: java.io.IOException: Server returned HTTP response code: 411 for
URL: http://iiws/cgi-bin/wsvdm/WSVDMStationInfo.pl
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at

Re: endpoint rewriting

2007-10-30 Thread Willem Jiang

Hi Christian,

NO , you can't specify a full URL address instead of the related path 
for the endpoint which you want to publish with the Servlet transport.
Because CXFServlet can't know your Web container's listen port and 
related context, so it alway update the endpoint's address with the 
request URL even you specify it with the jax-ws-configuration.


But if you publish the endpoint with the Jetty http standalone 
transport. I think you can get what you want.


Willem.

Christian Vest Hansen wrote:

It's a bit late over here so I can't test this right now, but I
suppose that the endpointName and address attributes of the
jaxws:endpoint element as listed here:
http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html are exactly
what I want, provided that cxf honors those values and put them in the
WSDL?

If so, then there's no need to file a new jira.


2007/10/30, Willem2 [EMAIL PROTECTED]:
  

Now , CXFServlet always updates the endpoint's address with the request url.
You can fill a JIRA[1] with your wishes.
[1]http://issues.apache.org/jira/browse/CXF

Willem.


Christian Vest Hansen wrote:


I deploy a CXF web service to a cluster that sits behind a content switch.

We have HTTPS on the content switch for security, but internally in
the cluster we use plain HTTP for speed.

Now, CXF has a habit of rewriting my carefully crafted endpoint URLs
in my WSDL, thus reporting plain HTTP endpoints on the services/ page
and in the final WSDL, when in fact they should be HTTPS.

Is there a way configure this behavior?


--
Venlig hilsen / Kind regards,
Christian Vest Hansen.


  

--
View this message in context: 
http://www.nabble.com/endpoint-rewriting-tf4717550.html#a13488677
Sent from the cxf-user mailing list archive at Nabble.com.






  


Re: CXF + oc4j

2007-10-29 Thread Willem Jiang

Aha.
It is the because the oc4j'sWebService class is out of date.
You need let oc4j load the CXF shipped geronimo-ws-metadata*.jar first.

You can find more information about how to let CXF work with AppServer 
here[1]

[1]http://cwiki.apache.org/CXF20DOC/appserverguide.html

Willem.



Hoda, Nadeem [USA] wrote:

Thanks Glen. Your weblog is very, very helpful.

I added xerces and removed oracle.xml, but now I get the following
error: 


07/10/29 11:47:38.718 helloworld: 10.1.3.3.0 Started
07/10/29 11:48:11.671 helloworld: Error initializing servlet
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'hello_world': Invocation of init method failed; nested
exception is java.lang.NoSuchMethodError:
javax.jws.WebService.portName()Ljava/lang/String;
Caused by: java.lang.NoSuchMethodError:
javax.jws.WebService.portName()Ljava/lang/String;
at
org.apache.cxf.jaxws.support.JaxWsImplementorInfo.initialise(JaxWsImplem
entorInfo.java:286)
at
org.apache.cxf.jaxws.support.JaxWsImplementorInfo.init(JaxWsImplemento
rInfo.java:57)
at
org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:243)
at
org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:227)
at
org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179)
at
org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:340)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1214
)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1179)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1145)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.createBean(AbstractAutowireCapableBeanFactory.java:427)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjec
t(AbstractBeanFactory.java:251)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
etSingleton(DefaultSingletonBeanRegistry.java:144)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:248)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:160)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.pre
InstantiateSingletons(DefaultListableBeanFactory.java:279)
at
org.springframework.context.support.AbstractApplicationContext.refresh(A
bstractApplicationContext.java:360)
at
org.apache.cxf.transport.servlet.CXFServlet.loadAdditionalConfig(CXFServ
let.java:203)
at
org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.jav
a:171)
at
org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0)
].server.http.HttpApplication.loadServlet(HttpApplication.java:2371)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0)
].server.http.HttpApplication.findServlet(HttpApplication.java:4824)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0)
].server.http.HttpApplication.findServlet(HttpApplication.java:4748)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0)
].server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:
2971)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0)
].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.jav
a:741)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0)
].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:
453)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0)
].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java
:221)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0)
].server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0)
].server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
at
oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocke
tReadHandler.java:260)
at
oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSoc
ketAcceptHandler.java:239)
at
oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcc
eptHandler.java:34)
at
oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(Ser

Re: undocumented configuration with jetty

2007-10-29 Thread Willem Jiang
O, I can tell the reason form your stack trace, you are not the fans of 
Spring ;).
It's definitely a bug of CXFServlet, here is a JIRA[1] for it and I will 
do a quick fix for it.

Please have an eye on JIRA[1].
[1]https://issues.apache.org/jira/browse/CXF-1072

Willem.

Miguel De Anda wrote:

So I do that, and I get these log messages:

2007-10-29 17:45:47.094::INFO:  Logging to STDERR via 
org.mortbay.log.StdErrLog

2007-10-29 17:45:47.181::INFO:  jetty-6.0.2
Oct 29, 2007 5:45:47 PM org.apache.cxf.transport.servlet.CXFServlet 
loadBusNoConfig

INFO: load the bus without application context
Oct 29, 2007 5:45:47 PM org.apache.cxf.transport.servlet.CXFServlet 
replaceDestinationFactory

INFO: replaced the http destionFactory with servlet transport factory
2007-10-29 17:45:47.866::INFO:  Started SocketConnector @ 0.0.0.0:9000
Oct 29, 2007 5:45:47 PM 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean 
buildServiceFromClass
INFO: Creating Service {http://test.tandbergtv.com/}HelloWorldImplService from 
class com.tandbergtv.test.HelloWorldImpl


test.tandbergtv.com is the package that my HelloWorldImpl and interface are 
in.


I did have to change the line to 
Endpoint.publish(http://localhost:9000/soap/hello;, new HelloWorldImpl()); 
because I was getting a no protocol exception.


I find it odd that it says load the bus without application context. Anyway, 
when I try to load it, I get a null pointer exception.


http://localhost:9000/soap/?wsdl

2007-10-29 17:50:18.397::WARN:  /soap/: 
java.lang.NullPointerException
	at 
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:89)

at 
org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:278)
at 
org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
	at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)

at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
at org.mortbay.jetty.Server.handle(Server.java:303)
at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
	at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:721)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:509)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349)
	at 
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:217)
	at 
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

2007-10-29 17:50:18.399::WARN:  /soap/
java.lang.NullPointerException
	at 
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:89)

at 
org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:278)
at 
org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
	at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)

at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
at org.mortbay.jetty.Server.handle(Server.java:303)
at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
	at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:721)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:509)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349)
	at 
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:217)
	at 
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)





On Thursday 25 October 2007, Willem Jiang wrote:
  

Hi ,

I write a  simple test with your case.
The services are all published :)

Please see the below code.
public class JettyServer {
public static void main(String[] args) throws Exception

Re: undocumented configuration with jetty

2007-10-29 Thread Willem Jiang

Hi,

I had got to ask you what version of CXF are you using.
I just traced the code which I had showed to you, I did not step into 
the loadBusNoConfig method, because I had the spring-context-*.jar in my 
class path.
But I found the key,  we should call replaceDestinationFactory() before 
createServletController in loadBusNoConfig to avoid passing the NP 
(ServletTransport) to the ServletController.


If you are using CXF 2.0.2 , I think adding the spring-context-2.*.jar 
into your class path will solve this problem.

My coming up fixing will help you to solve the NPE in most case.

BTW, you do not need to do any configuration on Jetty as the 
Jetty-configuration said. Because it is for using Jetty-http transport 
and not for the Servlet-http transport.


Willem.

Miguel De Anda wrote:
Actually I do like spring. However, we are currently using it to allow the 
customer to configure the app and I don't feel its appropriate for them to 
configure the soap interface this way. Our app runs as a standalone java app 
and doesn't use an application context. I'm just loading objects using the 
following:


Resource resource = new FileSystemResource(config);
BeanFactory factory = new XmlBeanFactory(resource);
Object o = factory.getBean(bean);

After I have o I don't keep a bean factory or anything around.

So after looking at that bug report, it makes me wonder if there is something 
else. The bug says that it has something to do with an application context 
class not being around. Could it be that I'm getting nulls because there is 
an application class? What can I do to make it work? Should I load my jetty 
server from a bean and through the application context so that cxf can find 
it and register the endpoints properly?


In other words, if I make my xml config look like what you have in 
http://cwiki.apache.org/CXF20DOC/jetty-configuration.html how can I get 
reference to the server in my app so that my other servlets can be registered 
as well?


Thanks for all your help so far.



On Monday 29 October 2007, Willem Jiang wrote:
  

O, I can tell the reason form your stack trace, you are not the fans of
Spring ;).
It's definitely a bug of CXFServlet, here is a JIRA[1] for it and I will
do a quick fix for it.
Please have an eye on JIRA[1].
[1]https://issues.apache.org/jira/browse/CXF-1072

Willem.




**

This email, its content and any attachments is PRIVATE AND 
CONFIDENTIAL to TANDBERG Television, Part of the Ericsson Group. 
If received in error please notify the sender and destroy the original 
message and attachments.


www.tandbergtv.com
**

  


Re: empty response object

2007-10-28 Thread Willem Jiang

Hi ,

Did this message is created by CXF Server ?
And please tell me the CXF version that you uses.
If it is CXF's bug, please fill a JIRA[1] for it , and  a simple test 
case will be helpful for us to debug.


[1] http://issues.apache.org/jira/browse/CXF


Willem

tirtza wrote:

I get an empty response object when using JaxWsProxyFactoryBean  as well.

  


Re: how clients handle changing wsdls

2007-10-25 Thread Willem Jiang

Hi Christian,

I think if you still use the old wsdl to create the service , the client 
can still work.


I just did a quick test for your case by remove the WSDL2Java generated 
SEI's method.

It can reproduce your case.
On the client side if I use the ?wsdl which is generated by CXF to 
create the service ,
the client  can still work. But if I specified the orginal WSDL , I got 
the below exception.


Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
Could not find a matching method for operation 
{http://apache.org/hello_world_soap_http}greetMeOneWay
   at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:323)
   at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:184)
   at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:214)
   at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:269)
   at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:146)
   at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:91)
   at 
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:94)
   at 
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50)
   at 
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:89)

   at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:372)
   at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:271)

Any thoughts?

Willem.

Christian Vest Hansen wrote:

If you generate a java client from a wsdl, and then add an operation
to the wsdl but forget to update the client code - how does CXF handle
that situation?

Will the client crash or blissfully hum along (but withut being able
to invoke the new operation)?

I'm asking because it might influence decisions and policies one might
define for managing change and backwards compatibility when working
with CXF web services and clients.

  


Re: undocumented configuration with jetty

2007-10-25 Thread Willem Jiang

Hi ,

I write a  simple test with your case.
The services are all published :)

Please see the below code.
public class JettyServer {
   public static void main(String[] args) throws Exception {
  


   org.mortbay.jetty.Server httpServer = new Server(9000);

   ContextHandlerCollection contexts = new ContextHandlerCollection();
   httpServer.setHandler(contexts);
  
   Context root = new Context(contexts,/,Context.SESSIONS);
  
   CXFServlet cxf = new CXFServlet();

   ServletHolder servlet = new ServletHolder(cxf);
   servlet.setName(soap);
   servlet.setForcedPath(soap);
   root.addServlet(servlet, /soap/*);
  
   httpServer.start();

   Bus bus = cxf.getBus();
   BusFactory.setDefaultBus(bus);
   // register service
   String uri = / +GreeterImpl.class.getSimpleName();
  
   Endpoint.publish(uri, new GreeterImpl());

   Endpoint.publish(/hello, new HelloImpl());
   }

}

Willem.

Miguel De Anda wrote:
I tried that and nothing changed. I tried moving that block to after the jetty 
server is running and it doesn't make that much of a difference.


Should I be worried that I have to use a full url as the first parameter to 
Endpoint.publish? In the example I saw, it only had the path.


On Thursday 25 October 2007, Willem2 wrote:
  

Hi,

You need to use the bus of the CXFServlet. You could use the CXF Servlet
transport with this bus.
Please add the below code just  before Endpoint.publish(...)

Bus bus = cxf.getBus();
BusFactory.setDefaultBus(bus);

Willem.

Miguel De Anda-2 wrote:


i've got an application (my server) that launches its own jetty server
for sending files to external nodes. they currently talk to each other
using simple xml passed in as a post request and in the response. the
external nodes don't run a web server of any kind.

i now need to add a soap interface on my server but can't figure out how.
this
is how my jetty server is started:

ServletHolder servlet;
org.mortbay.jetty.Server jettyServer =
new org.mortbay.jetty.Server(PORT);
Context root = new Context(jettyServer, /, Context.SESSIONS);

servlet = new ServletHolder(someServlet);
root.addServlet(servlet, /*);

CXFServlet cxf = new CXFServlet();
servlet = new ServletHolder(cxf);
servlet.setName(soap);
servlet.setForcedPath(soap);
root.addServlet(servlet, /soap/*);
HelloWorld hw = new HelloWorldImpl();
Endpoint.publish(/soap/HelloWorld, hw);
jettyServer.start();


package a.b.c;
import javax.jws.WebService;
@WebService
public interface HelloWorld {
String sayHi(String text);
}

import javax.jws.WebService;
@WebService(endpointInterface = a.b.c.HelloWorld)
public class HelloWorldImpl implements HelloWorld {
public String sayHi(String text) {
return The interesting question becomes is what is soap?;
}
}


i got errors ranging from a null pointer exception when i went to
http://localhost:PORT/soap/ to /soap/HelloWorld not being a valid url
(in
the line Endpoint.publish). i had to set a full url there, when i
used http://localhost:PORT/soap/HelloWorld; it told me that the port was
being used, so i figured its launching its own internal instance of jetty
(or
whatever it uses). i then replaced the port to some 8087 and it almost
works,
but i get a faultstringNo such operation: /faultstring message when
viewing http://localhost:8087/soap/HelloWorld

i would really like to be able to use the same jetty server, and be able
to
give access to my existing objects in my application. i'm using spring to
load up an object that has all of my configuration settings but not in
the same way you would in a typical web app that runs on a webserver. the
customer currently has access to that spring config file and it would be
wrong to give them access (or force them to configure) the soap services.

in other words, my app is launched this way:
public static void main(...) {
  Resource resource = new FileSystemResource(config);
  BeanFactory factory = new XmlBeanFactory(resource);
  Config config = (Config)factory.getBean(bean);
  configApp(config);
  startServices();
}


Actual error messages:
(using /soap/... in publish line)
Caused by: java.net.MalformedURLException: no protocol: /soap/HelloWorld
at java.net.URL.init(URL.java:567)
at java.net.URL.init(URL.java:464)
at java.net.URL.init(URL.java:413)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.init(JettyHTTP
Destination.java:87) at
org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDesti
nation(JettyHTTPTransportFactory.java:96) at
org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestinat
ion(JettyHTTPTransportFactory.java:83) at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTrans
portFactory.java:74) at
org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90)
   

  1   2   3   >