You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Brad O'Hearne <br...@neurofire.com> on 2007/07/13 19:39:25 UTC
Need to eliminate use of SOAP for Http-REST
Hello,
I have followed the instructions in the documentation for RESTful
services to with the intention of creating a pure Http-XML service
without SOAP. However, when I hit one of my service URL's from a browser
(without parameters, just to see what would happen) I get the following:
<soap:Envelope>
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>wrong number of arguments</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
I do not want to use SOAP. I want only an XML document passed as a
parameter over Http -- no SOAP. This seems to indicate that SOAP is
still in the mix, but I need to remove it. I have this configured in
Spring, according to the documentation. Here is the content of my spring
beans.xml (verbatim from the doc):
<beans xmlns="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">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<jaxws:endpoint
id="userService"
implementor="com.nextrials.kilter.service.user.UserService"
address="/UserService" />
</beans>
Here is the content of my web.xml, verbatim from the doc:
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/beans.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<display-name>CXF Servlet</display-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
How do I remove SOAP from the mix?
Thanks!
Brad
Re: Need to eliminate use of SOAP for Http-REST
Posted by Brad O'Hearne <br...@neurofire.com>.
Actually, I don't know (yet) if it is fixed. It may be a new problem, or
may be linked to the same thing, but I'll mention in another post here
in a moment, this RESTful configuration crashes with the introduction of
a method on my service with a return type of "Collection", and it not
only crashes that method, but it appears all methods on the service.
I'll be describing this further in another post.
Brad
Liu, Jervis wrote:
> Opps, just saw that long discussion, glad to see the problem has fixed (or will be fixed :-)).
>
> Cheers,
> Jervis
>
> -----Original Message-----
> From: Brad O'Hearne [mailto:brado@neurofire.com]
> Sent: 2007?7?16? 10:22
> To: cxf-user@incubator.apache.org
> Subject: Re: Need to eliminate use of SOAP for Http-REST
>
>
> Jervis,
>
> Thanks for the reply. An update on the situation -- there is (was) a bug
> here, which Dan Diephouse is addressing. He found me a workaround to my
> problem for now.
>
> Brad
>
> Liu, Jervis wrote:
>
>> Hi Brad,
>>
>> Currently there are two ways to build RESTful service with CXF, using CXF HTTP binding or using JAX-WS Dispatch/Provider API. JAX-WS Dispatch/Provider approach is just using JAX-WS API, so it is SOAP/HTTP based (but you can also configure it to use XML binding instead). CXF HTTP binding maps operations from URI or HTTP verbs, the input parameters can be extracted from URL or Http payload using different content types such as POX or JSON, it definitely does not need SOAP in this case. I can not tell which approach you are using from the code snippet you have enclosed, I will need your com.nextrials.kilter.service.user.UserService class. But it seems that you are using JAX-WS Dispatch/Provider approach otherwise you wont get back an error message wrapped with SOAP Envelope.
>>
>> Cheers,
>> Jervis
>>
>> -----Original Message-----
>> From: Brad O'Hearne [mailto:brado@neurofire.com]
>> Sent: 2007?7?14? 1:39
>> To: cxf-user@incubator.apache.org
>> Subject: Need to eliminate use of SOAP for Http-REST
>>
>>
>> Hello,
>>
>> I have followed the instructions in the documentation for RESTful
>> services to with the intention of creating a pure Http-XML service
>> without SOAP. However, when I hit one of my service URL's from a browser
>> (without parameters, just to see what would happen) I get the following:
>>
>> <soap:Envelope>
>> <soap:Body>
>> <soap:Fault>
>> <faultcode>soap:Server</faultcode>
>> <faultstring>wrong number of arguments</faultstring>
>> </soap:Fault>
>> </soap:Body>
>> </soap:Envelope>
>>
>> I do not want to use SOAP. I want only an XML document passed as a
>> parameter over Http -- no SOAP. This seems to indicate that SOAP is
>> still in the mix, but I need to remove it. I have this configured in
>> Spring, according to the documentation. Here is the content of my spring
>> beans.xml (verbatim from the doc):
>>
>> <beans xmlns="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">
>>
>> <import resource="classpath:META-INF/cxf/cxf.xml" />
>> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
>> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>>
>> <jaxws:endpoint
>> id="userService"
>> implementor="com.nextrials.kilter.service.user.UserService"
>> address="/UserService" />
>>
>> </beans>
>>
>> Here is the content of my web.xml, verbatim from the doc:
>>
>> <!DOCTYPE web-app
>> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>> "http://java.sun.com/dtd/web-app_2_3.dtd">
>>
>> <web-app>
>>
>> <context-param>
>> <param-name>contextConfigLocation</param-name>
>> <param-value>WEB-INF/beans.xml</param-value>
>> </context-param>
>>
>> <listener>
>> <listener-class>
>> org.springframework.web.context.ContextLoaderListener
>> </listener-class>
>> </listener>
>>
>> <servlet>
>> <servlet-name>CXFServlet</servlet-name>
>> <display-name>CXF Servlet</display-name>
>> <servlet-class>
>> org.apache.cxf.transport.servlet.CXFServlet
>> </servlet-class>
>> <load-on-startup>1</load-on-startup>
>> </servlet>
>>
>> <servlet-mapping>
>> <servlet-name>CXFServlet</servlet-name>
>> <url-pattern>/*</url-pattern>
>> </servlet-mapping>
>>
>> </web-app>
>>
>> How do I remove SOAP from the mix?
>>
>> Thanks!
>>
>> Brad
>>
>>
>>
>> ----------------------------
>> IONA Technologies PLC (registered in Ireland)
>> Registered Number: 171387
>> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>>
>>
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>
RE: Need to eliminate use of SOAP for Http-REST
Posted by "Liu, Jervis" <jl...@iona.com>.
Opps, just saw that long discussion, glad to see the problem has fixed (or will be fixed :-)).
Cheers,
Jervis
-----Original Message-----
From: Brad O'Hearne [mailto:brado@neurofire.com]
Sent: 2007?7?16? 10:22
To: cxf-user@incubator.apache.org
Subject: Re: Need to eliminate use of SOAP for Http-REST
Jervis,
Thanks for the reply. An update on the situation -- there is (was) a bug
here, which Dan Diephouse is addressing. He found me a workaround to my
problem for now.
Brad
Liu, Jervis wrote:
> Hi Brad,
>
> Currently there are two ways to build RESTful service with CXF, using CXF HTTP binding or using JAX-WS Dispatch/Provider API. JAX-WS Dispatch/Provider approach is just using JAX-WS API, so it is SOAP/HTTP based (but you can also configure it to use XML binding instead). CXF HTTP binding maps operations from URI or HTTP verbs, the input parameters can be extracted from URL or Http payload using different content types such as POX or JSON, it definitely does not need SOAP in this case. I can not tell which approach you are using from the code snippet you have enclosed, I will need your com.nextrials.kilter.service.user.UserService class. But it seems that you are using JAX-WS Dispatch/Provider approach otherwise you wont get back an error message wrapped with SOAP Envelope.
>
> Cheers,
> Jervis
>
> -----Original Message-----
> From: Brad O'Hearne [mailto:brado@neurofire.com]
> Sent: 2007?7?14? 1:39
> To: cxf-user@incubator.apache.org
> Subject: Need to eliminate use of SOAP for Http-REST
>
>
> Hello,
>
> I have followed the instructions in the documentation for RESTful
> services to with the intention of creating a pure Http-XML service
> without SOAP. However, when I hit one of my service URL's from a browser
> (without parameters, just to see what would happen) I get the following:
>
> <soap:Envelope>
> <soap:Body>
> <soap:Fault>
> <faultcode>soap:Server</faultcode>
> <faultstring>wrong number of arguments</faultstring>
> </soap:Fault>
> </soap:Body>
> </soap:Envelope>
>
> I do not want to use SOAP. I want only an XML document passed as a
> parameter over Http -- no SOAP. This seems to indicate that SOAP is
> still in the mix, but I need to remove it. I have this configured in
> Spring, according to the documentation. Here is the content of my spring
> beans.xml (verbatim from the doc):
>
> <beans xmlns="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">
>
> <import resource="classpath:META-INF/cxf/cxf.xml" />
> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>
> <jaxws:endpoint
> id="userService"
> implementor="com.nextrials.kilter.service.user.UserService"
> address="/UserService" />
>
> </beans>
>
> Here is the content of my web.xml, verbatim from the doc:
>
> <!DOCTYPE web-app
> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> "http://java.sun.com/dtd/web-app_2_3.dtd">
>
> <web-app>
>
> <context-param>
> <param-name>contextConfigLocation</param-name>
> <param-value>WEB-INF/beans.xml</param-value>
> </context-param>
>
> <listener>
> <listener-class>
> org.springframework.web.context.ContextLoaderListener
> </listener-class>
> </listener>
>
> <servlet>
> <servlet-name>CXFServlet</servlet-name>
> <display-name>CXF Servlet</display-name>
> <servlet-class>
> org.apache.cxf.transport.servlet.CXFServlet
> </servlet-class>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>CXFServlet</servlet-name>
> <url-pattern>/*</url-pattern>
> </servlet-mapping>
>
> </web-app>
>
> How do I remove SOAP from the mix?
>
> Thanks!
>
> Brad
>
>
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
Re: Need to eliminate use of SOAP for Http-REST
Posted by Brad O'Hearne <br...@neurofire.com>.
Jervis,
Thanks for the reply. An update on the situation -- there is (was) a bug
here, which Dan Diephouse is addressing. He found me a workaround to my
problem for now.
Brad
Liu, Jervis wrote:
> Hi Brad,
>
> Currently there are two ways to build RESTful service with CXF, using CXF HTTP binding or using JAX-WS Dispatch/Provider API. JAX-WS Dispatch/Provider approach is just using JAX-WS API, so it is SOAP/HTTP based (but you can also configure it to use XML binding instead). CXF HTTP binding maps operations from URI or HTTP verbs, the input parameters can be extracted from URL or Http payload using different content types such as POX or JSON, it definitely does not need SOAP in this case. I can not tell which approach you are using from the code snippet you have enclosed, I will need your com.nextrials.kilter.service.user.UserService class. But it seems that you are using JAX-WS Dispatch/Provider approach otherwise you wont get back an error message wrapped with SOAP Envelope.
>
> Cheers,
> Jervis
>
> -----Original Message-----
> From: Brad O'Hearne [mailto:brado@neurofire.com]
> Sent: 2007?7?14? 1:39
> To: cxf-user@incubator.apache.org
> Subject: Need to eliminate use of SOAP for Http-REST
>
>
> Hello,
>
> I have followed the instructions in the documentation for RESTful
> services to with the intention of creating a pure Http-XML service
> without SOAP. However, when I hit one of my service URL's from a browser
> (without parameters, just to see what would happen) I get the following:
>
> <soap:Envelope>
> <soap:Body>
> <soap:Fault>
> <faultcode>soap:Server</faultcode>
> <faultstring>wrong number of arguments</faultstring>
> </soap:Fault>
> </soap:Body>
> </soap:Envelope>
>
> I do not want to use SOAP. I want only an XML document passed as a
> parameter over Http -- no SOAP. This seems to indicate that SOAP is
> still in the mix, but I need to remove it. I have this configured in
> Spring, according to the documentation. Here is the content of my spring
> beans.xml (verbatim from the doc):
>
> <beans xmlns="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">
>
> <import resource="classpath:META-INF/cxf/cxf.xml" />
> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>
> <jaxws:endpoint
> id="userService"
> implementor="com.nextrials.kilter.service.user.UserService"
> address="/UserService" />
>
> </beans>
>
> Here is the content of my web.xml, verbatim from the doc:
>
> <!DOCTYPE web-app
> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> "http://java.sun.com/dtd/web-app_2_3.dtd">
>
> <web-app>
>
> <context-param>
> <param-name>contextConfigLocation</param-name>
> <param-value>WEB-INF/beans.xml</param-value>
> </context-param>
>
> <listener>
> <listener-class>
> org.springframework.web.context.ContextLoaderListener
> </listener-class>
> </listener>
>
> <servlet>
> <servlet-name>CXFServlet</servlet-name>
> <display-name>CXF Servlet</display-name>
> <servlet-class>
> org.apache.cxf.transport.servlet.CXFServlet
> </servlet-class>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>CXFServlet</servlet-name>
> <url-pattern>/*</url-pattern>
> </servlet-mapping>
>
> </web-app>
>
> How do I remove SOAP from the mix?
>
> Thanks!
>
> Brad
>
>
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>
RE: Need to eliminate use of SOAP for Http-REST
Posted by "Liu, Jervis" <jl...@iona.com>.
Hi Brad,
Currently there are two ways to build RESTful service with CXF, using CXF HTTP binding or using JAX-WS Dispatch/Provider API. JAX-WS Dispatch/Provider approach is just using JAX-WS API, so it is SOAP/HTTP based (but you can also configure it to use XML binding instead). CXF HTTP binding maps operations from URI or HTTP verbs, the input parameters can be extracted from URL or Http payload using different content types such as POX or JSON, it definitely does not need SOAP in this case. I can not tell which approach you are using from the code snippet you have enclosed, I will need your com.nextrials.kilter.service.user.UserService class. But it seems that you are using JAX-WS Dispatch/Provider approach otherwise you wont get back an error message wrapped with SOAP Envelope.
Cheers,
Jervis
-----Original Message-----
From: Brad O'Hearne [mailto:brado@neurofire.com]
Sent: 2007?7?14? 1:39
To: cxf-user@incubator.apache.org
Subject: Need to eliminate use of SOAP for Http-REST
Hello,
I have followed the instructions in the documentation for RESTful
services to with the intention of creating a pure Http-XML service
without SOAP. However, when I hit one of my service URL's from a browser
(without parameters, just to see what would happen) I get the following:
<soap:Envelope>
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>wrong number of arguments</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
I do not want to use SOAP. I want only an XML document passed as a
parameter over Http -- no SOAP. This seems to indicate that SOAP is
still in the mix, but I need to remove it. I have this configured in
Spring, according to the documentation. Here is the content of my spring
beans.xml (verbatim from the doc):
<beans xmlns="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">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<jaxws:endpoint
id="userService"
implementor="com.nextrials.kilter.service.user.UserService"
address="/UserService" />
</beans>
Here is the content of my web.xml, verbatim from the doc:
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/beans.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<display-name>CXF Servlet</display-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
How do I remove SOAP from the mix?
Thanks!
Brad
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland