You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Ray Krueger <ra...@gmail.com> on 2007/07/30 13:26:07 UTC

Plain Old Xml over Http

I'm loving CXF right now by the way, so thanks for that :)

I'd like to be able to send my current WSDL types over the wire
without soap envelopes as plain-old-xml via http POST operations.

I started with a WSDL and a pair of Request/Response type objects...

Running wsdl2java generates a perfectly working service with jaxb
inputs/outputs...
(summarizing code here, not copy and pasting)

@WebService
interface CurrencyExchange {
  @WebResult, @WebMethod
  ExchangeResponse exchange(@WebParam ExchangeRequest)
}

Great, all this SOAP stuff works as advertised and that's fantastic.
I'd like people to be able to use a REST-like url (really, I don't
care what the url looks like), but not do the auto-magical xml stuff
that CXF seems to support now in the REST support.

I'd like to use the same schemas I use for the input and output mesage
types in the wsdl.

via the POX approach...
http://localhost:8080/CurrencyExchange/exchange
POST <ExchangeRequest>.....</ExchangeRequest>
returns <ExchangeResponse>....</ExchangeResponse>

via the SOAP approach...
http://localhost:8080/CurrencyExchange
POST <SoapStuff><ExchangeRequest>.....</ExchangeRequest></<SoapStuff>
returns <SoapStuff><ExchangeResponse>....</ExchangeResponse></SoapStuff>

Any ideas where I could start or what I could touch to make this work?

(Hopefully the half-assery that are my code examples; don't confuse anyone)

Re: Plain Old Xml over Http

Posted by Brad Harper <br...@gmail.com>.
thx ray!

On 7/31/07, Ray Krueger <ra...@gmail.com> wrote:
>
> OK the final tweaks were as follows...
> I added <import resource="classpath:META-INF/cxf/cxf-extension-xml.xml"/>
> I didn't have that and was getting the error...
> org.apache.cxf.BusException: No binding factory for namespace
> http://cxf.apache.org/bindings/xformat registered.
>
> My final xml looks like this...
>
> <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-extension-xml.xml"/>
> <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
>
> <jaxws:endpoint
>         id="soapCurrencyExchange"
>         implementor="com.example.ws.fx.endpoint.CurrencyExchangeImpl"
>         address="/CurrencyExchange.soap"
>         bindingUri="http://schemas.xmlsoap.org/soap/">
> </jaxws:endpoint>
>
> <jaxws:endpoint
>         id="poxCurrencyExchange"
>         implementor="com.example.ws.fx.endpoint.CurrencyExchangeImpl"
>         address="/CurrencyExchange.xml"
>         bindingUri="http://cxf.apache.org/bindings/xformat">
> </jaxws:endpoint>
>
>
>
>
> On 7/31/07, Ray Krueger <ra...@gmail.com> wrote:
> > wow James that's fantastic, thanks!
> > I'll give this a shot this morning (CST) and let you know how it goes.
> >
> > On 7/30/07, James Mao <ja...@iona.com> wrote:
> > > Modify the cxf-servlet.xml as the following
> > >
> > >       <jaxws:endpoint
> > >           id="hello_world_xml"
> > >           implementor="demo.hw.server.GreeterImpl"
> > >           address="/xml"
> > >           bindingUri="http://cxf.apache.org/bindings/xformat">
> > >       </jaxws:endpoint>
> > >
> > >       <jaxws:endpoint
> > >           id="hello_world_soap"
> > >           implementor="demo.hw.server.GreeterImpl"
> > >           address="/soap"
> > >           bindingUri="http://apache.org/cxf/binding/http">
> > >       </jaxws:endpoint>
> > >
> > > Your impl should look like this
> > >
> > > package demo.hw.server;
> > >
> > > @javax.jws.WebService
> > >
> > > public class GreeterImpl {
> > >     public String greetMe(String me) {
> > >         System.out.println("received calling greetMe!");
> > >         return "Hello " + me;
> > >     }
> > > }
> > >
> > >
> > > However i found there is a snag, the
> > > http://localhost:8080/helloworld/services/xml?wsdl will return the
> soap
> > > binding instead of the xml binding. I'll file a jira for this.
> > > If all goes correct, you should be able to post the xml and soap to
> > >
> > > http://localhost:8080/helloworld/services/xml
> > > http://localhost:8080/helloworld/services/soap
> > >
> > > James
> > >
> > > >
> > > >> OK, I see now that the trick to getting what I want to work
> involves
> > > >> using the xformat:binding element in my wsdl:bindings.
> > > >>
> > > >> Does this mean that I can't support both POX and SOAP using the
> same
> > > >> @WebService impl?
> > > >>
> > > >
> > > > Yes, you have to specify the @WebService and also @BindingType
> > > > determine the binding you are using
> > > > in case of SOAP1.1 you can omit the annotation, but you have to
> > > > specify the @BindingType for the XML binding and for the SOAP1.2binding
> > > >
> > > > But it's also possible to configure the cxf.xml to achieve your
> goal.
> > > > will send you the link if i found the link
> > > >
> > > > Cheers,
> > > > James
> > > >
> > > >>
> > > >> On 7/30/07, Ray Krueger <ra...@gmail.com> wrote:
> > > >>
> > > >>> Was just playing around with the hello_world_xml_bare, the
> > > >>> functionality is about what I want. But I'd like to be able to run
> it
> > > >>> in the servlet container, not using that Endpoint.publish stuff.
> > > >>>
> > > >>> I have a working jaxws endpoint, I would like CXF to handle an
> > > >>> incoming xml POST, unmarshall the payload and the object to my
> Impl
> > > >>> just as it does for the soap/jaxws stuff.
> > > >>>
> > > >>> Simply put, I'd like my clients to be able to do Http POST
> operations
> > > >>> with just the payload xml, no soap:Envelope. I'd like CXF to
> unmarshal
> > > >>> it with jaxb and pass me the object.
> > > >>>
> > > >>> Maybe the client needs to use a different url for the plain xml
> vs.
> > > >>> the soap message, that's fine. I just don't want to do the
> > > >>> unmarshalling myself in a jaxws provider.
> > > >>>
> > > >>> Make sense?
> > > >>>
> > > >>>
> > > >>>
> > > >>> On 7/30/07, James Mao <ja...@iona.com> wrote:
> > > >>>
> > > >>>> wsdl2java tools only support the jax-ws frontend, it does not
> support
> > > >>>> the RESTful service, at moment, but we're working on it.
> > > >>>>
> > > >>>> We have a XML binding in cxf, you can check out the samples
> > > >>>> hello_world_xml_bare and hello_world_xml_wrapped,
> > > >>>> Don't know if it's what you're looking for?
> > > >>>>
> > > >>>> James
> > > >>>>
> > > >>>>
> > > >>>>> I'm loving CXF right now by the way, so thanks for that :)
> > > >>>>>
> > > >>>>> I'd like to be able to send my current WSDL types over the wire
> > > >>>>> without soap envelopes as plain-old-xml via http POST
> operations.
> > > >>>>>
> > > >>>>> I started with a WSDL and a pair of Request/Response type
> objects...
> > > >>>>>
> > > >>>>> Running wsdl2java generates a perfectly working service with
> jaxb
> > > >>>>> inputs/outputs...
> > > >>>>> (summarizing code here, not copy and pasting)
> > > >>>>>
> > > >>>>> @WebService
> > > >>>>> interface CurrencyExchange {
> > > >>>>>   @WebResult, @WebMethod
> > > >>>>>   ExchangeResponse exchange(@WebParam ExchangeRequest)
> > > >>>>> }
> > > >>>>>
> > > >>>>> Great, all this SOAP stuff works as advertised and that's
> fantastic.
> > > >>>>> I'd like people to be able to use a REST-like url (really, I
> don't
> > > >>>>> care what the url looks like), but not do the auto-magical xml
> stuff
> > > >>>>> that CXF seems to support now in the REST support.
> > > >>>>>
> > > >>>>> I'd like to use the same schemas I use for the input and output
> > > >>>>> mesage
> > > >>>>> types in the wsdl.
> > > >>>>>
> > > >>>>> via the POX approach...
> > > >>>>> http://localhost:8080/CurrencyExchange/exchange
> > > >>>>> POST <ExchangeRequest>.....</ExchangeRequest>
> > > >>>>> returns <ExchangeResponse>....</ExchangeResponse>
> > > >>>>>
> > > >>>>> via the SOAP approach...
> > > >>>>> http://localhost:8080/CurrencyExchange
> > > >>>>> POST
> <SoapStuff><ExchangeRequest>.....</ExchangeRequest></<SoapStuff>
> > > >>>>> returns
> > > >>>>> <SoapStuff><ExchangeResponse>....</ExchangeResponse></SoapStuff>
> > > >>>>>
> > > >>>>> Any ideas where I could start or what I could touch to make this
> > > >>>>> work?
> > > >>>>>
> > > >>>>> (Hopefully the half-assery that are my code examples; don't
> > > >>>>> confuse anyone)
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>
> > > >>
> > > >
> > >
> >
>

Re: Plain Old Xml over Http

Posted by Ray Krueger <ra...@gmail.com>.
OK the final tweaks were as follows...
I added <import resource="classpath:META-INF/cxf/cxf-extension-xml.xml"/>
I didn't have that and was getting the error...
org.apache.cxf.BusException: No binding factory for namespace
http://cxf.apache.org/bindings/xformat registered.

My final xml looks like this...

<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-extension-xml.xml"/>
<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

<jaxws:endpoint
        id="soapCurrencyExchange"
        implementor="com.example.ws.fx.endpoint.CurrencyExchangeImpl"
        address="/CurrencyExchange.soap"
        bindingUri="http://schemas.xmlsoap.org/soap/">
</jaxws:endpoint>

<jaxws:endpoint
        id="poxCurrencyExchange"
        implementor="com.example.ws.fx.endpoint.CurrencyExchangeImpl"
        address="/CurrencyExchange.xml"
        bindingUri="http://cxf.apache.org/bindings/xformat">
</jaxws:endpoint>




On 7/31/07, Ray Krueger <ra...@gmail.com> wrote:
> wow James that's fantastic, thanks!
> I'll give this a shot this morning (CST) and let you know how it goes.
>
> On 7/30/07, James Mao <ja...@iona.com> wrote:
> > Modify the cxf-servlet.xml as the following
> >
> >       <jaxws:endpoint
> >           id="hello_world_xml"
> >           implementor="demo.hw.server.GreeterImpl"
> >           address="/xml"
> >           bindingUri="http://cxf.apache.org/bindings/xformat">
> >       </jaxws:endpoint>
> >
> >       <jaxws:endpoint
> >           id="hello_world_soap"
> >           implementor="demo.hw.server.GreeterImpl"
> >           address="/soap"
> >           bindingUri="http://apache.org/cxf/binding/http">
> >       </jaxws:endpoint>
> >
> > Your impl should look like this
> >
> > package demo.hw.server;
> >
> > @javax.jws.WebService
> >
> > public class GreeterImpl {
> >     public String greetMe(String me) {
> >         System.out.println("received calling greetMe!");
> >         return "Hello " + me;
> >     }
> > }
> >
> >
> > However i found there is a snag, the
> > http://localhost:8080/helloworld/services/xml?wsdl will return the soap
> > binding instead of the xml binding. I'll file a jira for this.
> > If all goes correct, you should be able to post the xml and soap to
> >
> > http://localhost:8080/helloworld/services/xml
> > http://localhost:8080/helloworld/services/soap
> >
> > James
> >
> > >
> > >> OK, I see now that the trick to getting what I want to work involves
> > >> using the xformat:binding element in my wsdl:bindings.
> > >>
> > >> Does this mean that I can't support both POX and SOAP using the same
> > >> @WebService impl?
> > >>
> > >
> > > Yes, you have to specify the @WebService and also @BindingType
> > > determine the binding you are using
> > > in case of SOAP1.1 you can omit the annotation, but you have to
> > > specify the @BindingType for the XML binding and for the SOAP1.2 binding
> > >
> > > But it's also possible to configure the cxf.xml to achieve your goal.
> > > will send you the link if i found the link
> > >
> > > Cheers,
> > > James
> > >
> > >>
> > >> On 7/30/07, Ray Krueger <ra...@gmail.com> wrote:
> > >>
> > >>> Was just playing around with the hello_world_xml_bare, the
> > >>> functionality is about what I want. But I'd like to be able to run it
> > >>> in the servlet container, not using that Endpoint.publish stuff.
> > >>>
> > >>> I have a working jaxws endpoint, I would like CXF to handle an
> > >>> incoming xml POST, unmarshall the payload and the object to my Impl
> > >>> just as it does for the soap/jaxws stuff.
> > >>>
> > >>> Simply put, I'd like my clients to be able to do Http POST operations
> > >>> with just the payload xml, no soap:Envelope. I'd like CXF to unmarshal
> > >>> it with jaxb and pass me the object.
> > >>>
> > >>> Maybe the client needs to use a different url for the plain xml vs.
> > >>> the soap message, that's fine. I just don't want to do the
> > >>> unmarshalling myself in a jaxws provider.
> > >>>
> > >>> Make sense?
> > >>>
> > >>>
> > >>>
> > >>> On 7/30/07, James Mao <ja...@iona.com> wrote:
> > >>>
> > >>>> wsdl2java tools only support the jax-ws frontend, it does not support
> > >>>> the RESTful service, at moment, but we're working on it.
> > >>>>
> > >>>> We have a XML binding in cxf, you can check out the samples
> > >>>> hello_world_xml_bare and hello_world_xml_wrapped,
> > >>>> Don't know if it's what you're looking for?
> > >>>>
> > >>>> James
> > >>>>
> > >>>>
> > >>>>> I'm loving CXF right now by the way, so thanks for that :)
> > >>>>>
> > >>>>> I'd like to be able to send my current WSDL types over the wire
> > >>>>> without soap envelopes as plain-old-xml via http POST operations.
> > >>>>>
> > >>>>> I started with a WSDL and a pair of Request/Response type objects...
> > >>>>>
> > >>>>> Running wsdl2java generates a perfectly working service with jaxb
> > >>>>> inputs/outputs...
> > >>>>> (summarizing code here, not copy and pasting)
> > >>>>>
> > >>>>> @WebService
> > >>>>> interface CurrencyExchange {
> > >>>>>   @WebResult, @WebMethod
> > >>>>>   ExchangeResponse exchange(@WebParam ExchangeRequest)
> > >>>>> }
> > >>>>>
> > >>>>> Great, all this SOAP stuff works as advertised and that's fantastic.
> > >>>>> I'd like people to be able to use a REST-like url (really, I don't
> > >>>>> care what the url looks like), but not do the auto-magical xml stuff
> > >>>>> that CXF seems to support now in the REST support.
> > >>>>>
> > >>>>> I'd like to use the same schemas I use for the input and output
> > >>>>> mesage
> > >>>>> types in the wsdl.
> > >>>>>
> > >>>>> via the POX approach...
> > >>>>> http://localhost:8080/CurrencyExchange/exchange
> > >>>>> POST <ExchangeRequest>.....</ExchangeRequest>
> > >>>>> returns <ExchangeResponse>....</ExchangeResponse>
> > >>>>>
> > >>>>> via the SOAP approach...
> > >>>>> http://localhost:8080/CurrencyExchange
> > >>>>> POST <SoapStuff><ExchangeRequest>.....</ExchangeRequest></<SoapStuff>
> > >>>>> returns
> > >>>>> <SoapStuff><ExchangeResponse>....</ExchangeResponse></SoapStuff>
> > >>>>>
> > >>>>> Any ideas where I could start or what I could touch to make this
> > >>>>> work?
> > >>>>>
> > >>>>> (Hopefully the half-assery that are my code examples; don't
> > >>>>> confuse anyone)
> > >>>>>
> > >>>>>
> > >>>>>
> > >>
> > >>
> > >
> >
>

Re: Plain Old Xml over Http

Posted by Ray Krueger <ra...@gmail.com>.
wow James that's fantastic, thanks!
I'll give this a shot this morning (CST) and let you know how it goes.

On 7/30/07, James Mao <ja...@iona.com> wrote:
> Modify the cxf-servlet.xml as the following
>
>       <jaxws:endpoint
>           id="hello_world_xml"
>           implementor="demo.hw.server.GreeterImpl"
>           address="/xml"
>           bindingUri="http://cxf.apache.org/bindings/xformat">
>       </jaxws:endpoint>
>
>       <jaxws:endpoint
>           id="hello_world_soap"
>           implementor="demo.hw.server.GreeterImpl"
>           address="/soap"
>           bindingUri="http://apache.org/cxf/binding/http">
>       </jaxws:endpoint>
>
> Your impl should look like this
>
> package demo.hw.server;
>
> @javax.jws.WebService
>
> public class GreeterImpl {
>     public String greetMe(String me) {
>         System.out.println("received calling greetMe!");
>         return "Hello " + me;
>     }
> }
>
>
> However i found there is a snag, the
> http://localhost:8080/helloworld/services/xml?wsdl will return the soap
> binding instead of the xml binding. I'll file a jira for this.
> If all goes correct, you should be able to post the xml and soap to
>
> http://localhost:8080/helloworld/services/xml
> http://localhost:8080/helloworld/services/soap
>
> James
>
> >
> >> OK, I see now that the trick to getting what I want to work involves
> >> using the xformat:binding element in my wsdl:bindings.
> >>
> >> Does this mean that I can't support both POX and SOAP using the same
> >> @WebService impl?
> >>
> >
> > Yes, you have to specify the @WebService and also @BindingType
> > determine the binding you are using
> > in case of SOAP1.1 you can omit the annotation, but you have to
> > specify the @BindingType for the XML binding and for the SOAP1.2 binding
> >
> > But it's also possible to configure the cxf.xml to achieve your goal.
> > will send you the link if i found the link
> >
> > Cheers,
> > James
> >
> >>
> >> On 7/30/07, Ray Krueger <ra...@gmail.com> wrote:
> >>
> >>> Was just playing around with the hello_world_xml_bare, the
> >>> functionality is about what I want. But I'd like to be able to run it
> >>> in the servlet container, not using that Endpoint.publish stuff.
> >>>
> >>> I have a working jaxws endpoint, I would like CXF to handle an
> >>> incoming xml POST, unmarshall the payload and the object to my Impl
> >>> just as it does for the soap/jaxws stuff.
> >>>
> >>> Simply put, I'd like my clients to be able to do Http POST operations
> >>> with just the payload xml, no soap:Envelope. I'd like CXF to unmarshal
> >>> it with jaxb and pass me the object.
> >>>
> >>> Maybe the client needs to use a different url for the plain xml vs.
> >>> the soap message, that's fine. I just don't want to do the
> >>> unmarshalling myself in a jaxws provider.
> >>>
> >>> Make sense?
> >>>
> >>>
> >>>
> >>> On 7/30/07, James Mao <ja...@iona.com> wrote:
> >>>
> >>>> wsdl2java tools only support the jax-ws frontend, it does not support
> >>>> the RESTful service, at moment, but we're working on it.
> >>>>
> >>>> We have a XML binding in cxf, you can check out the samples
> >>>> hello_world_xml_bare and hello_world_xml_wrapped,
> >>>> Don't know if it's what you're looking for?
> >>>>
> >>>> James
> >>>>
> >>>>
> >>>>> I'm loving CXF right now by the way, so thanks for that :)
> >>>>>
> >>>>> I'd like to be able to send my current WSDL types over the wire
> >>>>> without soap envelopes as plain-old-xml via http POST operations.
> >>>>>
> >>>>> I started with a WSDL and a pair of Request/Response type objects...
> >>>>>
> >>>>> Running wsdl2java generates a perfectly working service with jaxb
> >>>>> inputs/outputs...
> >>>>> (summarizing code here, not copy and pasting)
> >>>>>
> >>>>> @WebService
> >>>>> interface CurrencyExchange {
> >>>>>   @WebResult, @WebMethod
> >>>>>   ExchangeResponse exchange(@WebParam ExchangeRequest)
> >>>>> }
> >>>>>
> >>>>> Great, all this SOAP stuff works as advertised and that's fantastic.
> >>>>> I'd like people to be able to use a REST-like url (really, I don't
> >>>>> care what the url looks like), but not do the auto-magical xml stuff
> >>>>> that CXF seems to support now in the REST support.
> >>>>>
> >>>>> I'd like to use the same schemas I use for the input and output
> >>>>> mesage
> >>>>> types in the wsdl.
> >>>>>
> >>>>> via the POX approach...
> >>>>> http://localhost:8080/CurrencyExchange/exchange
> >>>>> POST <ExchangeRequest>.....</ExchangeRequest>
> >>>>> returns <ExchangeResponse>....</ExchangeResponse>
> >>>>>
> >>>>> via the SOAP approach...
> >>>>> http://localhost:8080/CurrencyExchange
> >>>>> POST <SoapStuff><ExchangeRequest>.....</ExchangeRequest></<SoapStuff>
> >>>>> returns
> >>>>> <SoapStuff><ExchangeResponse>....</ExchangeResponse></SoapStuff>
> >>>>>
> >>>>> Any ideas where I could start or what I could touch to make this
> >>>>> work?
> >>>>>
> >>>>> (Hopefully the half-assery that are my code examples; don't
> >>>>> confuse anyone)
> >>>>>
> >>>>>
> >>>>>
> >>
> >>
> >
>

