Apex type not found for element : userDetails - salesforce

I m getting the following response from the webservice
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><GetUserResponse xmlns="urn:wwservice"><userDetails xmlns="">Successfully write a web service hurray</userDetails></GetUserResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
But I getting Apex type not found for element : userDetails
Here's my wsdl file
<?xml version="1.0" encoding="ISO-8859-1"?>
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:wwservice" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:wwservice">
<types>
<xsd:schema elementFormDefault="qualified" targetNamespace="urn:wwservice">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
<xsd:complexType name="GetUserRequestType">
<xsd:all>
<xsd:element name="Username" type="xsd:string" form="unqualified"/>
<xsd:element name="Password" type="xsd:string" form="unqualified"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="GetUserResponseType">
<xsd:all>
<xsd:element name="userDetails" type="xsd:string" form="unqualified"/>
</xsd:all>
</xsd:complexType>
<xsd:element name="GetUser" type="tns:GetUserRequestType"/>
<xsd:element name="GetUserResponse" type="tns:GetUserResponseType"/>
</xsd:schema>
</types>
<message name="GetUserRequest">
<part name="parameters" element="tns:GetUser"/></message>
<message name="GetUserResponse">
<part name="parameters" element="tns:GetUserResponse"/></message>
<portType name="PsocialPortType">
<operation name="GetUser">
<input message="tns:GetUserRequest"/>
<output message="tns:GetUserResponse"/>
</operation>
</portType>
<binding name="PsocialBinding" type="tns:PsocialPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="GetUser">
<soap:operation soapAction="urn:wwservice#GetUser" style="document"/>
<input><soap:body use="literal" namespace="urn:wwservice"/></input>
<output><soap:body use="literal" namespace="urn:wwservice"/></output>
</operation>
</binding>
<service name="Psocial">
<port name="PsocialPort" binding="tns:PsocialBinding">
<soap:address location="http://example.com/webservice/wwservice.php"/>
</port>
</service>
</definitions>
Please let me know where i getting wrong
I m using this to create WSDL
$server = new soap_server();
// Changed for coupons data start
$server->soap_defencoding = 'UTF-8';
$server->decode_utf8 = false;
// Changed for coupons data end
//$server->configureWSDL('m-way', 'urn:wwservice');
$server->configureWSDL('Psocial', 'urn:wwservice',false,'document');
// New function for spiff
$server->register("GetUser",
array('Username'=>'xsd:string','Password'=>'xsd:string'),
array('userDetails'=>'xsd:string'),
'urn:wwservice',
'urn:wwservice#GetUser', 'document', 'literal'
);
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)? $HTTP_RAW_POST_DATA : file_get_contents('php://input');
$server->service($HTTP_RAW_POST_DATA);

The problem is that the SOAP response you get doesn't match the description of it in the WSDL, the WSDL has elementFormDefault="qualified" for the schema, which says that child element would be in the namespace, e.g. its saying the response should be
<GetUserResponse xmlns="urn:wwservice">
<userDetails>Hello</userDetails>
</GetUserResponse>
but the actual response you get has
<GetUserResponse xmlns="urn:wwservice">
<userDetails xmlns="">Successfully write a web service hurray</userDetails>
</GetUserResponse>
Note how the namespace for the userDetails element is different. You should either update the WSDL to say elementForDefault="unqualified" or update the web service to return the correct namespace on the userDetails element.

Related

How do I form an Amazon FBA CartonContentsRequest XML with more than one SKU per carton

