Hi Aditya, Before writing the content to a file , you can use xslt mediator[1] and remove the extra spaces of the payload.
[1] https://docs.wso2.com/display/EI611/XSLT+Transformation+Sample Thanks, Himasha On Tue, Feb 27, 2018 at 4:38 PM, aditya shivankar < [email protected]> wrote: > Respected Sir, > I wrote a dataservice to read data from "Employee" table. > > Consumed that service as a soap(wsdl) service inside my proxy service. > and wrote it in a file using vfs. > > but in output file there are extra spaces coming in each field. > Please guide how to avoid those. > > Current Output : > > <Employees xmlns="http://ws.wso2.org/dataservice"> > <Employee> > <id>1 </id> > <name>John </name> > <salary>10000 </salary> > <address>Helinki </address> > </Employee> > <Employee> > <id>2 </id> > <name>Tim </name> > <salary>20000 </salary> > <address>Washington</address> > </Employee> > </Employees> > > Database Table screenshot: > > [image: Inline image 1] > > dataService : > > <data enableBatchRequests="true" name="ReadEmployeeTable" transports="http > local"> > <config enableOData="false" id="MSSQL_READEMP"> > <property name="carbon_datasource_name">MSSQL</property> > </config> > <query id="ReadEmpQuery" useConfig="MSSQL_READEMP"> > <sql>select id,name,salary,address from dbo.EmployeeData</sql> > <result element="Employees" rowName="Employee"> > <element column="id" name="id" xsdType="string"/> > <element column="name" name="name" xsdType="string"/> > <element column="salary" name="salary" xsdType="string"/> > <element column="address" name="address" xsdType="string"/> > </result> > </query> > <operation name="getEmployeeDetails"> > <call-query href="ReadEmpQuery"/> > </operation> > </data> > > > > proxy service: > > <?xml version="1.0" encoding="UTF-8"?> > <proxy xmlns="http://ws.apache.org/ns/synapse" > name="ReadEmployeeTableProxy" > startOnLoad="true" > statistics="disable" > trace="disable" > transports="http,https"> > <target> > <outSequence> > <property > expression="fn:concat(fn:substring-after(get-property('MessageID'), > 'urn:uuid:'), '.xml')" > name="transport.vfs.ReplyFileName" > scope="transport" > type="STRING"/> > <property name="OUT_ONLY" scope="default" type="STRING" > value="true"/> > <property name="messageType" > scope="axis2" > type="STRING" > value="application/xml"/> > <property action="remove" name="LAST_MODIFIED" scope="transport"/> > <send> > <endpoint> > <address uri="vfs:file:///C:/Flatfile/EmployeeOutput"/> > </endpoint> > </send> > </outSequence> > <endpoint> > <wsdl port="SOAP12Endpoint" > service="ReadEmployeeTable" > uri="http://localhost:8285/services/ReadEmployeeTable?wsdl > "/> > </endpoint> > </target> > <publishWSDL uri="http://localhost:8285/services/ReadEmployeeTable?wsdl > "/> > <description/> > </proxy> > > With Regards, > Aditya > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Himasha Guruge Senior Software Engineer WS*O2* *Inc.* Mobile: +94 777459299 [email protected]
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