Re: Plain Old Xml over Http

Posted by James Mao <ja...@iona.com>.
Modify the cxf-servlet.xml as the following

      <jaxws:endpoint
          id="hello_world_xml"
          implementor="demo.hw.server.GreeterImpl"
          address="/xml"
          bindingUri="http://cxf.apache.org/bindings/xformat">
      </jaxws:endpoint>

      <jaxws:endpoint
          id="hello_world_soap"
          implementor="demo.hw.server.GreeterImpl"
          address="/soap"
          bindingUri="http://apache.org/cxf/binding/http">
      </jaxws:endpoint>

Your impl should look like this

package demo.hw.server;

@javax.jws.WebService

public class GreeterImpl {
    public String greetMe(String me) {
        System.out.println("received calling greetMe!");
        return "Hello " + me;
    }
}


However i found there is a snag, the 
http://localhost:8080/helloworld/services/xml?wsdl will return the soap 
binding instead of the xml binding. I'll file a jira for this.
If all goes correct, you should be able to post the xml and soap to

http://localhost:8080/helloworld/services/xml
http://localhost:8080/helloworld/services/soap

James

>
>> OK, I see now that the trick to getting what I want to work involves
>> using the xformat:binding element in my wsdl:bindings.
>>
>> Does this mean that I can't support both POX and SOAP using the same
>> @WebService impl?
>>   
>
> Yes, you have to specify the @WebService and also @BindingType 
> determine the binding you are using
> in case of SOAP1.1 you can omit the annotation, but you have to 
> specify the @BindingType for the XML binding and for the SOAP1.2 binding
>
> But it's also possible to configure the cxf.xml to achieve your goal. 
> will send you the link if i found the link
>
> Cheers,
> James
>
>>
>> On 7/30/07, Ray Krueger <ra...@gmail.com> wrote:
>>  
>>> Was just playing around with the hello_world_xml_bare, the
>>> functionality is about what I want. But I'd like to be able to run it
>>> in the servlet container, not using that Endpoint.publish stuff.
>>>
>>> I have a working jaxws endpoint, I would like CXF to handle an
>>> incoming xml POST, unmarshall the payload and the object to my Impl
>>> just as it does for the soap/jaxws stuff.
>>>
>>> Simply put, I'd like my clients to be able to do Http POST operations
>>> with just the payload xml, no soap:Envelope. I'd like CXF to unmarshal
>>> it with jaxb and pass me the object.
>>>
>>> Maybe the client needs to use a different url for the plain xml vs.
>>> the soap message, that's fine. I just don't want to do the
>>> unmarshalling myself in a jaxws provider.
>>>
>>> Make sense?
>>>
>>>
>>>
>>> On 7/30/07, James Mao <ja...@iona.com> wrote:
>>>    
>>>> wsdl2java tools only support the jax-ws frontend, it does not support
>>>> the RESTful service, at moment, but we're working on it.
>>>>
>>>> We have a XML binding in cxf, you can check out the samples
>>>> hello_world_xml_bare and hello_world_xml_wrapped,
>>>> Don't know if it's what you're looking for?
>>>>
>>>> James
>>>>
>>>>      
>>>>> I'm loving CXF right now by the way, so thanks for that :)
>>>>>
>>>>> I'd like to be able to send my current WSDL types over the wire
>>>>> without soap envelopes as plain-old-xml via http POST operations.
>>>>>
>>>>> I started with a WSDL and a pair of Request/Response type objects...
>>>>>
>>>>> Running wsdl2java generates a perfectly working service with jaxb
>>>>> inputs/outputs...
>>>>> (summarizing code here, not copy and pasting)
>>>>>
>>>>> @WebService
>>>>> interface CurrencyExchange {
>>>>>   @WebResult, @WebMethod
>>>>>   ExchangeResponse exchange(@WebParam ExchangeRequest)
>>>>> }
>>>>>
>>>>> Great, all this SOAP stuff works as advertised and that's fantastic.
>>>>> I'd like people to be able to use a REST-like url (really, I don't
>>>>> care what the url looks like), but not do the auto-magical xml stuff
>>>>> that CXF seems to support now in the REST support.
>>>>>
>>>>> I'd like to use the same schemas I use for the input and output 
>>>>> mesage
>>>>> types in the wsdl.
>>>>>
>>>>> via the POX approach...
>>>>> http://localhost:8080/CurrencyExchange/exchange
>>>>> POST <ExchangeRequest>.....</ExchangeRequest>
>>>>> returns <ExchangeResponse>....</ExchangeResponse>
>>>>>
>>>>> via the SOAP approach...
>>>>> http://localhost:8080/CurrencyExchange
>>>>> POST <SoapStuff><ExchangeRequest>.....</ExchangeRequest></<SoapStuff>
>>>>> returns 
>>>>> <SoapStuff><ExchangeResponse>....</ExchangeResponse></SoapStuff>
>>>>>
>>>>> Any ideas where I could start or what I could touch to make this 
>>>>> work?
>>>>>
>>>>> (Hopefully the half-assery that are my code examples; don't 
>>>>> confuse anyone)
>>>>>
>>>>>
>>>>>         
>>
>>   
>

