You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Борисов Вячеслав Владимирович <sl...@bystrobank.ru> on 2015/08/24 13:33:59 UTC
JAXRSClientFactory and "untyped" application/xml
Hi All!
I have web-service which accepts any application/xml
<request>
<param name="xml" type="xsd:string" style="query"/>
<param name="xsd" type="xsd:string" style="query"/>
<param name="xsl" type="xsd:string" style="query"/>
<representation mediaType="application/xml"/>
</request>
Can I describe it using java-interface which is acceptable by JAXRSClientFactory to create proxy?
I know that interfaces with jaxb-beans as params works without problem, they are simply serialized to application/xml and posted.
But is there possibility to do it with String, XMLSource or any other type, not jaxb bean ?
Re: JAXRSClientFactory and "untyped" application/xml
Posted by Борисов Вячеслав Владимирович <sl...@bystrobank.ru>.
On Понедельник 24 Август 2015 18:21 SAMT, Sergey Beryozkin <sb...@gmail.com> wrote:
> Hi
>
> You can use InputStream and process it internally as required.
> Or may be you can introduce a custom type, say AnyXmlType, that will
> have methods such as
> .asInputStream(), asType(Class), etc
>
> and support this type by a custom MessageBodyReader/Writer
Thanks Sergey, i added <extraarg>-repMap</extraarg>
<extraarg>application/xml=java.io.InputStream</extraarg>
and its worked for bout request and response
Re: JAXRSClientFactory and "untyped" application/xml
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
You can use InputStream and process it internally as required.
Or may be you can introduce a custom type, say AnyXmlType, that will
have methods such as
.asInputStream(), asType(Class), etc
and support this type by a custom MessageBodyReader/Writer
Sergey
On 24/08/15 12:33, Борисов Вячеслав Владимирович wrote:
> Hi All!
>
> I have web-service which accepts any application/xml
>
> <request>
> <param name="xml" type="xsd:string" style="query"/>
> <param name="xsd" type="xsd:string" style="query"/>
> <param name="xsl" type="xsd:string" style="query"/>
> <representation mediaType="application/xml"/>
> </request>
>
>
>
> Can I describe it using java-interface which is acceptable by JAXRSClientFactory to create proxy?
> I know that interfaces with jaxb-beans as params works without problem, they are simply serialized to application/xml and posted.
>
> But is there possibility to do it with String, XMLSource or any other type, not jaxb bean ?
>