axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From li roger <rogerjaso...@gmail.com>
Subject Re: How to disable SOAP wraper?
Date Wed, 11 Jan 2012 06:26:41 GMT
Thanks for your answer !

I've tried REST  in axis2 ,There are some new problems,axis2 replace "<" to
"&lt;" in reponse xml ,that may cause the response xml can't be resolved in
ajax,so what can I
 do to deal with this problems.

My test REST URL is
http://127.0.0.1:8080/axis2/services/DataStationService/call?xml=<root>

response is :

<axis2ns5:call xmlns:axis2ns5="http://lxz.power/DataStation/xsd">
       <xml>&lt;root></xml>
</axis2ns5:call>




  related config in axis2.xml is:

 <!-- Following parameter will completely disable REST handling in Axis2-->
    <parameter name="disableREST" locked="false">false</parameter>

I haven't change the default REST config in axis2.xml,My service method is:
--------------------------------------------------------------------------------------------------------------
private static Log log = LogFactory.getLog(DataStation.class);
    public OMElement call(OMElement  xml){

        xml.build();
        xml.detach();

        log.info("Request XML:");
        log.info(xml.toString());

        log.info("Response XML:");
        log.info(xml.toString());
        return xml;
    }
-------------------------------------------------------------------------------------------------

my service.xml

<service name="DataStationService" scope="request" targetNamespace="
http://lxz.power/DataStation/">
    <description>
        M3 DataStation Service
    </description>
     <messageReceivers>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"

class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"

class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
    </messageReceivers>
    <module ref="logging"/>
    <schema schemaNamespace="http://lxz.power/DataStation/xsd"/>
    <parameter name="ServiceClass">com.m3.exchange.DataStation</parameter>
    <operation name="call">
        <messageReceiver
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
        <actionMapping>urn:call</actionMapping>
    </operation>
</service>
--------------------------------------------------------------------------------------------------

How to stop "<" replace in axis2 ?

Regards

roger



On Sun, Dec 25, 2011 at 6:29 PM, Sagara Gunathunga <
sagara.gunathunga@gmail.com> wrote:

> First you have to enable REST in  server side then if you send raw XML
> message Axis2 will return raw XML response message [1].
>
> [1] -http://axis.apache.org/axis2/java/core/docs/rest-ws.html
>
> Thanks !
>
> On Sat, Dec 24, 2011 at 7:42 AM, rogerjasonli <rogerjasonli@gmail.com>wrote:
>
>> **
>>  hi,guys
>> I used axis1 before,now ,use axis2 in new project ,we need transport raw
>> XML without SOAP wraper for some reason,the XML like this:
>>  <root>
>>         <user>
>>            <name>jason</name>
>>            <passwd>9e3uc</passed>
>>         </user>
>>         ....
>>  </root>
>> Is there has any way to do this in AXIS2?
>> thanks !
>>
>> ------------------------------
>> rogerjasonli
>>
>
>
>
> --
> Sagara Gunathunga
>
> Blog      - http://ssagara.blogspot.com
> Web      - http://people.apache.org/~sagara/
> LinkedIn - http://www.linkedin.com/in/ssagara
>

Mime
View raw message