This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm totally new to CXF (and web services for that matter) and this is what I'm trying to figure out. My maven creates the classes for me. But how do I determine which class is the one I really need to use? My understanding is the one extending Service? Is that right?
Now if that's the case, the class I see after generating the code though CXF and Maven, i do not see how to implement this class in my code to make use of the service. While, when I tried to use xFire, it created a client class for me for the same WSDL and I just had to start from there and it was easy...
CXF is supposed to be easier than xFire I am told. Please help me to see that argument clearly...
//Look-up the client (it is the one which will have @Webservice annotation
//If not using spring just create the instance
IMyService client = (IMyService) context.getBean("client");
Then call the ws .
// Invoke the Service
logger.info("Client invoking WS:");
ObjectFactory factory = new ObjectFactory();
NameDataContract name = factory.createNameDataContract();
String response = client.sayHello(name);
logger.info("Response: " + response);
Joined: Jan 12, 2009
Thank you. I was able to get this to run. Although in a slightly different way. Now I'm facing another problem. The end-point for the service I'm writing the client for is supposed to be different for the dev/testing and the production environment.
I'm using Maven. It is looking for the WSDL in the path mentioned in the POM.
Now when this migrates to the testing region, I'd need it to use a different end-point. But since it will still have the same WSDL pointed to via the POM, it'll pick up the end-point for the dev environment.
What is the best way to handle this?
Joined: Apr 02, 2005
This is how had done it
But i have used simple bean , not the generated code by java2wsdl .