I'm not entirely sure what you want to do -- are you after a SOAP or
REST service?

If SOAP, then there's a good tutorial here which covers Tomcat:

http://www.jroller.com/gmazza/date/20080417

I'm only a noob myself, but this is what got me started, and I still
refer back to it fairly often. Ignore the bits about Glassfish Metro,
and I found after starting with the Ant-based instructions that in the
end the Maven-based route worked more smoothly.

This tutorial covers specifying a WSDL first, then auto-generating the
Java classes from that, rather than the other way round. This is
probably what you want to do if you're designing a service to meet an
existing spec. Otherwise you'll end up tweaking bits of Java here and
there in the hope that the WSDL that comes out matches what your
existing clients expect -- and that'll just lead to tears. If you
really want to do Java-first there are other tutorials out there that
Google will lead you to.

If you're testing SOAP services, you absolutely want to get soapUI
(soapui.org), trying to do it manually with wget will just be painful.

If on the other hand you're after a REST service, then I'm afraid I
can't help you much, as I've never done that :-)

But {cxf rest tutorial} gets quite a few Google hits.

Good luck!

Andrew.

2008/10/28 Joseph Fair <[EMAIL PROTECTED]>:
> Group,
>
>
>
> I've been banging my head for two days on a replacement for a PHP web
> service.  The current service posts data from a Java web server and the
> PHP takes the string, parses the xml, builds the xml response, and sends
> it back.  I'm trying to do it with the (highly recommended) CXF library,
> Java 1.5, and tomcat.  I have looked at the users guide, but I kept
> getting tripped up on the fact that I'm using Tomcat and the examples
> are not for tomcat.
>
>
>
> Instead, I implemented a service using this tutorial
>
> http://www.benmccann.com/dev-blog/web-services-tutorial-with-apache-cxf/
>
>
>
> only to realize that now (think) I've got a soap-based web service, not
> a RESTful one.
>
>
>
> I have a couple questions:
>
> 1.  What is the best way to do this replacement?  If there is a good,
> simple example that includes setting it up for tomcat I'd appreciate it.
>
>
>
> 2.       When I post to the web service
>
>
>
> wget  --post-data="<searchQuery
> xmlns='http://xml.envysion.com'>copl</searchQuery>"
> --no-check-certificate
> http://localhost/video-copy-agent/services/VideoCopyServiceAddress/copyR
> equest
>
>
>
> I get back
>
> ERROR 500: Internal Server Error.
>
> And the logs say
>
> org.apache.cxf.binding.soap.SoapFault: "http://xml.envysion.com";, the
> namespace on the "searchQuery" element, is not a valid SOAP version.
>
>
>
>
>
> I can change the request to include a name space, but can't I get around
> it? I don't really need it.
>
>
>
>
>
>
>
> 3.  Does this look like the right idea:
>
>
>
> csf.xml :
>
> ...
>
>  <jaxws:endpoint id="videoCopyService"
>
>
> implementor="com.envysion.nakika.videocopy.service.impl.VideoCopyAgentSe
> rviceImpl"
>
>                  address="/VideoCopyServiceAddress"/>
>
> ...
>
>
>
>
>
> VideoCopyAgentServiceImpl.java
>
> ...
>
> @WebService(endpointInterface =
> "com.envysion.nakika.videocopy.service.VideoCopyAgentService",
> serviceName = "publicVideoCopyAgentService")
>
> public class VideoCopyAgentServiceImpl
>
>  implements VideoCopyAgentService
>
> {
>
> ...
>
>  public String copyRequest(String searchQuery)
>
>  {
>
>  }
>
> }
>
>
>
>
>
> VideoCopyAgentService.java
>
> ...
>
> @WebService(targetNamespace = "http://xml.envysion.com";)
>
> public interface VideoCopyAgentService
>
> {
>
> ...
>
> public String copyRequest(@WebParam(name="searchQuery") String
> searchQuery);
>
> }
>
>
>
>
>
>

Reply via email to