Re: Plain Old Xml over Http

Posted by James Mao <ja...@iona.com>.
> OK, I see now that the trick to getting what I want to work involves
> using the xformat:binding element in my wsdl:bindings.
>
> Does this mean that I can't support both POX and SOAP using the same
> @WebService impl?
>   

Yes, you have to specify the @WebService and also @BindingType determine 
the binding you are using
in case of SOAP1.1 you can omit the annotation, but you have to specify 
the @BindingType for the XML binding and for the SOAP1.2 binding

But it's also possible to configure the cxf.xml to achieve your goal. 
will send you the link if i found the link

Cheers,
James

>
> On 7/30/07, Ray Krueger <ra...@gmail.com> wrote:
>   
>> Was just playing around with the hello_world_xml_bare, the
>> functionality is about what I want. But I'd like to be able to run it
>> in the servlet container, not using that Endpoint.publish stuff.
>>
>> I have a working jaxws endpoint, I would like CXF to handle an
>> incoming xml POST, unmarshall the payload and the object to my Impl
>> just as it does for the soap/jaxws stuff.
>>
>> Simply put, I'd like my clients to be able to do Http POST operations
>> with just the payload xml, no soap:Envelope. I'd like CXF to unmarshal
>> it with jaxb and pass me the object.
>>
>> Maybe the client needs to use a different url for the plain xml vs.
>> the soap message, that's fine. I just don't want to do the
>> unmarshalling myself in a jaxws provider.
>>
>> Make sense?
>>
>>
>>
>> On 7/30/07, James Mao <ja...@iona.com> wrote:
>>     
>>> wsdl2java tools only support the jax-ws frontend, it does not support
>>> the RESTful service, at moment, but we're working on it.
>>>
>>> We have a XML binding in cxf, you can check out the samples
>>> hello_world_xml_bare and hello_world_xml_wrapped,
>>> Don't know if it's what you're looking for?
>>>
>>> James
>>>
>>>       
>>>> I'm loving CXF right now by the way, so thanks for that :)
>>>>
>>>> I'd like to be able to send my current WSDL types over the wire
>>>> without soap envelopes as plain-old-xml via http POST operations.
>>>>
>>>> I started with a WSDL and a pair of Request/Response type objects...
>>>>
>>>> Running wsdl2java generates a perfectly working service with jaxb
>>>> inputs/outputs...
>>>> (summarizing code here, not copy and pasting)
>>>>
>>>> @WebService
>>>> interface CurrencyExchange {
>>>>   @WebResult, @WebMethod
>>>>   ExchangeResponse exchange(@WebParam ExchangeRequest)
>>>> }
>>>>
>>>> Great, all this SOAP stuff works as advertised and that's fantastic.
>>>> I'd like people to be able to use a REST-like url (really, I don't
>>>> care what the url looks like), but not do the auto-magical xml stuff
>>>> that CXF seems to support now in the REST support.
>>>>
>>>> I'd like to use the same schemas I use for the input and output mesage
>>>> types in the wsdl.
>>>>
>>>> via the POX approach...
>>>> http://localhost:8080/CurrencyExchange/exchange
>>>> POST <ExchangeRequest>.....</ExchangeRequest>
>>>> returns <ExchangeResponse>....</ExchangeResponse>
>>>>
>>>> via the SOAP approach...
>>>> http://localhost:8080/CurrencyExchange
>>>> POST <SoapStuff><ExchangeRequest>.....</ExchangeRequest></<SoapStuff>
>>>> returns <SoapStuff><ExchangeResponse>....</ExchangeResponse></SoapStuff>
>>>>
>>>> Any ideas where I could start or what I could touch to make this work?
>>>>
>>>> (Hopefully the half-assery that are my code examples; don't confuse anyone)
>>>>
>>>>
>>>>         
>
>   

Re: Plain Old Xml over Http

Posted by Ray Krueger <ra...@gmail.com>.
OK, I see now that the trick to getting what I want to work involves
using the xformat:binding element in my wsdl:bindings.

Does this mean that I can't support both POX and SOAP using the same
@WebService impl?


On 7/30/07, Ray Krueger <ra...@gmail.com> wrote:
> Was just playing around with the hello_world_xml_bare, the
> functionality is about what I want. But I'd like to be able to run it
> in the servlet container, not using that Endpoint.publish stuff.
>
> I have a working jaxws endpoint, I would like CXF to handle an
> incoming xml POST, unmarshall the payload and the object to my Impl
> just as it does for the soap/jaxws stuff.
>
> Simply put, I'd like my clients to be able to do Http POST operations
> with just the payload xml, no soap:Envelope. I'd like CXF to unmarshal
> it with jaxb and pass me the object.
>
> Maybe the client needs to use a different url for the plain xml vs.
> the soap message, that's fine. I just don't want to do the
> unmarshalling myself in a jaxws provider.
>
> Make sense?
>
>
>
> On 7/30/07, James Mao <ja...@iona.com> wrote:
> > wsdl2java tools only support the jax-ws frontend, it does not support
> > the RESTful service, at moment, but we're working on it.
> >
> > We have a XML binding in cxf, you can check out the samples
> > hello_world_xml_bare and hello_world_xml_wrapped,
> > Don't know if it's what you're looking for?
> >
> > James
> >
> > > I'm loving CXF right now by the way, so thanks for that :)
> > >
> > > I'd like to be able to send my current WSDL types over the wire
> > > without soap envelopes as plain-old-xml via http POST operations.
> > >
> > > I started with a WSDL and a pair of Request/Response type objects...
> > >
> > > Running wsdl2java generates a perfectly working service with jaxb
> > > inputs/outputs...
> > > (summarizing code here, not copy and pasting)
> > >
> > > @WebService
> > > interface CurrencyExchange {
> > >   @WebResult, @WebMethod
> > >   ExchangeResponse exchange(@WebParam ExchangeRequest)
> > > }
> > >
> > > Great, all this SOAP stuff works as advertised and that's fantastic.
> > > I'd like people to be able to use a REST-like url (really, I don't
> > > care what the url looks like), but not do the auto-magical xml stuff
> > > that CXF seems to support now in the REST support.
> > >
> > > I'd like to use the same schemas I use for the input and output mesage
> > > types in the wsdl.
> > >
> > > via the POX approach...
> > > http://localhost:8080/CurrencyExchange/exchange
> > > POST <ExchangeRequest>.....</ExchangeRequest>
> > > returns <ExchangeResponse>....</ExchangeResponse>
> > >
> > > via the SOAP approach...
> > > http://localhost:8080/CurrencyExchange
> > > POST <SoapStuff><ExchangeRequest>.....</ExchangeRequest></<SoapStuff>
> > > returns <SoapStuff><ExchangeResponse>....</ExchangeResponse></SoapStuff>
> > >
> > > Any ideas where I could start or what I could touch to make this work?
> > >
> > > (Hopefully the half-assery that are my code examples; don't confuse anyone)
> > >
> > >
> >
>

Re: Plain Old Xml over Http

Posted by James Mao <ja...@iona.com>.
> Was just playing around with the hello_world_xml_bare, the
> functionality is about what I want. But I'd like to be able to run it
> in the servlet container, not using that Endpoint.publish stuff.
>   

The xml binding do work in the servlet, in the demo, just do this in 
case of tomcat on windows

 > set CATALINA_HOME=Your tomcat home
 > ant war
 > ant deploy -Dtomcat=true     # this will copy all the dependent jars 
to $CATALINA_HOME/shared/lib, if can not find the cxf jars in that directory
                                               # and copy the .war to 
the $CATALINA_HOME/webapps

> I have a working jaxws endpoint, I would like CXF to handle an
> incoming xml POST, unmarshall the payload and the object to my Impl
> just as it does for the soap/jaxws stuff.
>
> Simply put, I'd like my clients to be able to do Http POST operations
> with just the payload xml, no soap:Envelope. I'd like CXF to unmarshal
> it with jaxb and pass me the object.
>
> Maybe the client needs to use a different url for the plain xml vs.
> the soap message, that's fine. I just don't want to do the
> unmarshalling myself in a jaxws provider.
>
> Make sense?
>
>
>
> On 7/30/07, James Mao <ja...@iona.com> wrote:
>   
>> wsdl2java tools only support the jax-ws frontend, it does not support
>> the RESTful service, at moment, but we're working on it.
>>
>> We have a XML binding in cxf, you can check out the samples
>> hello_world_xml_bare and hello_world_xml_wrapped,
>> Don't know if it's what you're looking for?
>>
>> James
>>
>>     
>>> I'm loving CXF right now by the way, so thanks for that :)
>>>
>>> I'd like to be able to send my current WSDL types over the wire
>>> without soap envelopes as plain-old-xml via http POST operations.
>>>
>>> I started with a WSDL and a pair of Request/Response type objects...
>>>
>>> Running wsdl2java generates a perfectly working service with jaxb
>>> inputs/outputs...
>>> (summarizing code here, not copy and pasting)
>>>
>>> @WebService
>>> interface CurrencyExchange {
>>>   @WebResult, @WebMethod
>>>   ExchangeResponse exchange(@WebParam ExchangeRequest)
>>> }
>>>
>>> Great, all this SOAP stuff works as advertised and that's fantastic.
>>> I'd like people to be able to use a REST-like url (really, I don't
>>> care what the url looks like), but not do the auto-magical xml stuff
>>> that CXF seems to support now in the REST support.
>>>
>>> I'd like to use the same schemas I use for the input and output mesage
>>> types in the wsdl.
>>>
>>> via the POX approach...
>>> http://localhost:8080/CurrencyExchange/exchange
>>> POST <ExchangeRequest>.....</ExchangeRequest>
>>> returns <ExchangeResponse>....</ExchangeResponse>
>>>
>>> via the SOAP approach...
>>> http://localhost:8080/CurrencyExchange
>>> POST <SoapStuff><ExchangeRequest>.....</ExchangeRequest></<SoapStuff>
>>> returns <SoapStuff><ExchangeResponse>....</ExchangeResponse></SoapStuff>
>>>
>>> Any ideas where I could start or what I could touch to make this work?
>>>
>>> (Hopefully the half-assery that are my code examples; don't confuse anyone)
>>>
>>>
>>>       
>
>   

Re: Plain Old Xml over Http

Posted by Ray Krueger <ra...@gmail.com>.
Was just playing around with the hello_world_xml_bare, the
functionality is about what I want. But I'd like to be able to run it
in the servlet container, not using that Endpoint.publish stuff.

I have a working jaxws endpoint, I would like CXF to handle an
incoming xml POST, unmarshall the payload and the object to my Impl
just as it does for the soap/jaxws stuff.

Simply put, I'd like my clients to be able to do Http POST operations
with just the payload xml, no soap:Envelope. I'd like CXF to unmarshal
it with jaxb and pass me the object.

Maybe the client needs to use a different url for the plain xml vs.
the soap message, that's fine. I just don't want to do the
unmarshalling myself in a jaxws provider.

Make sense?



On 7/30/07, James Mao <ja...@iona.com> wrote:
> wsdl2java tools only support the jax-ws frontend, it does not support
> the RESTful service, at moment, but we're working on it.
>
> We have a XML binding in cxf, you can check out the samples
> hello_world_xml_bare and hello_world_xml_wrapped,
> Don't know if it's what you're looking for?
>
> James
>
> > I'm loving CXF right now by the way, so thanks for that :)
> >
> > I'd like to be able to send my current WSDL types over the wire
> > without soap envelopes as plain-old-xml via http POST operations.
> >
> > I started with a WSDL and a pair of Request/Response type objects...
> >
> > Running wsdl2java generates a perfectly working service with jaxb
> > inputs/outputs...
> > (summarizing code here, not copy and pasting)
> >
> > @WebService
> > interface CurrencyExchange {
> >   @WebResult, @WebMethod
> >   ExchangeResponse exchange(@WebParam ExchangeRequest)
> > }
> >
> > Great, all this SOAP stuff works as advertised and that's fantastic.
> > I'd like people to be able to use a REST-like url (really, I don't
> > care what the url looks like), but not do the auto-magical xml stuff
> > that CXF seems to support now in the REST support.
> >
> > I'd like to use the same schemas I use for the input and output mesage
> > types in the wsdl.
> >
> > via the POX approach...
> > http://localhost:8080/CurrencyExchange/exchange
> > POST <ExchangeRequest>.....</ExchangeRequest>
> > returns <ExchangeResponse>....</ExchangeResponse>
> >
> > via the SOAP approach...
> > http://localhost:8080/CurrencyExchange
> > POST <SoapStuff><ExchangeRequest>.....</ExchangeRequest></<SoapStuff>
> > returns <SoapStuff><ExchangeResponse>....</ExchangeResponse></SoapStuff>
> >
> > Any ideas where I could start or what I could touch to make this work?
> >
> > (Hopefully the half-assery that are my code examples; don't confuse anyone)
> >
> >
>

Re: Plain Old Xml over Http

Posted by James Mao <ja...@iona.com>.
wsdl2java tools only support the jax-ws frontend, it does not support 
the RESTful service, at moment, but we're working on it.

We have a XML binding in cxf, you can check out the samples 
hello_world_xml_bare and hello_world_xml_wrapped,
Don't know if it's what you're looking for?

James

> I'm loving CXF right now by the way, so thanks for that :)
>
> I'd like to be able to send my current WSDL types over the wire
> without soap envelopes as plain-old-xml via http POST operations.
>
> I started with a WSDL and a pair of Request/Response type objects...
>
> Running wsdl2java generates a perfectly working service with jaxb
> inputs/outputs...
> (summarizing code here, not copy and pasting)
>
> @WebService
> interface CurrencyExchange {
>   @WebResult, @WebMethod
>   ExchangeResponse exchange(@WebParam ExchangeRequest)
> }
>
> Great, all this SOAP stuff works as advertised and that's fantastic.
> I'd like people to be able to use a REST-like url (really, I don't
> care what the url looks like), but not do the auto-magical xml stuff
> that CXF seems to support now in the REST support.
>
> I'd like to use the same schemas I use for the input and output mesage
> types in the wsdl.
>
> via the POX approach...
> http://localhost:8080/CurrencyExchange/exchange
> POST <ExchangeRequest>.....</ExchangeRequest>
> returns <ExchangeResponse>....</ExchangeResponse>
>
> via the SOAP approach...
> http://localhost:8080/CurrencyExchange
> POST <SoapStuff><ExchangeRequest>.....</ExchangeRequest></<SoapStuff>
> returns <SoapStuff><ExchangeResponse>....</ExchangeResponse></SoapStuff>
>
> Any ideas where I could start or what I could touch to make this work?
>
> (Hopefully the half-assery that are my code examples; don't confuse anyone)
>
>   

Re: Plain Old Xml over Http

Posted by Ray Krueger <ra...@gmail.com>.
Sorry...
More specifically, I'd lile to use the Impl, Request, and Response
classes that the wsdl2java toll generated.


On 7/30/07, Ray Krueger <ra...@gmail.com> wrote:
> Yes, that is exactly what I mean.
> Though I'd rather not deal with the payload directly. I'd like for CXF
> to handle the marshaling and unmarshaling still.
>
>
> On 7/30/07, Liu, Jervis <jl...@iona.com> wrote:
> > Hi Ray, What do you mean by "not do the auto-magical xml stuff that CXF
> > seems to support now in the REST support"? Do you mean you want to access
> > the raw xml message payload instead of marshalling the xml into objects?
> If
> > this is the case, you probably want to use the JAX-WS Provider/Dispatch
> > approach:
> >
> http://cwiki.apache.org/CXF20DOC/rest-with-jax-ws-provider-and-dispatch.html
> >
> >
> >
> > Cheers,
> > Jervis
> >
> > -----Original Message-----
> > From: Ray Krueger [mailto:raykrueger@gmail.com]
> > Sent: 2007?7?30? 19:26
> > To: cxf-user@incubator.apache.org
> > Subject: Plain Old Xml over Http
> >
> >
> > I'm loving CXF right now by the way, so thanks for that :)
> >
> > I'd like to be able to send my current WSDL types over the wire
> > without soap envelopes as plain-old-xml via http POST operations.
> >
> > I started with a WSDL and a pair of Request/Response type objects...
> >
> > Running wsdl2java generates a perfectly working service with jaxb
> > inputs/outputs...
> > (summarizing code here, not copy and pasting)
> >
> > @WebService
> > interface CurrencyExchange {
> >   @WebResult, @WebMethod
> >   ExchangeResponse exchange(@WebParam ExchangeRequest)
> > }
> >
> > Great, all this SOAP stuff works as advertised and that's fantastic.
> > I'd like people to be able to use a REST-like url (really, I don't
> > care what the url looks like), but not do the auto-magical xml stuff
> > that CXF seems to support now in the REST support.
> >
> > I'd like to use the same schemas I use for the input and output mesage
> > types in the wsdl.
> >
> > via the POX approach...
> > http://localhost:8080/CurrencyExchange/exchange
> > POST <ExchangeRequest>.....</ExchangeRequest>
> > returns <ExchangeResponse>....</ExchangeResponse>
> >
> > via the SOAP approach...
> > http://localhost:8080/CurrencyExchange
> > POST <SoapStuff><ExchangeRequest>.....</ExchangeRequest></<SoapStuff>
> > returns <SoapStuff><ExchangeResponse>....</ExchangeResponse></SoapStuff>
> >
> > Any ideas where I could start or what I could touch to make this work?
> >
> > (Hopefully the half-assery that are my code examples; don't confuse
> anyone)
> >
> > ----------------------------
> > IONA Technologies PLC (registered in Ireland)
> > Registered Number: 171387
> > Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
> >
>

