RE: Non CFX clients for CFX web services
David Sills wrote: > > > I would strongly suggest you try doing the code generation using > wsdl2java; your code should work then. If that's true, then you can try > narrowing the issues. You don't necessarily have to continue to use the > generated code (though I do so) but it should help you center in on the > problems. > Thanks a lot! I've done so and it works! I think the problem was in Axis main classes properties (Service, Call e.t.c). Willem.Jiang wrote: > > If you use TCPmonitor to catch the request and response package, you can > see the difference between using CXF client and AxisClient :) > Now soap messages from axis and cxf clients are almost identical. More than I solve the problem with Borland Delphi client. There was feature in the classes properties. Thanks a lot for all!! Problem is solved. -- View this message in context: http://cxf.547215.n5.nabble.com/Non-CXF-clients-for-CXF-web-services-tp4851892p4867502.html Sent from the cxf-user mailing list archive at Nabble.com.
RE: Non CFX clients for CFX web services
Tim: I would strongly suggest you try doing the code generation using wsdl2java; your code should work then. If that's true, then you can try narrowing the issues. You don't necessarily have to continue to use the generated code (though I do so) but it should help you center in on the problems. David Sills -Original Message- From: Tim [mailto:s...@mail.ru] Sent: Friday, September 30, 2011 12:50 AM To: users@cxf.apache.org Subject: RE: Non CFX clients for CFX web services David Sills, thank you for your answer. No. I don't generate client from wsdl. I don't use wsdl at all. For better understanding the problem here is client code. *Axis client* --- package com.na.clients; import java.io.IOException; import java.net.MalformedURLException; import java.rmi.RemoteException; import javax.xml.namespace.QName; import javax.xml.rpc.ServiceException; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.jdom.JDOMException; public class AxisClient { private static String URL="http://localhost:8080/";; private static String SERVICE="trainCFX/HelloWorld"; private static String METHOD="sayHi"; public Call getCall(String strEndpoint, String strNamespace, String strMetodName) throws MalformedURLException { Service svcService = new Service(); Call clCall = null; try {clCall = (Call)svcService.createCall();} catch (ServiceException e) {e.printStackTrace();} clCall.setTargetEndpointAddress( new java.net.URL(strEndpoint) ); clCall.setOperationName(new QName(strNamespace, strMetodName)); return clCall; } public static void main(String[] args) throws JDOMException { AxisClient ac=new AxisClient(); Call clCall = null; try { clCall = ac.getCall(URL+SERVICE, "http://na.com/";, METHOD); } catch (IOException e) { e.printStackTrace(); } String strResponse=""; try { * //pass param "Tim" * *strResponse = (String)clCall.invoke(new Object[] {"Tim"} );* } catch (RemoteException e) { e.printStackTrace(); } *System.out.println(strResponse);* } } --- *CXF client *(it's the simple client from CXF examples) -- package com.na.clients; import org.springframework.context.support.ClassPathXmlApplicationContext; public class CFXClient { private CFXClient() { } public static void main(String args[]) throws Exception { System.out.println("--"); // START SNIPPET: client ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"com/na/clients/client-beans.xml"}); HelloWorld client = (HelloWorld)context.getBean("client"); * //pass param "Tim" * *String response = client.sayHi("Tim");* *System.out.println("Response: " + response);* System.exit(0); // END SNIPPET: client } } --- *client-bean.xml (for spring)* 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/schema/jaxws.xsd";> http://localhost:8080/trainCFX/HelloWorld"/> *And the difference beteen clients* Axis print: "hi null" cxf print: "Response: hi, Tim" -- View this message in context: http://cxf.547215.n5.nabble.com/Non-CXF-clients-for-CXF-web-services-tp4 851892p4855793.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Non CFX clients for CFX web services
I have a Java-first example here: http://www.jroller.com/gmazza/entry/java_first_web_service On 09/30/2011 01:12 AM, Tim wrote: Thanks, Glen Mazza. I'll learn you tutorial. But my problem is is slightly different. I don't create a WSDL-first web service. I don't use wsdl at all and create web service like in http://cxf.apache.org/docs/writing-a-service-with-spring.html http://cxf.apache.org/docs/writing-a-service-with-spring.html -- View this message in context: http://cxf.547215.n5.nabble.com/Non-CXF-clients-for-CXF-web-services-tp4851892p4855834.html Sent from the cxf-user mailing list archive at Nabble.com. -- Glen Mazza Talend - http://www.talend.com/products/tsf Blog - http://www.jroller.com/gmazza Twitter - glenmazza
Re: Non CFX clients for CFX web services
Willem.Jiang wrote: > > You can access the WSDL with is generated from the CXF service from this > url http://localhost:8080/trainCFX/HelloWorld?WSDL. > I knew about it. I got wsdl description (see first post) this way. Willem.Jiang wrote: > > I just have a quick look at the AxisClient, it looks it still use the > JAXRPC API which is replaced by JAXWS. That could explain why you > AxisClient can get the right response from CXF. > Oh year! Great idea! How i didn't think about it myself I must use TCPmonitor as you said. Thanks a lot! -- View this message in context: http://cxf.547215.n5.nabble.com/Non-CXF-clients-for-CXF-web-services-tp4851892p4856232.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Non CFX clients for CFX web services
Willem.Jiang wrote: > > You can access the WSDL with is generated from the CXF service from this > url http://localhost:8080/trainCFX/HelloWorld?WSDL. > I knew about it. I got wsdl description (see first post) this way. Willem.Jiang wrote: > > I just have a quick look at the AxisClient, it looks it still use the > JAXRPC API which is replaced by JAXWS. That could explain why you > AxisClient can get the right response from CXF. > Oh year! Great idea! How i didn't think about it myself I must use TCPmonitor as you said. Thanks a lot! -- View this message in context: http://cxf.547215.n5.nabble.com/Non-CXF-clients-for-CXF-web-services-tp4851892p4856230.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Non CFX clients for CFX web services
You can access the WSDL with is generated from the CXF service from this url http://localhost:8080/trainCFX/HelloWorld?WSDL. I just have a quick look at the AxisClient, it looks it still use the JAXRPC API which is replaced by JAXWS. That could explain why you AxisClient can get the right response from CXF. If you use TCPmonitor to catch the request and response package, you can see the difference between using CXF client and AxisClient :) On 9/30/11 12:50 PM, Tim wrote: David Sills, thank you for your answer. No. I don't generate client from wsdl. I don't use wsdl at all. For better understanding the problem here is client code. *Axis client* --- package com.na.clients; import java.io.IOException; import java.net.MalformedURLException; import java.rmi.RemoteException; import javax.xml.namespace.QName; import javax.xml.rpc.ServiceException; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.jdom.JDOMException; public class AxisClient { private static String URL="http://localhost:8080/";; private static String SERVICE="trainCFX/HelloWorld"; private static String METHOD="sayHi"; public Call getCall(String strEndpoint, String strNamespace, String strMetodName) throws MalformedURLException { Service svcService = new Service(); Call clCall = null; try {clCall = (Call)svcService.createCall();} catch (ServiceException e) {e.printStackTrace();} clCall.setTargetEndpointAddress( new java.net.URL(strEndpoint) ); clCall.setOperationName(new QName(strNamespace, strMetodName)); return clCall; } public static void main(String[] args) throws JDOMException { AxisClient ac=new AxisClient(); Call clCall = null; try { clCall = ac.getCall(URL+SERVICE, "http://na.com/";, METHOD); } catch (IOException e) { e.printStackTrace(); } String strResponse=""; try { * //pass param "Tim" * *strResponse = (String)clCall.invoke(new Object[] {"Tim"} );* } catch (RemoteException e) { e.printStackTrace(); } *System.out.println(strResponse);* } } --- *CXF client *(it's the simple client from CXF examples) -- package com.na.clients; import org.springframework.context.support.ClassPathXmlApplicationContext; public class CFXClient { private CFXClient() { } public static void main(String args[]) throws Exception { System.out.println("--"); // START SNIPPET: client ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"com/na/clients/client-beans.xml"}); HelloWorld client = (HelloWorld)context.getBean("client"); * //pass param "Tim" * *String response = client.sayHi("Tim");* *System.out.println("Response: " + response);* System.exit(0); // END SNIPPET: client } } --- *client-bean.xml (for spring)* 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/schema/jaxws.xsd";> http://localhost:8080/trainCFX/HelloWorld"/> *And the difference beteen clients* Axis print: "hi null" cxf print: "Response: hi, Tim" -- View this message in context: http://cxf.547215.n5.nabble.com/Non-CXF-clients-for-CXF-web-services-tp4851892p4855793.html Sent from the cxf-user mailing list archive at Nabble.com. -- Willem -- FuseSource Web: http://www.fusesource.com Blog:http://willemjiang.blogspot.com (English) http://jnn.javaeye.com (Chinese) Twitter: willemjiang Weibo: willemjiang
Re: Non CFX clients for CFX web services
Thanks, Glen Mazza. I'll learn you tutorial. But my problem is is slightly different. I don't create a WSDL-first web service. I don't use wsdl at all and create web service like in http://cxf.apache.org/docs/writing-a-service-with-spring.html http://cxf.apache.org/docs/writing-a-service-with-spring.html -- View this message in context: http://cxf.547215.n5.nabble.com/Non-CXF-clients-for-CXF-web-services-tp4851892p4855834.html Sent from the cxf-user mailing list archive at Nabble.com.
RE: Non CFX clients for CFX web services
David Sills, thank you for your answer. No. I don't generate client from wsdl. I don't use wsdl at all. For better understanding the problem here is client code. *Axis client* --- package com.na.clients; import java.io.IOException; import java.net.MalformedURLException; import java.rmi.RemoteException; import javax.xml.namespace.QName; import javax.xml.rpc.ServiceException; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.jdom.JDOMException; public class AxisClient { private static String URL="http://localhost:8080/";; private static String SERVICE="trainCFX/HelloWorld"; private static String METHOD="sayHi"; public Call getCall(String strEndpoint, String strNamespace, String strMetodName) throws MalformedURLException { Service svcService = new Service(); Call clCall = null; try {clCall = (Call)svcService.createCall();} catch (ServiceException e) {e.printStackTrace();} clCall.setTargetEndpointAddress( new java.net.URL(strEndpoint) ); clCall.setOperationName(new QName(strNamespace, strMetodName)); return clCall; } public static void main(String[] args) throws JDOMException { AxisClient ac=new AxisClient(); Call clCall = null; try { clCall = ac.getCall(URL+SERVICE, "http://na.com/";, METHOD); } catch (IOException e) { e.printStackTrace(); } String strResponse=""; try { * //pass param "Tim" * *strResponse = (String)clCall.invoke(new Object[] {"Tim"} );* } catch (RemoteException e) { e.printStackTrace(); } *System.out.println(strResponse);* } } --- *CXF client *(it's the simple client from CXF examples) -- package com.na.clients; import org.springframework.context.support.ClassPathXmlApplicationContext; public class CFXClient { private CFXClient() { } public static void main(String args[]) throws Exception { System.out.println("--"); // START SNIPPET: client ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"com/na/clients/client-beans.xml"}); HelloWorld client = (HelloWorld)context.getBean("client"); * //pass param "Tim" * *String response = client.sayHi("Tim");* *System.out.println("Response: " + response);* System.exit(0); // END SNIPPET: client } } --- *client-bean.xml (for spring)* 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/schema/jaxws.xsd";> http://localhost:8080/trainCFX/HelloWorld"/> *And the difference beteen clients* Axis print: "hi null" cxf print: "Response: hi, Tim" -- View this message in context: http://cxf.547215.n5.nabble.com/Non-CXF-clients-for-CXF-web-services-tp4851892p4855793.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Non CFX clients for CFX web services
Someone else has answered your Axis question, but for another example of interoperability my DoubleIt tutorial creates both Metro and CXF clients and service providers, of which a client of one framework can successfully call the service of another: http://www.jroller.com/gmazza/entry/web_service_tutorial. Glen On 09/29/2011 02:08 AM, Tim wrote: Hi! I try to use CFX in first time. Before I develop web services using other framworks and tools. I make a simple project like "Writing a service with Spring" (Server and client sides). These are no any problems. But when I try to use my service by other clients it does not work correctly. Clients can connect to the service, they can make service method, but method* don't get passed parameters*. Does it mean that CFX can work only with clients developed by CFX? Why does it occure with other clients? *Additional information.* Our clients are developed by using different environments: 1. Java using Apache-Axis. 2. Delphi using their native components. Using tools: 1. IDE- Eclipse Indigo 2. Java - JDK 1.6.0_16 3. Axis 1.4. 4. CFX 2.4.2. Here is wsdl: http://cfxhello.na.com/"; xmlns:ns1="http://schemas.xmlsoap.org/soap/http"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:tns="http://cfxhello.na.com/"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";> http://cfxhello.na.com/"; xmlns:tns="http://cfxhello.na.com/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";> http://schemas.xmlsoap.org/soap/http"/> http://localhost:8080/trainCFX/HelloWorld"/> If you would like any other information I can give it. -- View this message in context: http://cxf.547215.n5.nabble.com/Non-CFX-clients-for-CFX-web-services-tp4851892p4851892.html Sent from the cxf-user mailing list archive at Nabble.com. -- Glen Mazza Talend - http://www.talend.com/products/tsf Blog - http://www.jroller.com/gmazza Twitter - glenmazza
RE: Non CFX clients for CFX web services
Tim: I regularly develop Axis 1.4 clients for my CXF web services (I have to, because any batch processes that use the services have to work from Java 1.4.2) and have never encountered any problems. I assume you are generating your client code from your WSDL? Does everything look as you would expect it there? David Sills -Original Message- From: Tim [mailto:s...@mail.ru] Sent: Thursday, September 29, 2011 2:09 AM To: users@cxf.apache.org Subject: Non CFX clients for CFX web services Hi! I try to use CFX in first time. Before I develop web services using other framworks and tools. I make a simple project like "Writing a service with Spring" (Server and client sides). These are no any problems. But when I try to use my service by other clients it does not work correctly. Clients can connect to the service, they can make service method, but method* don't get passed parameters*. Does it mean that CFX can work only with clients developed by CFX? Why does it occure with other clients? *Additional information.* Our clients are developed by using different environments: 1. Java using Apache-Axis. 2. Delphi using their native components. Using tools: 1. IDE- Eclipse Indigo 2. Java - JDK 1.6.0_16 3. Axis 1.4. 4. CFX 2.4.2. Here is wsdl: http://cfxhello.na.com/"; xmlns:ns1="http://schemas.xmlsoap.org/soap/http"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:tns="http://cfxhello.na.com/"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";> http://cfxhello.na.com/"; xmlns:tns="http://cfxhello.na.com/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";> http://schemas.xmlsoap.org/soap/http"/> http://localhost:8080/trainCFX/HelloWorld"/> If you would like any other information I can give it. -- View this message in context: http://cxf.547215.n5.nabble.com/Non-CFX-clients-for-CFX-web-services-tp4 851892p4851892.html Sent from the cxf-user mailing list archive at Nabble.com.
Non CFX clients for CFX web services
Hi! I try to use CFX in first time. Before I develop web services using other framworks and tools. I make a simple project like "Writing a service with Spring" (Server and client sides). These are no any problems. But when I try to use my service by other clients it does not work correctly. Clients can connect to the service, they can make service method, but method* don't get passed parameters*. Does it mean that CFX can work only with clients developed by CFX? Why does it occure with other clients? *Additional information.* Our clients are developed by using different environments: 1. Java using Apache-Axis. 2. Delphi using their native components. Using tools: 1. IDE- Eclipse Indigo 2. Java - JDK 1.6.0_16 3. Axis 1.4. 4. CFX 2.4.2. Here is wsdl: http://cfxhello.na.com/"; xmlns:ns1="http://schemas.xmlsoap.org/soap/http"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:tns="http://cfxhello.na.com/"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";> http://cfxhello.na.com/"; xmlns:tns="http://cfxhello.na.com/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";> http://schemas.xmlsoap.org/soap/http"/> http://localhost:8080/trainCFX/HelloWorld"/> If you would like any other information I can give it. -- View this message in context: http://cxf.547215.n5.nabble.com/Non-CFX-clients-for-CFX-web-services-tp4851892p4851892.html Sent from the cxf-user mailing list archive at Nabble.com.