I am using the SubmitFeed _POST_FBA_INBOUND_CARTON_CONTENTS_ from Amazon's Feeds Api. I submit this XML doc. I have used this call successfully for simple cases where there is just one SKU per carton. This shipment I want to have three SKUs per carton. The order in sellercentral shows all the correct dimension and weight data but has it as three cartons, not one, even though I submitted only one carton id.
<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>**************</MerchantIdentifier>
</Header>
<MessageType>CartonContentsRequest</MessageType>
<Message>
<MessageID>1</MessageID>
<CartonContentsRequest>
<ShipmentId>FBA******S2F</ShipmentId>
<NumCartons>1</NumCartons>
<Carton>
<CartonId>55172</CartonId>
<Item>
<SKU>SKU-ABC</SKU>
<QuantityShipped>48</QuantityShipped>
<QuantityInCase>24</QuantityInCase>
</Item>
<Item>
<SKU>SKU-DEF</SKU>
<QuantityShipped>48</QuantityShipped>
<QuantityInCase>24</QuantityInCase>
</Item>
<Item>
<SKU>SKU-XYZ</SKU>
<QuantityShipped>72</QuantityShipped>
<QuantityInCase>24</QuantityInCase>
</Item>
</Carton>
</CartonContentsRequest>
</Message>
</AmazonEnvelope>
The XSD file is here
https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/CartonContentsRequest.xsd
<?xml version="1.0"?>
<!-- Revision="$Revision: #3 $" -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<!--
$Date: 2006/11/21 $
AMAZON.COM CONFIDENTIAL. This document and the information contained in it are
confidential and proprietary information of Amazon.com and may not be reproduced,
distributed or used, in whole or in part, for any purpose other than as necessary
to list products for sale on the www.amazon.com web site pursuant to an agreement
with Amazon.com.
-->
<xsd:include schemaLocation="amzn-base.xsd"/>
<xsd:element name="CartonContentsRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ShipmentId">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="FBA[A-Z0-9]+" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="NumCartons" type="xsd:positiveInteger" />
<xsd:element name="Carton" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="CartonId">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[a-zA-Z0-9]+" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Item" maxOccurs="200">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="SKU"/>
<xsd:element name="QuantityShipped" type="xsd:positiveInteger" />
<xsd:element name="QuantityInCase" type="xsd:positiveInteger" default="1"/>
<xsd:element name="ExpirationDate" type="xsd:date" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
It turns out my problem was elsewhere so you can safely assume the XML I posted here is valid.

how to deploy apachel cxf to websphere application server

