create artifacts from WSDL published on the internet
It is possible to generate java artifacts and stubs with wsdl2java loading the wsdl file from the internet? (something like http://myhost:myport/service?wsdl ) -- View this message in context: http://www.nabble.com/create-artifacts-from-WSDL-published-on-the-internet-tp16824292p16824292.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Fwd: CXF has graduated!
Congratulations to Dan and all the team ;-) I've been waiting this to happen for a long time. Davide Juanjo Vázquez wrote: > > Congratulations! > > Regards, > > Juanjo > > On Wed, Apr 16, 2008 at 8:30 PM, David Castañeda <[EMAIL PROTECTED]> > wrote: > >> Kudos to Dan and all people who has been involved. >> >> On Wed, Apr 16, 2008 at 1:26 PM, Arul Dhesiaseelan <[EMAIL PROTECTED]> >> wrote: >> >> > Congratulations Dan and team! >> > >> > >> > Daniel Kulp wrote: >> > >> > > Forwarding this to cxf-user as it's as important for them as well. >> > > Dan >> > > >> > > -- Forwarded Message -- >> > > >> > > Subject: CXF has graduated! >> > > Date: Wednesday 16 April 2008 >> > > From: Jim Jagielski <[EMAIL PROTECTED]> >> > > To: [EMAIL PROTECTED] >> > > >> > > I am happy and proud to announce that at this month's board >> > > meeting, we have approved CXF's graduation out of the Incubator >> > > and as a TLP. Dan Kulp was approved as VP of the PMC. >> > > >> > > Congrats to one and all! >> > > >> > > --- >> > > >> > > >> > > >> > >> > >> > >> > >> >> >> -- >> David Castañeda R. >> > > -- View this message in context: http://www.nabble.com/Fwd%3A-CXF-has-graduated%21-tp16730423p16742889.html Sent from the cxf-user mailing list archive at Nabble.com.
convert a SOAP Fault to the contained java exception
Assume I receive an answer such as: // // http://schemas.xmlsoap.org/soap/envelope/";> // // //soap:Server //processing failure exception // // //EXCPT_INTERNAL_ERROR //session_token_unexisting // // // // // how can I recover the contained java exception? There is some utility code in CXF that does that?? -- View this message in context: http://www.nabble.com/convert-a-SOAP-Fault-to-the-contained-java-exception-tp16297081p16297081.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: WebServiceContext not injected in endpoint
I have tried the new snapshot (release 35) with different factories, and definetively now everything works fine. The pooled factory is pretty cool!!! thanks. Davide -- View this message in context: http://www.nabble.com/WebServiceContext-not-injected-in-endpoint-tp15708465p15758714.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: WebServiceContext not injected in endpoint
willem.jiang wrote: > > > After went through the JaxWsServerFactoryBean codes, I think you need to > modify the invoker factory construction argument. > > Here are the codes. > > Object implementor = new GreeterImpl(); > String address = "http://localhost:9000/SoapContext/SoapPort";; > > org.apache.cxf.service.invoker.Factory factory = new > org.apache.cxf.service.invoker.SingletonFactory(implementor); > JAXWSMethodInvoker invoker = new JAXWSMethodInvoker(factory); > JaxWsServerFactoryBean factoryBean = new JaxWsServerFactoryBean(); > factoryBean.setAddress(address); > factoryBean.setServiceBean(implementor); > factoryBean.setInvoker(invoker); > factoryBean.create(); > > Thanks Willem, actually it works! Anyway if I change factory and I use the PerSessionFactory or the PooledFactory I always have that the session context is always not injected. org.apache.cxf.service.invoker.Factory factory = new org.apache.cxf.service.invoker.PooledFactory(GreeterImpl.class,16); org.apache.cxf.service.invoker.Factory factory = new org.apache.cxf.service.invoker.PerSessionFactory(GreeterImpl.class); -- View this message in context: http://www.nabble.com/WebServiceContext-not-injected-in-endpoint-tp15708465p15735721.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: WebServiceContext not injected in endpoint
Hi Dan, I have used this CXF 2.1 snapshot. apache-cxf-2.1-incubator-20080228.032802-34.zip 28-Feb-2008 04:16 24M I have tried this code, and actually the context is not injected. maybe I am doing something wrong. With the SingletonFactory it happens the same. Maybe the fault is the way I create the service. Anyway the creation policy works fine, with the PerSessionFactory I have a brand new instance created for each request I get. Here is the code: Object implementor = new GreeterImpl(); String address = "http://localhost:9000/SoapContext/SoapPort";; org.apache.cxf.service.invoker.Factory factory = new org.apache.cxf.service.invoker.PerRequestFactory(GreeterImpl.class); org.apache.cxf.service.invoker.Factory factory = new org.apache.cxf.service.invoker.SingletonFactory(GreeterImpl.class); JAXWSMethodInvoker invoker = new JAXWSMethodInvoker(factory); JaxWsServerFactoryBean factoryBean = new JaxWsServerFactoryBean(); factoryBean.setAddress(address); factoryBean.setServiceBean(implementor); factoryBean.setInvoker(invoker); factoryBean.create(); @javax.jws.WebService(name = "Greeter", serviceName = "SOAPService", portName = "SoapPort", targetNamespace = "http://apache.org/hello_world_soap_http";, wsdlLocation = "hello_world.wsdl", endpointInterface = "org.apache.hello_world_soap_http.Greeter") public class GreeterImpl implements Greeter { @Resource private WebServiceContext context; public java.lang.String greetMe(java.lang.String requestType) { LOG.info("Executing operation greetMe"); System.out.println(requestType); if (context != null) { System.out.println("context properly injected"); } else System.out.println("context properly is null!!"); return "hello my dear"; } -- View this message in context: http://www.nabble.com/WebServiceContext-not-injected-in-endpoint-tp15708465p15732342.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: WebServiceContext not injected in endpoint
OK! As soon as I can I'll try CXF 2.1 and I'll send you a feedback! Thanks. Davide -- View this message in context: http://www.nabble.com/WebServiceContext-not-injected-in-endpoint-tp15708465p15731308.html Sent from the cxf-user mailing list archive at Nabble.com.
WebServiceContext Principal
According to the javadoc of WebServiceContext class, getUserPrincipal() Returns the Principal that identifies the sender of the request currently being serviced. If the sender has not been authenticated, the method returns null. how is supposed to be filled this Principal? When? By whom? -- View this message in context: http://www.nabble.com/WebServiceContext-Principal-tp15708867p15708867.html Sent from the cxf-user mailing list archive at Nabble.com.
WebServiceContext not injected in endpoint
trying customizing the JAxWSMethodInvoker I have problems injecting the web service context with the @Resource annotation. Maybe there's something wrong in what I am doing, maybe it could be a bug. Assume you have a GreeterImpl endpoint with the web service context injected. Try the following: case 1 ScopePolicy policy = ApplicationScopePolicy.instance(); // trying with the following is the same: // ScopePolicy policy = RequestScopePolicy.instance(); org.apache.cxf.common.util.factory.Factory factory= new LocalFactory(GreeterImpl.class); JAXWSMethodInvoker invoker = new JAXWSMethodInvoker(fattorazza, policy); JaxWsServerFactoryBean factoryBean = new JaxWsServerFactoryBean(); factoryBean.setAddress(address); factoryBean.setServiceBean(implementor); factoryBean.setInvoker(invoker); factoryBean.create(); case 2 Endpoint.publish(address,implementor); the endpoint public class GreeterImpl implements Greeter { @Resource private WebServiceContext context; public java.lang.String greetMe(java.lang.String requestType) { if (context != null) { // in case 1 it is null, in case 2 it is !=null } return "hello "+ requestType; } in case 1 the method invocation works fine, but the context is not injected, while in case 2 the context is injected. where is the fault? Davide -- View this message in context: http://www.nabble.com/WebServiceContext-not-injected-in-endpoint-tp15708465p15708465.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: mutithread issues in interceptors and endpoints
> Looking at the code (this seems to be some code that came from XFire), > there is some ScopePolicy things that seem to do various things, but > they seem to be very confusing and also won't work with the > JAXWSMethodInvoker anyway due to that singleton factory thing. > There's PROBABLY a way to use the > org.apache.cxf.service.invoker.LocalFactory with a RequestScopePolicy > thing to have it create a new instance of each request. Maybe. I'm > not really sure if any of that is working and it's all very confusing. > I'm tempted to rip that all out and just have a couple different > factories. (SingleInstanceFactory, PerRequestFactory, SessionFactory, > PooledFactory, etc...) > I have tried the following code, and actually it works fine, it creates a new endpoint bean instance for each request. ScopePolicy policy = RequestScopePolicy.instance(); org.apache.cxf.common.util.factory.Factory factory = new LocalFactory(GreeterImpl.class); JAXWSMethodInvoker invoker = new JAXWSMethodInvoker(fattorazza, policy); JaxWsServerFactoryBean factoryBean = new JaxWsServerFactoryBean(); factoryBean.setAddress(address); factoryBean.setServiceBean(implementor); factoryBean.setInvoker(invoker); factoryBean.create(); Endpoint.publish(address, implementor); Just a note on the RequestScopePolicy: it seem to be a singleton, but the constructor is not private, so the singletor factory can be violated, here is the code. public class RequestScopePolicy implements ScopePolicy { private static final RequestScopePolicy SINGLETON = new RequestScopePolicy(); public Factory applyScope(Factory f, Exchange ex) { return f; } public static ScopePolicy instance() { return SINGLETON; } } -- View this message in context: http://www.nabble.com/mutithread-issues-in-interceptors-and-endpoints-tp15611836p15707562.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: mutithread issues in interceptors and endpoints
Thanks a lot! I have a few more questions about it... > > >> In CXF there is a single instance of any endpoint bean that manages >> all the incoming requests, or somehow there is way to have a pool of >> endpoints? >> > > With a little bit of code, yes. You can can configure in your own > invoker that does something diffent. If you look in > org.apache.cxf.jaxws.JAXWSMethodInvoker and it's super classes, there > are various ways to configure other policies. The simplest way would > be to just subclass it and overwride the getServiceObject and > releaseServiceObject methods to do whatever you need them to do. > Those methods would be called for each invokation, but they could return > an instance from a pool, create a new one for each invoke, etc... > For the endpoint invocation the defauls is org.apache.cxf.jaxws.JAXWSMethodInvoker that inherit from FactoryInvoker. So each time I call a remote method a new endpoint instance is created? To use a single instance should I have to use BeanInvoker? > Seriously, if you need to pass values to other interceptors along the > same chain, etc... you should store them in the Message or in the > exchange. (msg.getExchange()). If you need to hold some state for a > session, grab the HttpRequest from the msg and create an http session. > Any instance variables would need to be properly protected as they would > apply for all invokations of that endpoint. (example: use an > AtomicInteger for a "hit count" type thing) > considering JAX-WS handler instead of interceptor is the same thing? The safe place where to store request variables in a handler is the context itself(and access them injecting the Web ServiceContext in the endpoint) ?? something similar to: public boolean handleMessage(SOAPMessageContext ctx) { ctx.put("KEY","VALUE"); ... -- View this message in context: http://www.nabble.com/mutithread-issues-in-interceptors-and-endpoints-tp15611836p15633391.html Sent from the cxf-user mailing list archive at Nabble.com.
mutithread issues in interceptors and endpoints
Hi, a question about multithread issues in CXF (maybe a silly one). Multiple requests are managed relying upon the servlet engine I CXF uses. Every request (so every SOAPMessageContext) lives in his own thread? If there is a pool of them, every thread in the pool manages one request each time? In CXF there is a single instance of any endpoint bean that manages all the incoming requests, or somehow there is way to have a pool of endpoints? There is also a single interceptor chain for all of them? So when I program my own interceptor what are the multithread issued I have to face and consider? -- View this message in context: http://www.nabble.com/mutithread-issues-in-interceptors-and-endpoints-tp15611836p15611836.html Sent from the cxf-user mailing list archive at Nabble.com.
put a variable in an handler and access it from the MessageContext
How can I put a variable in an handler and access it from the MessageContext once I have reached the endpoint? I have injected the WebServiceContext in my endpoint (with the @resource annotation). I have put an object in my handler in a SoapMessageContext as a key pair value: public boolean handleMessage(LogicalMessageContext lmc) { lmc.put(Constants.MY_CONSTANT, new Date()); return true; } and I expected the variable would have been accessed as: context.getMessageContext().get(Constants.MY_CONSTANT); Anyway what i get is null. Where is my fault?? -- View this message in context: http://www.nabble.com/put-a-variable-in-an-handler-and-access-it-from-the-MessageContext-tp15480680p15480680.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: SOAPFaultException, maybe a bug in the framework?
I have added the bug in the JIRA. From here I cannot access the subversion repository due to firewall problems... I can try it at home to change toe code! Thanks Davide -- View this message in context: http://www.nabble.com/SOAPFaultException%2C-weird-error-in-JAX-WS-Handlers-tp15269025p15306318.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Custom Exception thrown from JAX-WS Handlers
Wrapping my custom exception in a cxf fault works well, the exception is unwinded gracefully on the client side. The reason I wanted to use a SOAPFaultException is I have the boundary not to rely too much on the CXF API, and leave the more JAX-WS standard I can (it's a designing issue provided from high above :-( ), for I'd rather use interceptors if I could. I know all of it does not make very sense, forv when you choose a technology you'd better rely completely on it. Anyway even using the sole Fault exception binds me to the CXF API. Trying to build my own SOAPFaultException and populating it I have some weird error, that I am not able to get out, as it is better explained here: http://www.nabble.com/SOAPFaultException%2C-weird-error-in-JAX-WS-Handlers-tt15269025.html thanks again. dkulp wrote: > > On Friday 01 February 2008, Davide Gesino wrote: >> I have som problems with JAX-WS handers... I have to do some >> preprocessing stuff in an handler before validating the massage. >> if the message does not respect my boundary I have to throw a custom >> exception... 4 example ProcessingFailureException. >> PFE does not inherit from RuntimeException. >> >> CXf interceptor solve the problem in a really elegant way, for the >> apache "Fault"specified in the handleMessage is a container for any >> throwable, so I can encapsulate my custom exception and have it >> gracefully unwinded and recovered on the client side. >> a SoapFault is created, sent and received on the client side... and >> somehow the right checked exception is recovered. >> >> JAX-WS Handers are a trouble... my exception does not inherit from >> RuntimeException, so I can't declare my exception in the handleMessage >> signature. >> I can create a SOAPFault and encapsulate some info in it, but what to >> put insede it? >> There is a way to recover the right exception on the client side >> without pain? >> >> Any idea? > > With PURE JAX-WS, you definitely are on your own. You would have to > create the SOAPFaulException with the SOAPFault filled in inside it. > Unfortunately, you have to fill it all in yourself. Youd want to set > the fault code, fault string, and then create the details element in it. > The easiest way to figure out what it would look like is to throw your > exception from a CXF interceptor and record the wire trace. Then fill > in the details to make it look like that. > > With CXF, you should be able to wrapper the exception with a CXF Fault > object just like you did from an interceptor. I believe that should > work. > > > -- > J. Daniel Kulp > Principal Engineer, IONA > [EMAIL PROTECTED] > http://www.dankulp.com/blog > > -- View this message in context: http://www.nabble.com/Custom-Exception-thrown-from-JAX-WS-Handlers-tp15229217p15291949.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: SOAPFaultException, weird error in JAX-WS Handlers
the fact that the node value is null seems not to be the problem, for the other fields that get printed have that value set to null during SOAPFault filling. the problem seems to be somewhere else. -- View this message in context: http://www.nabble.com/SOAPFaultException%2C-weird-error-in-JAX-WS-Handlers-tp15269025p15287613.html Sent from the cxf-user mailing list archive at Nabble.com.
augment the http request time
How can I increase the time before HTTP request expiration? thanks Davide -- View this message in context: http://www.nabble.com/augment-the-http-request-time-tp15285516p15285516.html Sent from the cxf-user mailing list archive at Nabble.com.
SOAPFaultException, maybe a bug in the framework?
I am trying to throw a SOAPFaultException from an handler. Anyway I have some weird error in what I get back. I have tried the same code on java 6 without CXF and the handler chain works differently (with java 1.6 works fine) This is the handleMessage on my custom SOAPHandler (the way I fill the SOAPFault is taken from the SUN tutorial): 1) WITH JAVA 6: public boolean handleMessage(SOAPMessageContext ctx) { Boolean outboundProperty = (Boolean) ctx .get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (!outboundProperty) { SOAPMessage msg = ctx.getMessage(); SOAPBody body; try { body = msg.getSOAPBody(); SOAPFault fault = body.addFault(); QName faultName = new QName(SOAPConstants.URI_NS_SOAP_ENVELOPE, "Server"); fault.setFaultCode(faultName); fault.setFaultActor("http://gizmos.com/orders";); fault.setFaultString("Server not responding"); Detail detail = fault.addDetail(); QName entryName = new QName("http://gizmos.com/orders/";, "order", "PO"); DetailEntry entry = detail.addDetailEntry(entryName); entry.addTextNode("Quantity element does not have a value"); QName entryName2 = new QName("http://gizmos.com/orders/";, "order", "PO"); DetailEntry entry2 = detail.addDetailEntry(entryName2); entry2.addTextNode("Incomplete address: no zip code"); throw new SOAPFaultException(fault); } catch (SOAPException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return true; } and here is the log of the message sent back to the client. The SOAPFault is populated correctly. soapenv:Server Server not responding http://gizmos.com/orders http://gizmos.com/orders/";>Quantity element does not have a value http://gizmos.com/orders/";>Incomplete address: no zip code 2) WITH CXF + Java 5: I have the same handler doing the same work. debugging the SOAPFault seems to be populated correctly: Anyway logging the answer here is what I get. soap:Server Server not responding The actor and expecially the details are missing. I have tried debugging the org.apache.cxf.jaxws.handler.HandlerChainInvoker, but I was not abel to figure out if there is some error somewhere. Do you think it is a bug or an hidden error of mine? Thanks a lot. Davide -- View this message in context: http://www.nabble.com/SOAPFaultException%2C-maybe-a-bug-in-the-framework--tp15269025p15269025.html Sent from the cxf-user mailing list archive at Nabble.com.
Custom Exception thrown from JAX-WS Handlers
I have som problems with JAX-WS handers... I have to do some preprocessing stuff in an handler before validating the massage. if the message does not respect my boundary I have to throw a custom exception... 4 example ProcessingFailureException. PFE does not inherit from RuntimeException. CXf interceptor solve the problem in a really elegant way, for the apache "Fault"specified in the handleMessage is a container for any throwable, so I can encapsulate my custom exception and have it gracefully unwinded and recovered on the client side. a SoapFault is created, sent and received on the client side... and somehow the right checked exception is recovered. JAX-WS Handers are a trouble... my exception does not inherit from RuntimeException, so I can't declare my exception in the handleMessage signature. I can create a SOAPFault and encapsulate some info in it, but what to put insede it? There is a way to recover the right exception on the client side without pain? Any idea? -- View this message in context: http://www.nabble.com/Custom-Exception-thrown-from-JAX-WS-Handlers-tp15229217p15229217.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: CXF interceptor equivalent for LogicalHandler?
Glen, you can find a further discussion here: If i remember well in CXF there is a single interceptor that manages all the logical handlers passed through the @HandlerChain annotation. http://www.nabble.com/differences-between--CXF-Interceptors-and-JAX-WS-Handlers-tt13975552.html#a13975552 As a user I prefer interceptors (if you don't have to be jax-ws 2.0 compliant) , the api is better designed and you have more control over the different phases of the message processing. -- View this message in context: http://www.nabble.com/CXF-interceptor-equivalent-for-LogicalHandler--tp14600693p14834963.html Sent from the cxf-user mailing list archive at Nabble.com.
WS-SecureConversation and WS-SecurityTrust
I've read a post on ws-* advanced features in future CXF versions. These features are not present in the JIRA, so I guess these features will not be in CXF 2.1. Are these features definitively shifted to future versions? -- View this message in context: http://www.nabble.com/WS-SecureConversation-and-WS-SecurityTrust-tp14732255p14732255.html Sent from the cxf-user mailing list archive at Nabble.com.
Jetty + spring, I am missing a point
I have always been using CXF deployed on tomcat. Switching to Jetty embedded I have some problems trying to understand some things. When I first publish and Endpoint CXF such as: Endpoint.publish(address, implementor); CXF loads the cxf.xml file and the Bus and everything else are instantiated, the jetty server is started and the endpoints get published. I would like to create everything in a Spring fashion without using (eventually) the Endpoint.publish, with Spring creating and publishign magically the endpoints 4 me. Creating an ApplicationContext explicitly in my code I see almost everthing to be correctly instantiated, but the Jetty server seems not to be up and running. Should I have to start it explicitly? In this case what should be the proper endpoint address in the cxf file?? 4 example assuming: Object implementor = new GreeterImpl(); String address = "http://localhost:8080/SoapContext/SoapPort";; Endpoint.create(Greeter.class); what should I have to write in my cxf.xml, something like; http://localhost:9000/SoapContext/SoapPort"; implementor="org.apache.hello_world_soap_http.GreeterImpl" > ?? Where is my fault? -- View this message in context: http://www.nabble.com/Jetty-%2B-spring%2C-I-am-missing-a-point-tp14440937p14440937.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: org.apache.cxf.binding.soap.SOAPMessage information organization
Thanx a lot dan nd sorry for the silly question, but debugging I was driven astray and I thought it was far more difficult than it was. Davide dkulp wrote: > > > Davide, > > It sounds like you missed the msg.getContent(...) call. > > The content is different than the properties. The properties are > generally metainformation that is used to pass things along while > processing the message. The content is really the content that is > being manipulated. > > In your case, you probably want to do: > > List lst = msg.getContent(List.class); > to return the list of objects. The MessagePartInfo object that you DID > find is useful here as it has a getIndex() call on it to tell you where > in the above list the object corresponding to that call should be found. > > Dan > > > On Tuesday 18 December 2007, Davide Gesino wrote: >> I have some problems with the logical organizations of data in the >> SOAPMessage class. >> >> I am trying to manage Message informations in the header: at this >> point I have problems figuring out how the header infos are organized >> in this class. >> >> Considering a message such as: >> >> # BEFORE SENDING >> in the PRE_PROTOCOL phase debugging I have found the infos with this >> (maybe unorthodox) code: >> ArrayList obj = (ArrayList)message.get("client.holders"); >> Holder holder = (Holder)obj.get(0); >> HeaderT represents my header bean. >> >> # AFTER RECEIVING >> I can't understand how the info is organized. >> in the POST_RECEIVE phase i do not get anything with the >> message.get("client.holders") method. >> >> using: >> MessageInfo fuffa = >> (MessageInfo)message.get("org.apache.cxf.service.model.MessageInfo"); >> MessagePartInfo maybeHeader = >> (MessagePartInfo)fuffa.getMessagePart(new >> QName("tmf854.v1.ws","mtosiHeader")); >> maybeHeader.getTypeClass() returns the right class HeaderT, but I >> cannot find the HeaderT object inside the header. >> >> What is the rationale in the scheme? how are the Message and >> SOAPMessage classes organized and how the info is structired inside >> these classes? How can I add and new Headers or change existing >> headers? > > > > -- > J. Daniel Kulp > Principal Engineer, IONA > [EMAIL PROTECTED] > http://www.dankulp.com/blog > > -- View this message in context: http://www.nabble.com/org.apache.cxf.binding.soap.SOAPMessage-information-organization-tp14398903p14413072.html Sent from the cxf-user mailing list archive at Nabble.com.
org.apache.cxf.binding.soap.SOAPMessage information organization
I have some problems with the logical organizations of data in the SOAPMessage class. I am trying to manage Message informations in the header: at this point I have problems figuring out how the header infos are organized in this class. Considering a message such as: # BEFORE SENDING in the PRE_PROTOCOL phase debugging I have found the infos with this (maybe unorthodox) code: ArrayList obj = (ArrayList)message.get("client.holders"); Holder holder = (Holder)obj.get(0); HeaderT represents my header bean. # AFTER RECEIVING I can't understand how the info is organized. in the POST_RECEIVE phase i do not get anything with the message.get("client.holders") method. using: MessageInfo fuffa = (MessageInfo)message.get("org.apache.cxf.service.model.MessageInfo"); MessagePartInfo maybeHeader = (MessagePartInfo)fuffa.getMessagePart(new QName("tmf854.v1.ws","mtosiHeader")); maybeHeader.getTypeClass() returns the right class HeaderT, but I cannot find the HeaderT object inside the header. What is the rationale in the scheme? how are the Message and SOAPMessage classes organized and how the info is structired inside these classes? How can I add and new Headers or change existing headers? -- View this message in context: http://www.nabble.com/org.apache.cxf.binding.soap.SOAPMessage-information-organization-tp14398903p14398903.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: org.apache.cxf.endpoint.Client usage
Hi Dan, at last it worked well ising the following code. ConfigurationService cs = new ConfigurationService(); ManagedElementMgr http = cs.getManagedElementMgrHttp(); Client clientaz = ClientProxy.getClient(http); clientaz.getOutInterceptors().add(new IteratorClientOutInterceptor()); Object[] returnazz = clientaz.invoke("getAllManagedElements", holder, new GetAllManagedElementsT()); I have tried your suggestion adding the line: factory.setServiceName(new QName("tmf854.v1.ws", "ConfigurationService")); JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(ManagedElementMgr.class); // the SEI factory.setAddress("http://localhost:8080/mtosi/v1/ManagedElementMgr";); factory.setServiceName(new QName("tmf854.v1.ws", "ConfigurationService")); factory.setWsdlLocation("http://localhost:8080/mtosi/v1/ManagedElementMgr?wsdl";); Client clientage = ClientProxy.getClient(factory.create()); but I get: Exception in thread "main" org.apache.cxf.common.i18n.UncheckedException: No operation was found with the name {tmf854.v1.ws}getAllManagedElements. at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:192) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:186) at here is a snippet of the WSDL I hame published on Tomcat: http://localhost:8080/mtosi/v1/ManagedElementMgr?wsdl=../binding/soap_http/ManagedElementMgrSOAP.wsdl"; namespace="tmf854.v1.ws"> //OTHER IMPORTS http://localhost:8080/mtosi/v1/ManagedElementMgr"/> //OTHER PORTS may be the port name is "ManagedElementMgr" instead of "ManagedElementMgrHttp" -- View this message in context: http://www.nabble.com/org.apache.cxf.endpoint.Client-usage-tp14294775p14370170.html Sent from the cxf-user mailing list archive at Nabble.com.
RE: org.apache.cxf.endpoint.Client usage
Hi Willem, my question was not crystal clear... sorry. my problem is on how to invoke the method. using client.invoke("getAllManagedElements",holder,new GetAllManagedElements()); I get the exception shown below. Is the service invoked correctly? Calling it through the Service concrete implementation generated by wsdl2java works fine. Willem2 wrote: > > Hi Davide, > > You can do it by adding the interceptors with the below codes > > JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); > factory.getInInterceptors().add(youInInterceptor); > factory.getOutInterceptors().add(youOutInterceptor); > > > Willem. > > > -Original Message- > From: Davide Gesino [mailto:[EMAIL PROTECTED] > Sent: Wed 12/12/2007 21:06 > To: cxf-user@incubator.apache.org > Subject: org.apache.cxf.endpoint.Client usage > > > I am trying to add client interceptors programmatically and need some help > to > user the Client interface. > here is the snippet of code: > > // WITHOUT DYNAMIC CLIENT > ConfigurationService service = new ConfigurationService(); //SERVICE > > ManagedElementMgr mgr = service.getManagedElementMgrHttp(); // PORT > Holder holder = new Holder(); //PARAM 1 > GetAllManagedElementsResponseT response = > mgr.getAllManagedElements(holder, new GetAllManagedElementsT()); // WS > CALL > > //WITH DYNAMIC CLIENT > JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); > factory.setServiceClass(ManagedElementMgr.class); > factory.setAddress("http://localhost:8080/mtosi/v1/ManagedElementMgr";); > > Client client = ClientProxy.getClient(factory.create()); > IteratorClientInterceptor inter = new IteratorClientInterceptor(); // ADD > MY > ITERCEPTOR > client.what? > > I don't know how to invoke the client. > I havev tried: > client.invoke("getAllManagedElements",holder,new GetAllManagedElements()); > > but I get an exception: > > org.apache.cxf.interceptor.Fault: Message part {tmf854.v1}header was not > recognized. at > org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:179) > 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: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:713) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) > 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:210) > 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:870) > 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:685) > at java.lang.Thread.run(Unknown Source) > > > WHATAM I MISSING?? > -- > View this message in context: > http://www.nabble.com/org.apache.cxf.endpoint.Client-usage-tp14294775p14294775.html > Sent from the cxf-user mailing list archive at Nabble.com. > > > -- View this message in context: http://www.nabble.com/org.apache.cxf.endpoint.Client-usage-tp14294775p14295105.html Sent from the cxf-user mailing list archive at Nabble.com.
org.apache.cxf.endpoint.Client usage
I am trying to add client interceptors programmatically and need some help to user the Client interface. here is the snippet of code: // WITHOUT DYNAMIC CLIENT ConfigurationService service = new ConfigurationService(); //SERVICE ManagedElementMgr mgr = service.getManagedElementMgrHttp(); // PORT Holder holder = new Holder(); //PARAM 1 GetAllManagedElementsResponseT response = mgr.getAllManagedElements(holder, new GetAllManagedElementsT()); // WS CALL //WITH DYNAMIC CLIENT JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(ManagedElementMgr.class); factory.setAddress("http://localhost:8080/mtosi/v1/ManagedElementMgr";); Client client = ClientProxy.getClient(factory.create()); IteratorClientInterceptor inter = new IteratorClientInterceptor(); // ADD MY ITERCEPTOR client.what? I don't know how to invoke the client. I havev tried: client.invoke("getAllManagedElements",holder,new GetAllManagedElements()); but I get an exception: org.apache.cxf.interceptor.Fault: Message part {tmf854.v1}header was not recognized. at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:179) 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: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:713) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) 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:210) 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:870) 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:685) at java.lang.Thread.run(Unknown Source) WHATAM I MISSING?? -- View this message in context: http://www.nabble.com/org.apache.cxf.endpoint.Client-usage-tp14294775p14294775.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: multiple responses in jms
Hi, you should post your answer to a different Thread than mine to make it visible, my thread has a different subject. Davide -- View this message in context: http://www.nabble.com/org.apache.cxf.endpoint.Client-usage-tp14292643p14294143.html Sent from the cxf-user mailing list archive at Nabble.com.
org.apache.cxf.endpoint.Client usage
I am trying to add client interceptors programmatically and need some help to user the Client interface. here is the snippet of code: // WITHOUT DYNAMIC CLIENT ConfigurationService service = new ConfigurationService(); //SERVICE ManagedElementMgr mgr = service.getManagedElementMgrHttp(); // PORT Holder holder = new Holder(); //PARAM 1 GetAllManagedElementsResponseT response = mgr.getAllManagedElements(holder, new GetAllManagedElementsT()); // WS CALL //WITH DYNAMIC CLIENT JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(ManagedElementMgr.class); factory.setAddress("http://localhost:8080/mtosi/v1/ManagedElementMgr?wsdl";); Client client = ClientProxy.getClient(factory.create()); IteratorClientInterceptor inter = new IteratorClientInterceptor(); // ADD MY ITERCEPTOR client.what? I don't know how to invoke the client. I havev tried: client.invoke("getAllManagedElements",holder,new GetAllManagedElements()); but I get an exception: org.apache.cxf.binding.soap.SoapFault: "http://schemas.xmlsoap.org/wsdl/"; is not a valid SOAP version. org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:90) 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) org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1948) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1791) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575) org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) 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.endpoint.ClientImpl.invoke(ClientImpl.java:180) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:200) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:186) WHATAM I MISSING?? -- View this message in context: http://www.nabble.com/org.apache.cxf.endpoint.Client-usage-tp14292643p14292643.html Sent from the cxf-user mailing list archive at Nabble.com.
CXF and SOAPHandler
a question on JAX-WS Handler. CXF supports the @HandlerChain annotation to specify the server side handlers. There is a way to attach these handlers to an endpoint through the spring xml file? I mean normal handlers, not interceptor. I'd rather use handlers than interceptors. -- View this message in context: http://www.nabble.com/CXF-and-SOAPHandler-tp14275891p14275891.html Sent from the cxf-user mailing list archive at Nabble.com.
CXF and Sun XWSS
Hi, does anyone have used Sun Metro part to manage basi WS- security with CXF instead of Apache WSS4J? I mean XWSS. Tahnks. David -- View this message in context: http://www.nabble.com/CXF-and-Sun-XWSS-tf4917706.html#a14074834 Sent from the cxf-user mailing list archive at Nabble.com.
differences between Interceptors and Handlers
what is the differences between a CXF interceptor and a JAX-WS LogicalHandler (an implementation of javax.xml.ws.handler.LogicalHandler)??? I guess the functionality is the same, but the usage is different. Can I use an approach in which I have both a series of intercetpors (configured with Spring) and and Handler Chain defined in a handler-chain.xml file??? Thanks Davide -- View this message in context: http://www.nabble.com/differences-between-Interceptors-and-Handlers-tf4883199.html#a13975552 Sent from the cxf-user mailing list archive at Nabble.com.
SVN configuration
I could not find a way to check out anonymously CXF sources (using netbeans, eclipse and by commad line). here do I have to put the props described here http://incubator.apache.org/cxf/source-repository.html?? Have someone succesfully configured an IDE remote repository location on eclipse or netbeans? -- View this message in context: http://www.nabble.com/SVN-configuration-tf4882072.html#a13971753 Sent from the cxf-user mailing list archive at Nabble.com.
Re: restful_http_binding and WebServiceContext
or maybe in a RESTful WS the context is not injected at all, due to the nature of REST. 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 >> >> > > -- View this message in context: http://www.nabble.com/restful_http_binding-and-WebServiceContext-tf4875856.html#a13969474 Sent from the cxf-user mailing list archive at Nabble.com.
Re: restful_http_binding and WebServiceContext
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 > > -- View this message in context: http://www.nabble.com/restful_http_binding-and-WebServiceContext-tf4875856.html#a13969469 Sent from the cxf-user mailing list archive at Nabble.com.
Re: WS-Security Single Sign On
Hi Matt, thanks for the links. At the moment I'm trying to figure out how Sun project Metro manages WS-* extensions. Metro already supports this specs... Anyway everything is hidden away from the developer from Netbeans IDE (that still have some bugs). It is not clear what 's going on behind the scenes in glassfish, metro and netbeans. expecially the transport is not pluggable, from thw wizard, so I have chose the eclipse + CXF way to have more control on what I am doing. My prj is based on CXF. going back to CXF... Using an overall trusted Security Token Service (STS) that generates security session tokens seems to be the right way to have a single signed on (and then have a secure conversation). Pls refer to: https://wsit.dev.java.net/docs/trust-whitepaper.pdf CAS seems to be the way to provide a STS both client and server trust I'm trying to understand how it works, how it could be integrated in TOMCAT with CXF and ACEGI. I have not still understood if CAS is protocol agnostic, I would not have to rely upon HTTP transport security. I'll try make something out all these technoligies, when I have some code that does work (I hope) I'll make you know! mattmadhavan wrote: > > Hi Davide, > (I have replied to one of your earlier reply to mine). I found bunch of > postings here and few blogs. > Please look at ACEGI+ CAS (SSO) fro SSO. > > Please refer to this great post, > http://domagojtechtips.blogspot.com/2007/08/cxf-spring-and-ws-security-putting-it.html > > explains security prpogation. The idea is to tie in Acegi to this one and > use Acegi+CAS for SSO. > > This post explains the ACEGI+CXF. > http://www.nabble.com/Acegi-Security-with-CXF-tf4337860.html#a12391936 > > The answer is out there in bits and pieces, but they all need to be tied > down! I have n't had a chance to tie'em together yet. If you are > interested we can work together. > > After thanksgiving I will get to it! > > Any help will be appreciated! > > Thanks > Matt > > > > Thkx again, the smoke is clearing out! > The infrastructure I am working in is http transport based, but probably > in the future will be moved to a JMS transport. So in the future I could > not rely on HTTPS anymore... anyway now I have it! > > I haven't understood yout sentence "WS-SecureConversation is the route to > take here, but a lot of > infrastructure needs to be put into place, in order to make effective > use of the Kerberos authentication protocol." > In which sense? WS_Secure Conversation is implemented using Kerberos? > > > > > Fred Dushin-3 wrote: >> >> David, >> >> WSS4J may have some recently added support for propagating kerberos >> "tokens" (and by "token", I take it you mean a kerberos AP_REQ >> message), but getting a token from point A to point B is a small >> fraction of the story, when it comes to kerberos integration with Web >> Services. >> >> Yes, WS-SecureConversation is the route to take here, but a lot of >> infrastructure needs to be put into place, in order to make effective >> use of the Kerberos authentication protocol. In particular, security >> sessions need to be established and maintained (along the lines of >> abstractions provided by the GSS-API), and used to provide >> cryptographic services for messages delivered in the secure channel >> established. >> >> Of course, this may be overkill. An alternative is to use SSL to >> protect the channel, and just pass kerberos tickets as cookies. You >> at least get some assurance of client identity that way, but that's a >> pretty weak security story, IMO. It also requires that you use SSL, >> which sort of defeats the purpose of using Kerberos, in the first >> place -- or at a minimum overlooks the full power of the kerberos >> infrastructure. SSL may not be a viable options for all deployments, >> as well (e.g., JMS), but that doesn't seem to be an obstacle in your >> specific case. >> >> -Fred >> >> On Sep 13, 2007, at 4:07 AM, Davide Gesino wrote: >> >>> >>> Hi Fred, >>> >>> With "Single Sign On" I meant a mechanism to have a series of messages >>> authenticated only once (with the first of the series) and treated >>> as a >>> conversation, instead of autenthicate each message. >>> I some way I would want to emulate something similar to initial login >>> followed by and exchange of messages. >>> Maybe this pertains the WS-SecureConversation specification, that >>> I've seen >>> will be cover
Re: CXF+ACEGI setting userid/pw on the client side
Hi, I do not think so, I think you have to create a message handler, that adds token you want to the soap header and put iit in a handler chain if you're working in java. Anyway this info have to go in a SOAP header. Theoretically you could construct the XML soap request programmatically (also in Java)... but it is pain. Using other languages I guess there is some high level API (in .NET at least) to add this kind of header, that on the server side will be processed in a jax-ws fashion. For .Net You could watch to the java project tango web site and see if there is something worth about it. I don't know if I have said something useful ;-) mattmadhavan wrote: > > Hi, > Is there any way to setup userid/pw soap header token on the client side > programatically without having to create a callback handler class etc? > > I just want to create a token and add it to the soap message! My client > side can be .NET, JAVA. FLEX etc. I cannot force them to do equivalent > things (like creating callback handler to set the pw). > > Any ideas? > > Thanks > Matt > -- View this message in context: http://www.nabble.com/CXF%2BACEGI-setting-userid-pw-on-the-client-side-tf4687934.html#a13900208 Sent from the cxf-user mailing list archive at Nabble.com.
RE: CXF + ACEGI security - full example
Does anyone have finished this example? I have tried applying these snippets to my code, anyway I was not able to make something work. :-( What are the ACEGI jars to be imported? What are the ACEGI relevant classes to create and store a login context somewhere? Kaleb Walton-2 wrote: > > > Thank you for the example! > > > |> > | From: | > |> > > >--| > |"Anne Racel" <[EMAIL PROTECTED]> > > | > > >--| > |> > | To:| > |> > > >--| > | > > | > > >--| > |> > | Date: | > |> > > >--| > |10/07/2007 08:54 AM > > | > > >--| > |> > | Subject: | > |> > > >--| > |RE: CXF + ACEGI security - full example > > | > > >--| > > > > > > Oops! - this should be: "your class that implements CallbackHandler" > > > > Anne Racel > Senior Software Engineer > Cormine Intelligent Data > > > > -- View this message in context: http://www.nabble.com/CXF-%2B-ACEGI-security---full-example-tf4583091.html#a13899025 Sent from the cxf-user mailing list archive at Nabble.com.
wsdl2java generates alla the datatypes?
Hi, using wsdl2java seems that it doesn't create all the data types included in the schemas. seems the generate only the data types used in the concrete message. If I have a data type that is not used in any message this data type is not generated. I have a data type that is used in a tag, so it is not referenced explicitly in any message, but I would need my data type to be generated as well. -- View this message in context: http://www.nabble.com/wsdl2java-generates-alla-the-datatypes--tf4546949.html#a12975315 Sent from the cxf-user mailing list archive at Nabble.com.
JAXB: problem unmarshalling a list of generic data (
Hi, I am encountering a problem mashalling and unmasrhalling data containing a List of any objects, such as: . JAXB converts an annotation like this in amnArrayList of object. I have a question. How can I marshall and unmarshall some data in this list of objects? I have tried marshalling a complex type encapsulating it in a JAXBElement in ths way: JAXBElement jxNameAndStrVal = new JAXBElement(new QName("tmf854.v1", "nvs"), NameAndStringValueT.class, NVSListT.class, nameAndStringValue); the marshalling seems to work fine ( the SOAP message seems formatted correct). Anyway when the client receives the data he get the elements encapsulated in a xerces NMElement, and he cannot recover the class of the object he gets. (I noticed the "type" in the nmelement is null). How can I get back thee class of the object and the recover the instance? Thanks Davide -- View this message in context: http://www.nabble.com/JAXB%3A-problem-unmarshalling-a-list-of-generic--data-%28%3Cany-%3E-tf4533085.html#a12936540 Sent from the cxf-user mailing list archive at Nabble.com.
WS-Security public keys exchange
Hi, a question about WS-Security. I was able to make 2 parties communicate with each other using a WS-Security secured messages with preinstalled keystores. There is some way for a party to know at runtime the public key of the other one without having it preinstalled? Thx David -- View this message in context: http://www.nabble.com/WS-Security-public-keys-exchange-tf4487822.html#a12798042 Sent from the cxf-user mailing list archive at Nabble.com.
Re: WS-Security Single Sign On
Thkx again, the smoke is clearing out! The infrastructure I am working in is http transport based, but probably in the future will be moved to a JMS transport. So in the future I could not rely on HTTPS anymore... anyway now I have it! I haven't understood yout sentence "WS-SecureConversation is the route to take here, but a lot of infrastructure needs to be put into place, in order to make effective use of the Kerberos authentication protocol." In which sense? WS_Secure Conversation is implemented using Kerberos? Fred Dushin-3 wrote: > > David, > > WSS4J may have some recently added support for propagating kerberos > "tokens" (and by "token", I take it you mean a kerberos AP_REQ > message), but getting a token from point A to point B is a small > fraction of the story, when it comes to kerberos integration with Web > Services. > > Yes, WS-SecureConversation is the route to take here, but a lot of > infrastructure needs to be put into place, in order to make effective > use of the Kerberos authentication protocol. In particular, security > sessions need to be established and maintained (along the lines of > abstractions provided by the GSS-API), and used to provide > cryptographic services for messages delivered in the secure channel > established. > > Of course, this may be overkill. An alternative is to use SSL to > protect the channel, and just pass kerberos tickets as cookies. You > at least get some assurance of client identity that way, but that's a > pretty weak security story, IMO. It also requires that you use SSL, > which sort of defeats the purpose of using Kerberos, in the first > place -- or at a minimum overlooks the full power of the kerberos > infrastructure. SSL may not be a viable options for all deployments, > as well (e.g., JMS), but that doesn't seem to be an obstacle in your > specific case. > > -Fred > > On Sep 13, 2007, at 4:07 AM, Davide Gesino wrote: > >> >> Hi Fred, >> >> With "Single Sign On" I meant a mechanism to have a series of messages >> authenticated only once (with the first of the series) and treated >> as a >> conversation, instead of autenthicate each message. >> I some way I would want to emulate something similar to initial login >> followed by and exchange of messages. >> Maybe this pertains the WS-SecureConversation specification, that >> I've seen >> will be covered in CXF 2.1. >> There is a way to use Kerberos authentication token in wss4j ?! >> >> David >> >> >> >> >> Fred Dushin-3 wrote: >>> >>> No question is silly or bad. >>> >>> CXF itself provides no single sign-on capabilities, though one could >>> certainly try to implement one over CXF. >>> >>> The challenge is to do it in a way that provides reasonable assurance >>> and protection from replay and man-in-the-middle attacks. The naive >>> approach is to grant the client a "cookie" in virtue of a login >>> event, and then for the client to present that cookie as "evidence" >>> of its identity. This way, the client is just using an opaque token >>> in lieu of otherwise sensitive security information. (I presume this >>> is what you mean by "single sign-on"). To do this, you need to lock >>> down your communications channels, presumably in your case, using >>> SSL. And you need to ensure that the dispensed cookies can't be >>> stolen or hijacked. That's a lot of trust you need to place in how >>> you deploy your infrastructure, and it only gets you so far. >>> >>> The more compelling solution (IMO) is to use SSO technologies that >>> are already out there, such as Kerberos (which is arguably the most >>> deployed SSO solution going). But I'm guessing that's not what >>> you're after. >>> >>> -Fred >>> >>> On Sep 12, 2007, at 9:04 AM, Davide Gesino wrote: >>> >>>> >>>> Hi, >>>> >>>> may be a silly or bad question but >>>> there is a way to have a single sign on mechanism in CXF (in WS in >>>> general) >>>> or I have to check the user credentials each time for each message? >>>> There is a way to estabilish something similar to the Http Session >>>> between >>>> WS client and server?!? >>>> In my app I have CXF deployed on Tomcat and the transport is Http. >>>> >>>> David >>>> -- >>>> View this message in context: http://www.nabble.com/WS-Security- >>>> Single-Sign-On-tf4429137.html#a12634942 >>>> Sent from the cxf-user mailing list archive at Nabble.com. >>>> >>>> >>> >>> >>> >> >> -- >> View this message in context: http://www.nabble.com/WS-Security- >> Single-Sign-On-tf4429137.html#a12650564 >> Sent from the cxf-user mailing list archive at Nabble.com. >> >> > > > -- View this message in context: http://www.nabble.com/WS-Security-Single-Sign-On-tf4429137.html#a12797733 Sent from the cxf-user mailing list archive at Nabble.com.
Re: WS-Security Single Sign On
Hi Fred, With "Single Sign On" I meant a mechanism to have a series of messages authenticated only once (with the first of the series) and treated as a conversation, instead of autenthicate each message. I some way I would want to emulate something similar to initial login followed by and exchange of messages. Maybe this pertains the WS-SecureConversation specification, that I've seen will be covered in CXF 2.1. There is a way to use Kerberos authentication token in wss4j ?! David Fred Dushin-3 wrote: > > No question is silly or bad. > > CXF itself provides no single sign-on capabilities, though one could > certainly try to implement one over CXF. > > The challenge is to do it in a way that provides reasonable assurance > and protection from replay and man-in-the-middle attacks. The naive > approach is to grant the client a "cookie" in virtue of a login > event, and then for the client to present that cookie as "evidence" > of its identity. This way, the client is just using an opaque token > in lieu of otherwise sensitive security information. (I presume this > is what you mean by "single sign-on"). To do this, you need to lock > down your communications channels, presumably in your case, using > SSL. And you need to ensure that the dispensed cookies can't be > stolen or hijacked. That's a lot of trust you need to place in how > you deploy your infrastructure, and it only gets you so far. > > The more compelling solution (IMO) is to use SSO technologies that > are already out there, such as Kerberos (which is arguably the most > deployed SSO solution going). But I'm guessing that's not what > you're after. > > -Fred > > On Sep 12, 2007, at 9:04 AM, Davide Gesino wrote: > >> >> Hi, >> >> may be a silly or bad question but >> there is a way to have a single sign on mechanism in CXF (in WS in >> general) >> or I have to check the user credentials each time for each message? >> There is a way to estabilish something similar to the Http Session >> between >> WS client and server?!? >> In my app I have CXF deployed on Tomcat and the transport is Http. >> >> David >> -- >> View this message in context: http://www.nabble.com/WS-Security- >> Single-Sign-On-tf4429137.html#a12634942 >> Sent from the cxf-user mailing list archive at Nabble.com. >> >> > > > -- View this message in context: http://www.nabble.com/WS-Security-Single-Sign-On-tf4429137.html#a12650564 Sent from the cxf-user mailing list archive at Nabble.com.
WS-Security SAML and X.509 authentication token
Hi, another question about WS-Security again. In CXF how can I configure a SAML or X.509 authentication tokens?! David -- View this message in context: http://www.nabble.com/WS-Security-SAML-and-X.509-authentication-token-tf4429143.html#a12634954 Sent from the cxf-user mailing list archive at Nabble.com.
WS-Security Single Sign On
Hi, may be a silly or bad question but there is a way to have a single sign on mechanism in CXF (in WS in general) or I have to check the user credentials each time for each message? There is a way to estabilish something similar to the Http Session between WS client and server?!? In my app I have CXF deployed on Tomcat and the transport is Http. David -- View this message in context: http://www.nabble.com/WS-Security-Single-Sign-On-tf4429137.html#a12634942 Sent from the cxf-user mailing list archive at Nabble.com.
Aegis databinding available in wsdl2java
Hello, I'd like to know if in the CXF future releases there will be a way to automatically generate Aegis classes and xml files executing the wsdl2java command. And... approximatively when 2.1 version will be released? Thanxx Davide -- View this message in context: http://www.nabble.com/Aegis-databinding-available-in-wsdl2java-tf4352162.html#a12401240 Sent from the cxf-user mailing list archive at Nabble.com.
RE: cxf encryption
Hi Daniel, thanks for the help. I modified the code as you suggested, and I was able to send and process an encrypted message. I did not get the null pointer exception anymore (maybe because I upgraded to 2.0.1). Thanks everyone for your precious help! :-))) Davide Davide Gesino wrote: > > Hi Colm, > > thanks for the help. > > The server side wss4j properties file looks like this: > > org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin > org.apache.ws.security.crypto.merlin.keystore.type=jks > org.apache.ws.security.crypto.merlin.keystore.password=keyStorePassword > org.apache.ws.security.crypto.merlin.alias.password=myAliasPassword > org.apache.ws.security.crypto.merlin.keystore.alias=myAlias > org.apache.ws.security.crypto.merlin.file=META-INF/publicstore.jks > > Do I need other informations in the spring beans.xml file to tell the > server I am using just a plain taxt password and not a CallbackHandler > implementation? > > Anyway I have another problem. > I updated the project to CXF 2.0.1 and the following code seems not to > work anymore: > > URL wsdlURL = new URL("file:C:/schema/CreditReportSimple.wsdl"); > > ReportService service = new ReportService(wsdlURL, SERVICE_NAME); > CreditReportPortType port = > service.getCreditReportPortType();org.apache.cxf.endpoint.Client client = > org.apache.cxf.frontend.ClientProxy.getClient(service); > > When I call the last line of code now I get the following exception: > > Exception in thread "main" java.lang.IllegalArgumentException: not a proxy > instance > at java.lang.reflect.Proxy.getInvocationHandler(Unknown Source) > at org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:87) > at > org.netbeans.j2ee.wsdl.creditreport.CreditReportPortTypeClient.main(CreditReportPortTypeClient.java:40) > > Any Idea??! > > Thanks > > Davide > > > > O hEigeartaigh, Colm wrote: >> >> Hi Davide, >> >>> PasswordHandler is on the classpath and implements CallbackHandler >>> anyway I don't know exactly what to code inside it! >>> Is it necessary in my case ( I don't want autenthication). >> >> You have two options for specifying a password, either in the properties >> file or via a custom implementation of the CallbackHandler interface. >> You must implement one of these approaches, as wss4j needs to know the >> password to access the private key stored in your keystore, in order to >> perform decryption etc. >> >> I don't know why you're getting a ClassNotFoundException for your >> CallbackHandler implementation, you need to provide more information... >> >> Have a look at the unit tests for WS-security in CXF to see how >> configuration is done (in particular look at >> org.apache.cxf.ws.security.wss4j.TestPwdCallback). >> >> Colm. >> >> >> -Original Message- >> From: Davide Gesino [mailto:[EMAIL PROTECTED] >> Sent: 21 August 2007 10:57 >> To: cxf-user@incubator.apache.org >> Subject: cxf encryption >> >> >> Hello, >> >> I would like to set up a working example of a ws client and ws server >> exchanging encrypted messages. >> I have tried to set up an example following both the cxf wiki and the >> xfire >> tutorial, but I haven/t been able to make it work properly. >> >> I don't want to provide authentication (at this stage), just encryption. >> >> in this example I have a client that calls an endpoint deployed on >> tomcat. >> I have created a public and private keystore (following the cxf wiki). >> >> ### >> #this is the client code: >> ### >> >> ReportService service = new ReportService(wsdlURL, SERVICE_NAME); >> CreditReportPortType port = service.getCreditReportPortType(); >> >> // adding encryption >> org.apache.cxf.endpoint.Client client = >> org.apache.cxf.frontend.ClientProxy.getClient(service); >> org.apache.cxf.endpoint.Endpoint cxfEndpoint = client.getEndpoint(); >> >> Map outProps = new HashMap(); >> outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT); >> outProps.put(WSHandlerConstants.USER, "myAlias"); >> >> //Configuration of public key used to encrypt message goes to properties >> file. >> outProps.put(WSHandlerConstants.ENC_PROP_FILE,"org/codehaus/xfire/client >> /outsecurity_enc.properties"
RE: cxf encryption
Hi Colm, thanks for the help. The server side wss4j properties file looks like this: org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin org.apache.ws.security.crypto.merlin.keystore.type=jks org.apache.ws.security.crypto.merlin.keystore.password=keyStorePassword org.apache.ws.security.crypto.merlin.alias.password=myAliasPassword org.apache.ws.security.crypto.merlin.keystore.alias=myAlias org.apache.ws.security.crypto.merlin.file=META-INF/publicstore.jks Do I need other informations in the spring beans.xml file to tell the server I am using just a plain taxt password and not a CallbackHandler implementation? Anyway I have another problem. I updated the project to CXF 2.0.1 and the following code seems not to work anymore: URL wsdlURL = new URL("file:C:/schema/CreditReportSimple.wsdl"); ReportService service = new ReportService(wsdlURL, SERVICE_NAME); CreditReportPortType port = service.getCreditReportPortType();org.apache.cxf.endpoint.Client client = org.apache.cxf.frontend.ClientProxy.getClient(service); When I call the last line of code now I get the following exception: Exception in thread "main" java.lang.IllegalArgumentException: not a proxy instance at java.lang.reflect.Proxy.getInvocationHandler(Unknown Source) at org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:87) at org.netbeans.j2ee.wsdl.creditreport.CreditReportPortTypeClient.main(CreditReportPortTypeClient.java:40) Any Idea??! Thanks Davide O hEigeartaigh, Colm wrote: > > Hi Davide, > >> PasswordHandler is on the classpath and implements CallbackHandler >> anyway I don't know exactly what to code inside it! >> Is it necessary in my case ( I don't want autenthication). > > You have two options for specifying a password, either in the properties > file or via a custom implementation of the CallbackHandler interface. > You must implement one of these approaches, as wss4j needs to know the > password to access the private key stored in your keystore, in order to > perform decryption etc. > > I don't know why you're getting a ClassNotFoundException for your > CallbackHandler implementation, you need to provide more information... > > Have a look at the unit tests for WS-security in CXF to see how > configuration is done (in particular look at > org.apache.cxf.ws.security.wss4j.TestPwdCallback). > > Colm. > > > -Original Message- > From: Davide Gesino [mailto:[EMAIL PROTECTED] > Sent: 21 August 2007 10:57 > To: cxf-user@incubator.apache.org > Subject: cxf encryption > > > Hello, > > I would like to set up a working example of a ws client and ws server > exchanging encrypted messages. > I have tried to set up an example following both the cxf wiki and the > xfire > tutorial, but I haven/t been able to make it work properly. > > I don't want to provide authentication (at this stage), just encryption. > > in this example I have a client that calls an endpoint deployed on > tomcat. > I have created a public and private keystore (following the cxf wiki). > > ### > #this is the client code: > ### > > ReportService service = new ReportService(wsdlURL, SERVICE_NAME); > CreditReportPortType port = service.getCreditReportPortType(); > > // adding encryption > org.apache.cxf.endpoint.Client client = > org.apache.cxf.frontend.ClientProxy.getClient(service); > org.apache.cxf.endpoint.Endpoint cxfEndpoint = client.getEndpoint(); > > Map outProps = new HashMap(); > outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT); > outProps.put(WSHandlerConstants.USER, "myAlias"); > > //Configuration of public key used to encrypt message goes to properties > file. > outProps.put(WSHandlerConstants.ENC_PROP_FILE,"org/codehaus/xfire/client > /outsecurity_enc.properties"); > > WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps); > cxfEndpoint.getOutInterceptors().add(wssOut); > cxfEndpoint.getOutInterceptors().add(new SAAJOutInterceptor()); > > System.out.println("Invoking creditReportOperation..."); > org.netbeans.j2ee.wsdl.creditreport.CreditReport > _creditReportOperation_part1 = port.creditReportOperation(new > CreditQuery()); > System.out.println(_creditReportOperation_part1); > > > # > #while on the server side I have configured this endpoint and its > interceptors > # > > ... > > implementor="org.netbeans.j2ee.wsdl.creditreport.CreditReportPortTypeImp > l"> >
cxf encryption
Hello, I would like to set up a working example of a ws client and ws server exchanging encrypted messages. I have tried to set up an example following both the cxf wiki and the xfire tutorial, but I haven/t been able to make it work properly. I don't want to provide authentication (at this stage), just encryption. in this example I have a client that calls an endpoint deployed on tomcat. I have created a public and private keystore (following the cxf wiki). ### #this is the client code: ### ReportService service = new ReportService(wsdlURL, SERVICE_NAME); CreditReportPortType port = service.getCreditReportPortType(); // adding encryption org.apache.cxf.endpoint.Client client = org.apache.cxf.frontend.ClientProxy.getClient(service); org.apache.cxf.endpoint.Endpoint cxfEndpoint = client.getEndpoint(); Map outProps = new HashMap(); outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.ENCRYPT); outProps.put(WSHandlerConstants.USER, "myAlias"); //Configuration of public key used to encrypt message goes to properties file. outProps.put(WSHandlerConstants.ENC_PROP_FILE,"org/codehaus/xfire/client/outsecurity_enc.properties"); WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps); cxfEndpoint.getOutInterceptors().add(wssOut); cxfEndpoint.getOutInterceptors().add(new SAAJOutInterceptor()); System.out.println("Invoking creditReportOperation..."); org.netbeans.j2ee.wsdl.creditreport.CreditReport _creditReportOperation_part1 = port.creditReportOperation(new CreditQuery()); System.out.println(_creditReportOperation_part1); # #while on the server side I have configured this endpoint and its interceptors # ... This example was working fine before introducing the encryption. When I run this program I get this error on the tomcat console: Caused by: java.lang.ClassNotFoundException: org.netbeans.j2ee.wsdl.creditreport.PasswordHandler PasswordHandler is on the classpath and implements CallbackHandler anyway I don't know exactly what to code inside it! Is it necessary in my case ( I don't want autenthication). i tried to omiss this entry but i get a different error. Caused by: org.apache.ws.security.WSSecurityException: WSHandler: no reference in callback property so this entry seems to be necessary Does anyone know where coud be the problem? Does anyone know has a working example that could fit my case? Many thanks Davide -- View this message in context: http://www.nabble.com/cxf-encryption-tf4304218.html#a12251696 Sent from the cxf-user mailing list archive at Nabble.com.
RE: tomcat deployment issues
Hi I have some problems trying to develop a WS application startign from a WDSL file. I generate all the classes and stubs with: wsdl2java -all . and everything gets generated. Then I have packaged everything in a web application with this web.xml file: http://java.sun.com/dtd/web-app_2_3.dtd";> cxf cxf contextConfigLocation WEB-INF/services.xml org.springframework.web.context.ContextLoaderListener cxf cxf Apache CXF Endpoint org.apache.cxf.transport.servlet.CXFServlet 1 cxf /cxfprova/* 60 index.jsp then I have created the services.xml file, and here it is: 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";> When I deploy and run tomcat everything semms to work...but when I try to invoke the service with the client(provided by wsdl2java) I get this exception Invoking creditReportOperation... 26-lug-2007 17.29.31 org.apache.cxf.phase.PhaseInterceptorChain doIntercept INFO: Interceptor has thrown exception, unwinding now 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:206) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:253) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:204) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134) at $Proxy24.creditReportOperation(Unknown Source) at org.netbeans.j2ee.wsdl.creditreport.CreditReportPortTypeClient.main(CreditReportPortTypeClient.java:54) Caused by: java.io.IOException: /cxfprova/service1 at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1781) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1698) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ... 7 more Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Could not send Message. at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:168) at $Proxy24.creditReportOperation(Unknown Source) at org.netbeans.j2ee.wsdl.creditreport.CreditReportPortTypeClient.main(CreditReportPortTypeClient.java:54) 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:206) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:253) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:204) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134) ... 2 more Caused by: java.io.IOException: /cxfprova/service1 at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1781) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1698) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ... 7 more Some Idea!??!?? Many thanks Davide -- View this message in context: http://www.nabble.com/tomcat-deployment-issues-tf4122987.html#a11813377 Sent from the cxf-user mailing list archive at Nabble.com.