Re: CXF 2.0.4 client sends SOAP request that server doesn't like
Never mind -- my build script wasn't properly rebuilding the client stub. Thanks. On 3/1/08, Michael Nelson [EMAIL PROTECTED] wrote: I am using CXF 2.0.4 on both client and server. I have a simple server interface derived from one of the samples (see below). When I try to call the deleteCustomer function using the CXF 2.0.4 wsdl2java client, the first element of the paramArray passed into org.apache.cxf.jaxws.JAXWSMethodInvoker.performInvocation() is null. If I use Microsoft's WCF, I don't have this problem. The difference between the two requests is the namespace prefix on the tags in the method invocation. If I remove them and do a manual post using wget, the call succeeds. WCF: s:Envelope xmlns:s= http://schemas.xmlsoap.org/soap/envelope/;s:BodydeleteCustomerhttp://schemas.xmlsoap.org/soap/envelope/%22%3E%3Cs:Body%3E%3CdeleteCustomer xmlns= http://customer.acme.com;id4300/id/deleteCustomer/s:Body/s:Envelope CXF client: soap:Envelope xmlns:soap= http://schemas.xmlsoap.org/soap/envelope/;soap:Bodyns2:deleteCustomerhttp://schemas.xmlsoap.org/soap/envelope/%22%3E%3Csoap:Body%3E%3Cns2:deleteCustomerxmlns:ns2= http://customer.acme.com;id4300/id/ns2:deleteCustomer/soap:Body/soap:Envelopes:Envelope xmlns:s= http://schemas.xmlsoap.org/soap/envelope/;s:BodydeleteCustomerid4300/id/deleteCustomer /s:Body/s:Envelope Any ideas on how I might be able to solve this problem? Or is this just a bug? Thanks, -mike === @WebService(targetNamespace = http://customer.acme.com;) public interface CustomerService { [ ... Other methods ...] @Delete @HttpResource(location = /customers/{id}) void deleteCustomer(@WebParam(name = id) long id) throws CustomerNotFoundFault; } The client interface that is generated from wsdl2java is: @WebService(targetNamespace = http://customer.acme.com;, name = CustomerService) public interface CustomerService { [... Other methods ...] @RequestWrapper(localName = deleteCustomer, targetNamespace = http://customer.acme.com;, className = com.acme.customer.DeleteCustomer) @ResponseWrapper(localName = deleteCustomerResponse, targetNamespace = http://customer.acme.com;, className = com.acme.customer.DeleteCustomerResponse) @WebMethod public void deleteCustomer( @WebParam(name = id, targetNamespace = http://customer.acme.com ) long id ); };
unsubscribe
Re: 2.1 AegisServiceConfiguration
All that class foes is change namespace URIs. You can, in 2.1, either change to the new class (and keep using xfire-compatible) uri's, or you can inherit from its base class. On Sat, Mar 1, 2008 at 7:34 PM, tog [EMAIL PROTECTED] wrote: On Sun, Mar 2, 2008 at 1:02 AM, Benson Margulies [EMAIL PROTECTED] wrote: XFireCompatibilityServiceConfiguration. The javadoc claims to say so, did it not come through? humm, no there is nothing about aegis in the javadoc ;-) I could not find it for 2.0.3 either (btw I am looking in docs/api) Also, I don't see how that has anything to do with operation tuning. All it's ever done is to change namespace URIs. Here is what I am doing with it (and still expect from 2.1 :-)) public class GroovyConfiguration extends AegisServiceConfiguration { public Boolean isOperation(Method m) { try { Method method = GroovyObject.class.getMethod(m.getName(), m.getParameterTypes()); return false; } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); return false; } catch (NoSuchMethodException e) { // TODO Auto-generated catch block return super.isOperation(m); } } public String getAction(OperationInfo op, Method m){ return op.getName().getLocalPart(); } }
Re: 2.1 AegisServiceConfiguration
Ok, then I will probably inherit from it's base class. What about the doc ? any chance to have it online ? Thanks Guillaume On Sun, Mar 2, 2008 at 10:44 PM, Benson Margulies [EMAIL PROTECTED] wrote: All that class foes is change namespace URIs. You can, in 2.1, either change to the new class (and keep using xfire-compatible) uri's, or you can inherit from its base class. On Sat, Mar 1, 2008 at 7:34 PM, tog [EMAIL PROTECTED] wrote: On Sun, Mar 2, 2008 at 1:02 AM, Benson Margulies [EMAIL PROTECTED] wrote: XFireCompatibilityServiceConfiguration. The javadoc claims to say so, did it not come through? humm, no there is nothing about aegis in the javadoc ;-) I could not find it for 2.0.3 either (btw I am looking in docs/api) Also, I don't see how that has anything to do with operation tuning. All it's ever done is to change namespace URIs. Here is what I am doing with it (and still expect from 2.1 :-)) public class GroovyConfiguration extends AegisServiceConfiguration { public Boolean isOperation(Method m) { try { Method method = GroovyObject.class.getMethod(m.getName(), m.getParameterTypes()); return false; } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); return false; } catch (NoSuchMethodException e) { // TODO Auto-generated catch block return super.isOperation(m); } } public String getAction(OperationInfo op, Method m){ return op.getName().getLocalPart(); } } -- Best Regards Guillaume PGP KeyID:C1A0A73F FingerPrint:A4A2 73C0 E7D4 6437 8185 D05E ECF2 AD84 C1A0 A73F http://cheztog.blogspot.com
Re: 2.1 AegisServiceConfiguration
I'll talk to DKulp. On Sun, Mar 2, 2008 at 9:57 AM, tog [EMAIL PROTECTED] wrote: Ok, then I will probably inherit from it's base class. What about the doc ? any chance to have it online ? Thanks Guillaume On Sun, Mar 2, 2008 at 10:44 PM, Benson Margulies [EMAIL PROTECTED] wrote: All that class foes is change namespace URIs. You can, in 2.1, either change to the new class (and keep using xfire-compatible) uri's, or you can inherit from its base class. On Sat, Mar 1, 2008 at 7:34 PM, tog [EMAIL PROTECTED] wrote: On Sun, Mar 2, 2008 at 1:02 AM, Benson Margulies [EMAIL PROTECTED] wrote: XFireCompatibilityServiceConfiguration. The javadoc claims to say so, did it not come through? humm, no there is nothing about aegis in the javadoc ;-) I could not find it for 2.0.3 either (btw I am looking in docs/api) Also, I don't see how that has anything to do with operation tuning. All it's ever done is to change namespace URIs. Here is what I am doing with it (and still expect from 2.1 :-)) public class GroovyConfiguration extends AegisServiceConfiguration { public Boolean isOperation(Method m) { try { Method method = GroovyObject.class.getMethod(m.getName(), m.getParameterTypes()); return false; } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); return false; } catch (NoSuchMethodException e) { // TODO Auto-generated catch block return super.isOperation(m); } } public String getAction(OperationInfo op, Method m){ return op.getName().getLocalPart(); } } -- Best Regards Guillaume PGP KeyID:C1A0A73F FingerPrint:A4A2 73C0 E7D4 6437 8185 D05E ECF2 AD84 C1A0 A73F http://cheztog.blogspot.com
CXF confuses operations
If I create two operations with different messages, but which have the parameters of the same name (which are unwrapped), CXF is unable to distinguish which operation I was referring to, despite it being specified in the POST URL. Is there any good solution to this, other than using GET or changing the parameter names? Thanks Scott
Aegis doc for 2.1
http://cwiki.apache.org/confluence/display/CXF20DOC/Introduction+to+Aegis+%282.1%29
RE: Configure JMS Transport With Code?
That worked great. Thanks again! An update to the wiki for this might be a good idea. -ayush -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Friday, February 29, 2008 5:54 PM To: cxf-user@incubator.apache.org Cc: Ayush Gupta Subject: Re: Configure JMS Transport With Code? You MIGHT be able to do this: factory.setStart(false); Server serv = factory.create(); JMSDestination dest = (JMSDestination)serv.getDestination(); AddressType address = dest.getJMSAddress(); address.setJndiDestinationName(); serv.start(); Dan On Friday 29 February 2008, Ayush Gupta wrote: The documentation talks about configuring JMS transport for a service via either WSDL or through cxf.xml. Is there a way that I can set or override these properties using code? More specifically, I'd like to set the following things at runtime: 1. jndiDestinationName 2. jndiReplyDestinationName 3. The java.naming.provider.url JMSNamingProperty I'm guessing that this has to be done before I call create() on my JMS instance of JaxWsServerFactoryBean. Any thoughts on how I can do this? Thanks -ayush -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: How to seperate with CXF
On Saturday 01 March 2008, yulinxp wrote: I tried CXF client. I can connect to the server after setting allowChunking(false) and SSL. But there comes another exception. The result is null. Did some debugging and apparently the server isn't liking any of the cypher suites we have set and is sending back an HTML page instead of a nice soap fault or something. This probably relates to: https://issues.apache.org/jira/browse/CXF-1456 Change the code for the TLS params to: TLSClientParameters tlsParams = new TLSClientParameters(); tlsParams.setSecureSocketProtocol(SSL); tlsParams.getCipherSuites().add(SSL_RSA_WITH_3DES_EDE_CBC_SHA); tlsParams.getCipherSuites().add(SSL_RSA_WITH_RC4_128_MD5); httpConduit.setTlsClientParameters(tlsParams); and it connects fine. I now get back a proper soap message and a Invalid SourceID, username or password. response. Dan org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader. at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleM essage(ReadHeadersInterceptor.java:187) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleM essage(ReadHeadersInterceptor.java:56) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto rChain.java:207) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:402) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRe sponse(HTTPConduit.java:1948) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HT TPConduit.java:1791) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66 ) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndin gInterceptor.handleMessage(MessageSenderInterceptor.java:62) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto rChain.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.getRequestIDsNDA(Unknown Source) at https.mdf_ingenixmedpoint_com.mdfwebservices.hprequest.HPRequestWSSoap _HPRequestWSSoap_Client.main(HPRequestWSSoap_HPRequestWSSoap_Client.jav a:82) Caused by: com.ctc.wstx.exc.WstxParsingException: Received event DTD, instead of START_ELEMENT or END_ELEMENT. at [row,col {unknown-source}]: [1,89] at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java :605) at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:461) at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1113) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleM essage(ReadHeadersInterceptor.java:85) ... 15 more Here is my source. public final class HPRequestWSSoap_HPRequestWSSoap_Client { private static final QName SERVICE_NAME = new QName(https://mdf.ingenixmedpoint.com/MDFWebServices/HPRequest.asmx;, HPRequestWS); private HPRequestWSSoap_HPRequestWSSoap_Client() { } public static void main(String args[]) throws Exception { int sourceID =1234; String strXML = xmlFile2String(C://test.xml); HPRequestWS ss = new HPRequestWS(); HPRequestWSSoap port = ss.getHPRequestWSSoap(); org.apache.cxf.endpoint.Client client = ClientProxy.getClient(port); HTTPConduit httpConduit = (HTTPConduit) client.getConduit(); httpConduit.getClient().setAllowChunking(false); TLSClientParameters tlsParams = new TLSClientParameters(); tlsParams.setSecureSocketProtocol(SSL); httpConduit.setTlsClientParameters(tlsParams); { System.out.println(Invoking getRequestIDsNDA...); javax.xml.ws.Holderjava.lang.Boolean result = new javax.xml.ws.Holderjava.lang.Boolean(); javax.xml.ws.Holderjava.lang.String response = new javax.xml.ws.Holderjava.lang.String(); try{ port.getRequestIDsNDA(sourceID, strXML, result, response); } catch (SOAPFaultException e) { System.out.println(e.getMessage()); } catch (Exception e1) { e1.printStackTrace(); } System.out.println(result= + result.value); System.out.println(response= + response.value); } System.exit(0); } public static String xmlFile2String(String fileName) { try{ DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); InputSource inputSource = new InputSource(fileName); Document document = documentBuilderFactory.newDocumentBuilder().parse(inputSource); StringWriter sw = new
Re: How to seperate with CXF
Thank you so much for the help. Now There are three solutions. 1)use CXF client with the setAllowChunking(false) and cypher suits 2) Use ClassLoader to use JAX-WS RI, and update jaxb-api.jar jax-impl.jar jaxws-api.jar with Metro's version 3)update existing CXF server service to use Simple Frontend+Aegis instead of JAX-WS Frontend/JAXB, remove cxf-rt-frontend-jaxws.jar -- View this message in context: http://www.nabble.com/How-to-seperate-with-CXF-tp15765424p15797937.html Sent from the cxf-user mailing list archive at Nabble.com.
Illegal Protocol https for HTTP URLConnection Factory
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 -- View this message in context: http://www.nabble.com/Illegal-Protocol-https-for-HTTP-URLConnection-Factory-tp15798054p15798054.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Illegal Protocol https for HTTP URLConnection Factory
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: WSDL2Java error when using jaxb:serializable/ binding customization
Hi Jesse, I just tried this binding file with hello_world.wsdl and it works. Can you check if there is some typo/error in your wsdl and make sure the xpath expression is right for your wsdl . Cheers Jim Ma On Sun, Mar 2, 2008 at 7:13 PM, Jesse McLaughlin [EMAIL PROTECTED] wrote: Hi there, I am trying to use CXF to generate a JAXB client from a WSDL, and I want all the generated objects to implement java.io.Serializable. To do this, I pass the following bindings file to WSDL2Java, using the -b option: ?xml version=1.0 encoding=UTF-8? jaxws:bindings node=wsdl:definitions/wsdl:types/xsd:schema xmlns:jaxws=http://java.sun.com/xml/ns/jaxws; xmlns:jaxb=http://java.sun.com/xml/ns/jaxb; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; jaxb:globalBindings jaxb:serializable/ /jaxb:globalBindings /jaxws:bindings When I run WSDL2Java, it gives me the following error: WSDLToJava Error : Could not find any node with the XPath expression: //wsdl:definitions/wsdl:types/xsd:schema The client is generated normally if I don't pass this file. I am using CXF 2.0.4 with JDK5 on OS X. Note that I have read on JIRA that since CXF 2.0.3, neither the wsdlLocation nor schemaLocation attributes are required when doing this sort of customization (https://issues.apache.org/jira/browse/CXF-1094). Does anyone know what I am doing wrong here or why it does not work? Thanks, Jesse. -- View this message in context: http://www.nabble.com/WSDL2Java-error-when-using-%3Cjaxb%3Aserializable-%3E-binding-customization-tp15786637p15786637.html Sent from the cxf-user mailing list archive at Nabble.com.