i created a sample apache cxf SOAP webservices, following the tutorial here
i'm able to run on tomcat 9 via eclipse neon and access it at http://localhost:8080/camel-example-reportincident/webservices/incident?wsdl.
i installed and started it on websphere, but i can't access it on the same url. i also tried all other ports listed in default host alias.
my maven libraries:
here is my wsdl:
<?xml version="1.0" encoding="ISO-8859-1"?> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://reportincident.example.camel.apache.org" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://reportincident.example.camel.apache.org">
<!-- Type definitions for input- and output parameters for webservice
--> <wsdl:types> <xs:schema targetNamespace="http://reportincident.example.camel.apache.org"> <xs:element name="inputReportIncident">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="incidentId" />
<xs:element type="xs:string" name="incidentDate" />
<xs:element type="xs:string" name="givenName" />
<xs:element type="xs:string" name="familyName" />
<xs:element type="xs:string" name="summary" />
<xs:element type="xs:string" name="details" />
<xs:element type="xs:string" name="email" />
<xs:element type="xs:string" name="phone" />
</xs:sequence>
</xs:complexType> </xs:element> <xs:element name="outputReportIncident">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="code" />
</xs:sequence>
</xs:complexType> </xs:element> </xs:schema> </wsdl:types>
<!-- Message definitions for input and output --> <wsdl:message name="inputReportIncident"> <wsdl:part name="parameters" element="tns:inputReportIncident" /> </wsdl:message> <wsdl:message name="outputReportIncident"> <wsdl:part name="parameters" element="tns:outputReportIncident" /> </wsdl:message>
<!-- Port (interface) definitions --> <wsdl:portType name="ReportIncidentEndpoint"> <wsdl:operation name="ReportIncident"> <wsdl:input message="tns:inputReportIncident" /> <wsdl:output message="tns:outputReportIncident" /> </wsdl:operation> </wsdl:portType>
<!-- Port bindings to transports and encoding - HTTP, document literal encoding is used --> <wsdl:binding name="ReportIncidentBinding" type="tns:ReportIncidentEndpoint"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="ReportIncident"> <soap:operation
soapAction="http://reportincident.example.camel.apache.org/ReportIncident"
style="document" /> <wsdl:input>
<soap:body parts="parameters" use="literal" /> </wsdl:input> <wsdl:output>
<soap:body parts="parameters" use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding>
<!-- Service definition --> <wsdl:service name="ReportIncidentService"> <wsdl:port name="ReportIncidentPort" binding="tns:ReportIncidentBinding"> <soap:address location="http://reportincident.example.camel.apache.org" /> </wsdl:port> </wsdl:service>
</wsdl:definitions>
here is my ibm-web-bnd.xml:
<?xml version="1.0" encoding="UTF-8"?> <web-bnd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://websphere.ibm.com/xml/ns/javaee"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-bnd_1_0.xsd" version="1.0"> <virtual-host name="default_host"/> </web-bnd>
here is my cxf-config.xml:
<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" />
<!-- implementation of the webservice -->
<bean id="reportIncidentEndpoint"
class="org.apache.camel.example.reportincident.impl.ReportIncidentEndpointImpl" />
<!-- export the webservice using jaxws -->
<jaxws:endpoint id="reportIncident" implementor="#reportIncidentEndpoint"
address="/incident" wsdlLocation="/WEB-INF/wsdl/report_incident.wsdl"
endpointName="s:ReportIncidentPort" serviceName="s:ReportIncidentService"
xmlns:s="http://reportincident.example.camel.apache.org" />
</beans>
here is my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Archetype Created Web Application</display-name>
<!-- the listener that kick-starts Spring -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- CXF servlet -->
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- all our webservices are mapped under this URI pattern -->
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/webservices/*</url-pattern>
</servlet-mapping>
<!-- location of spring xml files -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:cxf-config.xml</param-value>
</context-param>
</web-app>
====================
Update
strangely, the last update for SystemOut.log and SystemErr.log were two days ago. i found some logs in C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\ffdc
logs:
FFDC Exception:org.springframework.beans.factory.BeanCreationException SourceId:com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated ProbeId:1341 Reporter:com.ibm.ws.webcontainer.webapp.WebAppImpl#bdd2e142
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cxf' defined in class path resource [META-INF/cxf/cxf.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.bus.spring.SpringBus]: Constructor threw exception; nested exception is org.apache.cxf.bus.extension.ExtensionException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1039)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:985)
.....
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.bus.spring.SpringBus]: Constructor threw exception; nested exception is org.apache.cxf.bus.extension.ExtensionException
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1032)
Caused by: java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=org/apache/camel/component/cxf/transport/CamelTransportFactory, offset=6
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:273)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:74)
com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\ffdc\server1_24638c34_17.05.05_01.11.23.0597458986526819616127.txt com.ibm.ws.webcontainer.servlet.ServletInstance.init 181
com.ibm.ws.webcontainer.VirtualHostImpl addWebApplication SRVE0250I: Web Module Archetype Created Web Application has been bound to default_host[*:9080,*:80,*:9443,*:5060,*:5061,*:443].
WSVR0221I: Application started: camel-example-reportincident_war
WSVR0191I: Composition unit WebSphere:cuname=camel-example-reportincident_war in BLA WebSphere:blaname=camel-example-reportincident_war started.
An UnsupportedClassVersionError means that the class (in this case, CamelTransportFactory) was compiled against a higher level of Java than the JVM that you're running on. If you have a version of WebSphere that supports higher Java spec levels, you'll need to pick up a higher-level JDK; if not, then you'll need a version of the Camel package that supports Java 6.

Error Calling a WSDL service from angularjs using soapclient.js and angular.soap.js

I want to call wsdl service (created by dataflux data management studio )from my angular application.
I had already referred to the post
1) AngularJS - SOAP Service Integration With AngularJS Model
2) Simplest SOAP example
3) How to consume a SOAP WebService with AngularJS?
I am using soapclient.js and angular.soap.js
It is giving this error:
Uncaught TypeError: Cannot read property 'constructor' of null
soapCallback # angular.soap.js:16
SOAPClient._onSendSoapRequest # soapclient.js:214
xmlHttp.onreadystatechange # soapclient.js:187
My code in controller:
$scope.getData = function(){
soapService.DMService().then(function(response){
$scope.response = response;
});
}
In app.js,
app.factory("soapService", ['$soap',function($soap){
var base_url = "http://myserver:9000/WSDL_Web_Service/service__DashBoard.WSDL";
return {
DMService: function(){
return $soap.post(base_url,"procsvc_service__DashBoard.djf");
}
}
}]);
My wsdl service : service__Dashboard.WSDL
`
<?xml version="1.0"?>
<definitions name="DMService"
targetNamespace="http://archserver.wsdl.dataflux.com"
xmlns:tns="http://archserver.wsdl.dataflux.com"
xmlns:archxsd="archserver.xsd.dataflux.com"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema
targetNamespace="archserver.xsd.dataflux.com"
xmlns:tns="archserver.xsd.dataflux.com"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<complexType name="request">
<sequence>
</sequence>
</complexType>
<element name="procsvc_service__DashBoard.djf_in" type="tns:request"/>
<complexType name="response">
<sequence>
<element name="result" type="xsd:string" minOccurs="0" maxOccurs="1"/>
</sequence>
</complexType>
<element name="procsvc_service__DashBoard.djf_out" type="tns:response"/>
</schema>
</types>
<message name="procsvc_service__DashBoard.djf_in">
<part name="body" element="archxsd:procsvc_service__DashBoard.djf_in"/>
</message>
<message name="procsvc_service__DashBoard.djf_out">
<part name="body" element="archxsd:procsvc_service__DashBoard.djf_out"/>
</message>
<portType name="DataManagementServicePortType">
<operation name="procsvc_service__DashBoard.djf_in">
<documentation></documentation>
<input message="tns:procsvc_service__DashBoard.djf_in"/>
<output message="tns:procsvc_service__DashBoard.djf_out"/>
</operation>
</portType>
<binding name="DataManagementService" type="tns:DataManagementServicePortType">
<SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="procsvc_service__DashBoard.djf_in">
<SOAP:operation soapAction="service__DashBoard.djf*1*57195B25CE0B6D37"/>
<input>
<SOAP:body use="literal"/>
</input>
<output>
<SOAP:body use="literal"/>
</output>
</operation>
</binding>
<service name="DMService">
<documentation>Data Management Server</documentation>
<port name="DMService" binding="tns:DataManagementService">
<SOAP:address location="http://someserver:21000"/>
</port>
</service>
</definitions> `
changes in soapclient.js (in method SOAPClient._onSendSoapRequest on line 201 ):
var nd = SOAPClient._getElementsByTagName(req.responseXML, method + **"_in"**);
if(nd.length == 0)
nd = SOAPClient._getElementsByTagName(req.responseXML, "return");
I feel, I might be calling the wsdl method in wrong way, but not able to figure out how it should be. If anybody can throw more light on how it should be done...it would be great
Thanks...

XSD for two complex types

I am using File adapter (SOA 11.1.1.1.7) to read the content of a file and the file looks like this
a|b|c|d|e
a|b|c|d|e
a|b|c|d|e
a|b|c|d|e
a|b|c|d|e
Total no of rows 5
For reading this , I need to create a xsd.My problem lies in the last line (
Total no of rows 5). Guys could you please help me in creating the xsd.My current xsd looks like this..which is not working. Please help
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
xmlns:tns="http://TargetNamespace.com/File_Outbound_Ref"
targetNamespace="http://TargetNamespace.com/File_Outbound_Ref"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
nxsd:version="NXSD"
nxsd:stream="chars"
nxsd:encoding="US-ASCII"
nxsd:hasHeader="true"
nxsd:headerLines="1"
nxsd:headerLinesTerminatedBy="${eol}"
>
<xsd:element name="Root-Element">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Data_Details" type="tns:DataReport" nxsd:style="array" />
<xsd:element name="Trailor_Details" type="tns:Trailor_Record" nxsd:style="array" nxsd:cellSeparatedBy="${eol}" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="DataReport">
<xsd:sequence>
<xsd:element name="a" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy=""" />
<xsd:element name="b" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy=""" />
<xsd:element name="c" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy=""" />
<xsd:element name="d" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy=""" />
<xsd:element name="e" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy=""" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Trailor_Record"> <xsd:sequence>
<xsd:element name="Row_Count" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" />
</xsd:sequence>
</xsd:complexType>
In Read file action, under "Configure Operation" we have "Remove Trailer" option and enable it and mention the number of row. So in your case you need one last row to remove so mention 1.

How to link a soap request and response in mule 3

I need to send a file to a external web service. When the response is 1, the file should be deleted, else the file should be kept.
I use the file connector to send the file, and insert a record into Oracle. When the file is sent out, the key is the message id of the file connect. I want to keep the message id so that I can update the record using this id when the response is back.
I tried to use MessagePropertiesTransformer to add a custom property, but the response doesn't preserve it. Is there any way to keep the message id?
My config:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/3.1/mule-stdio.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/3.1/mule-cxf.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/3.1/mule-jdbc.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.1/mule-xml.xsd
">
<spring:bean id="jdbcDataSource" class="org.enhydra.jdbc.standard.StandardDataSource" destroy-method="shutdown">
<spring:property name="driverName" value="oracle.jdbc.driver.OracleDriver"/>
<spring:property name="url" value="jdbc:oracle:thin:user/pass#ip:1521:orcl"/>
</spring:bean>
<file:connector name="output" outputAppend="true" outputPattern="#[function:datestamp]-#[header:originalFilename]" />
<file:connector name="input" streaming="false" recursive="true" autoDelete="false">
<service-overrides messageFactory="org.mule.transport.file.FileMuleMessageFactory" />
</file:connector>
<jdbc:connector name="jdbcConnector" pollingFrequency="10000" dataSource-ref="jdbcDataSource">
<jdbc:query key="outboundInsertStatement"
value="INSERT INTO TEST_MESSAGE (message_id, filename, done) VALUES (#[message:id],
#[header:originalFilename], #[string:0])"/>
</jdbc:connector>
<mulexml:namespace-manager includeConfigNamespaces="true">
<mulexml:namespace prefix="ns1" uri="http://www.iec.ch/TC57/2008/schema/message"/>
<mulexml:namespace prefix="soapenv" uri="http://schemas.xmlsoap.org/soap/envelope/"/>
<mulexml:namespace prefix="ns1" uri="http://www.iec.ch/TC57/2008/schema/message"/>
<mulexml:namespace prefix="fullmodel" uri="iesb.dongfang.com"/>
</mulexml:namespace-manager>
<flow name="fileTestFlow1">
<file:inbound-endpoint path="D:/data/in" moveToDirectory="D:/data/out" moveToPattern="#[message:id]-#[header:originalFilename]" connector-ref="input"/>
<component class="com.component.FileNameExtract"/>
<message-properties-transformer scope="outbound">
<add-message-property key="test" value="#[message:id]"/>
</message-properties-transformer>
<jdbc:outbound-endpoint queryKey="outboundInsertStatement"/>
<cxf:jaxws-client
clientClass="com.ws.IESBService"
port="IESBServiceEndpoint"
wsdlLocation="classpath:IESBService.wsdl"
operation="requestInfo"/>
<outbound-endpoint address="http://ip:8888/axis2/services/iESBService/" exchange-pattern="request-response">
</outbound-endpoint>
<xml-entity-decoder-transformer/>
<logger message=" #[header:test] !" level="INFO"></logger>
</flow>
</mule>
UPDATE:
I tried "session" scope and I think it works. New config:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/3.1/mule-stdio.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/3.1/mule-cxf.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/3.1/mule-jdbc.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.1/mule-xml.xsd
">
<spring:bean id="jdbcDataSource" class="org.enhydra.jdbc.standard.StandardDataSource" destroy-method="shutdown">
<spring:property name="driverName" value="oracle.jdbc.driver.OracleDriver"/>
<spring:property name="url" value="jdbc:oracle:thin:user/pass#ip:1521:orcl"/>
</spring:bean>
<file:connector name="output" outputAppend="true" outputPattern="#[function:datestamp]-#[header:originalFilename]" />
<file:connector name="input" streaming="false" recursive="true" autoDelete="false">
<service-overrides messageFactory="org.mule.transport.file.FileMuleMessageFactory" />
</file:connector>
<jdbc:connector name="jdbcConnector" pollingFrequency="10000" dataSource-ref="jdbcDataSource">
<jdbc:query key="outboundInsertStatement"
value="INSERT INTO TEST_MESSAGE (message_id, filename, done) VALUES (#[message:id],
#[header:originalFilename], #[string:0])"/>
<jdbc:query key="outboundUpdateStatement"
value="update TEST_MESSAGE set done='1' where message_id=#[header:SESSION:test] "/>
</jdbc:connector>
<mulexml:namespace-manager includeConfigNamespaces="true">
<mulexml:namespace prefix="ns1" uri="http://www.iec.ch/TC57/2008/schema/message"/>
<mulexml:namespace prefix="soapenv" uri="http://schemas.xmlsoap.org/soap/envelope/"/>
<mulexml:namespace prefix="ns1" uri="http://www.iec.ch/TC57/2008/schema/message"/>
<mulexml:namespace prefix="fullmodel" uri="iesb.dongfang.com"/>
</mulexml:namespace-manager>
<flow name="fileTestFlow1">
<file:inbound-endpoint path="D:/data/in" moveToDirectory="D:/data/out" moveToPattern="#[message:id]-#[header:originalFilename]" connector-ref="input"/>
<component class="com.component.FileNameExtract"/>
<message-properties-transformer scope="outbound">
<add-message-property key="test" value="#[message:id]"/>
</message-properties-transformer>
<logger message="first #[message:id] " level="INFO"></logger>
<jdbc:outbound-endpoint queryKey="outboundInsertStatement"/>
<cxf:jaxws-client
clientClass="com.ws.IESBService"
port="IESBServiceEndpoint"
wsdlLocation="classpath:IESBService.wsdl"
operation="requestInfo"/>
<outbound-endpoint address="http://ip:8888/axis2/services/iESBService/" exchange-pattern="request-response">
</outbound-endpoint>
<xml-entity-decoder-transformer/>
<jdbc:outbound-endpoint queryKey="outboundUpdateStatement"/>
<logger message="second #[header:SESSION:test] " level="INFO"></logger>
</flow>
</mule>
When I copy the file one by one, it's ok, but when I copy more than five files to the directory, some records can't be updated.
Executing SQL statement: 0 row(s) updated
Set your JDBC outbound endpoint to request-response in order to ensure the flow will execute in a single thread. With your current configuration, the 2 in-only JDBC requests are "detached" from the flow and executed in parallel from it.

Resources