Re: Plain Old Xml over Http

Posted by Ray Krueger <ra...@gmail.com>.
Yes, that is exactly what I mean.
Though I'd rather not deal with the payload directly. I'd like for CXF
to handle the marshaling and unmarshaling still.


On 7/30/07, Liu, Jervis <jl...@iona.com> wrote:
> Hi Ray, What do you mean by "not do the auto-magical xml stuff that CXF
> seems to support now in the REST support"? Do you mean you want to access
> the raw xml message payload instead of marshalling the xml into objects? If
> this is the case, you probably want to use the JAX-WS Provider/Dispatch
> approach:
> http://cwiki.apache.org/CXF20DOC/rest-with-jax-ws-provider-and-dispatch.html
>
>
>
> Cheers,
> Jervis
>
> -----Original Message-----
> From: Ray Krueger [mailto:raykrueger@gmail.com]
> Sent: 2007?7?30? 19:26
> To: cxf-user@incubator.apache.org
> Subject: Plain Old Xml over Http
>
>
> I'm loving CXF right now by the way, so thanks for that :)
>
> I'd like to be able to send my current WSDL types over the wire
> without soap envelopes as plain-old-xml via http POST operations.
>
> I started with a WSDL and a pair of Request/Response type objects...
>
> Running wsdl2java generates a perfectly working service with jaxb
> inputs/outputs...
> (summarizing code here, not copy and pasting)
>
> @WebService
> interface CurrencyExchange {
>   @WebResult, @WebMethod
>   ExchangeResponse exchange(@WebParam ExchangeRequest)
> }
>
> Great, all this SOAP stuff works as advertised and that's fantastic.
> I'd like people to be able to use a REST-like url (really, I don't
> care what the url looks like), but not do the auto-magical xml stuff
> that CXF seems to support now in the REST support.
>
> I'd like to use the same schemas I use for the input and output mesage
> types in the wsdl.
>
> via the POX approach...
> http://localhost:8080/CurrencyExchange/exchange
> POST <ExchangeRequest>.....</ExchangeRequest>
> returns <ExchangeResponse>....</ExchangeResponse>
>
> via the SOAP approach...
> http://localhost:8080/CurrencyExchange
> POST <SoapStuff><ExchangeRequest>.....</ExchangeRequest></<SoapStuff>
> returns <SoapStuff><ExchangeResponse>....</ExchangeResponse></SoapStuff>
>
> Any ideas where I could start or what I could touch to make this work?
>
> (Hopefully the half-assery that are my code examples; don't confuse anyone)
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>

RE: Plain Old Xml over Http

Posted by "Liu, Jervis" <jl...@iona.com>.
Hi Ray, What do you mean by "not do the auto-magical xml stuff that CXF seems to support now in the REST support"? Do you mean you want to access the raw xml message payload instead of marshalling the xml into objects? If this is the case, you probably want to use the JAX-WS Provider/Dispatch approach: http://cwiki.apache.org/CXF20DOC/rest-with-jax-ws-provider-and-dispatch.html



Cheers,
Jervis

-----Original Message-----
From: Ray Krueger [mailto:raykrueger@gmail.com]
Sent: 2007?7?30? 19:26
To: cxf-user@incubator.apache.org
Subject: Plain Old Xml over Http


I'm loving CXF right now by the way, so thanks for that :)

I'd like to be able to send my current WSDL types over the wire
without soap envelopes as plain-old-xml via http POST operations.

I started with a WSDL and a pair of Request/Response type objects...

Running wsdl2java generates a perfectly working service with jaxb
inputs/outputs...
(summarizing code here, not copy and pasting)

@WebService
interface CurrencyExchange {
  @WebResult, @WebMethod
  ExchangeResponse exchange(@WebParam ExchangeRequest)
}

Great, all this SOAP stuff works as advertised and that's fantastic.
I'd like people to be able to use a REST-like url (really, I don't
care what the url looks like), but not do the auto-magical xml stuff
that CXF seems to support now in the REST support.

I'd like to use the same schemas I use for the input and output mesage
types in the wsdl.

via the POX approach...
http://localhost:8080/CurrencyExchange/exchange
POST <ExchangeRequest>.....</ExchangeRequest>
returns <ExchangeResponse>....</ExchangeResponse>

via the SOAP approach...
http://localhost:8080/CurrencyExchange
POST <SoapStuff><ExchangeRequest>.....</ExchangeRequest></<SoapStuff>
returns <SoapStuff><ExchangeResponse>....</ExchangeResponse></SoapStuff>

Any ideas where I could start or what I could touch to make this work?

(Hopefully the half-assery that are my code examples; don't confuse anyone)

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland