I am using postman to post a SOAP message to a target URL https://testacig.ariba.com/cxf/receiveERPMD. below is the payload
<?xml version="1.0"?>
<n0:MasterDataReplReqMsg xmlns:prx="urn:sap.com:proxy:DD2:/1SAI/TASD374B56E2305E7E70622:754" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:n0="http://sap.com/xi/ARBCIG1">
<Header>
<Parameters>
<Parameter name="UUID">
<value>005056893BDD1EDB88E738052AFE58D8</value>
</Parameter>
<Parameter name="realm">
<value>relamname</value>
</Parameter>
<Parameter name="fullload">
<value>true</value>
</Parameter>
<Parameter name="event">
<value>Import External System Master Data</value>
</Parameter>
<Parameter name="clienttype">
<value>DirectConnect</value>
</Parameter>
<Parameter name="clientversion">
<value>Addon- Direct Connectivity</value>
</Parameter>
<Parameter name="clientinfo">
<value>10.242.99.33-nbaps492</value>
</Parameter>
<Parameter name="operation">
<Parameter name="systemId">
<value>DECLNT111</value>
</Parameter>
<Parameter name="Solution">
<Parameter name="SystemId">
<value>DECLNT111</value>
</Parameter>
</Parameters>
<AttachmentFolder fileName="processing20201110104659_1.zip" contentType="application/zip" contentLength="" contentID="FOL33000000000004EXT39000000000138">
<Content xmlns="">UEsDBBQAAAAIAN5ValFIb/vgcAAAAIgAAAAOAAAASXRlbU1hc3Rlci5jc3YLDXHTteDyTSxJLcpMzPErzU1KLdKBcUMqC1LhHPei/NICHafE4tTQvMyS/DTf1MTi0qJUHf+ilNQikJBOcmlxSX6uW2ZqTgqXkrOHroGhroGRko6Sm2tQCJDyMTAwBlIBzq5AEoggysMSc0pTlbgAUEsDBBQAAAAIAN5ValHkI36wfAAAAJEAAAAdAAAASXRlbU1hc3RlckRlc2NyaXB0aW9uTGFuZy5jc3ZVjTsOwjAQBXufwnJtSwkVNUkgBaTh06/xyrK0WUfrWFwfU9I9aWb0no+zO6ob7CgJaKmrR7EjlrekbU+Z7RU4VoiozDC7rnfdwVhzAY9UdtgIRZ</Content>
</AttachmentFolder>
</Header>
</n0:MasterDataReplReqMsg>
when do POST request I get below error message and status code as 500
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:VersionMismatch</faultcode>
<faultstring>"http://sap.com/xi/ARBCIG1", the namespace on the "MasterDataReplReqMsg" element, is not a valid SOAP version.</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
what could be the reason ?
You will need to wrap your payload in a SOAP envelope. Something like this:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<n0:MasterDataReplReqMsg ...>
...
</n0:MasterDataReplReqMsg>
</soap:Body>
</soap:Envelope>
Related
I am trying to get data from a webservice to put in a SSRS report.
Here is a dataset that works with a simple string parameter (The parameter is set in dataset properties):
<Query xmlns="http://tempuri.org/">
<Method Name="ValidateUserWSToken" Namespace="http://tempuri.org/" />
<SoapAction>http://tempuri.org/WSTokenService/ValidateUserWSToken</SoapAction>
</Query>
Here is a similar method that expects a complextype for it's parameter
<Query>
<Method Name="GetUserWSToken" Namespace="http://tempuri.org/"/>
<SoapAction>http://tempuri.org/WSTokenService/GetUserWSToken</SoapAction>
</Query>
Putting the parameter in the dataset properties as
<UserName>username</UserName><Password>password</Password>
gives the error "There was an error trying to deserialize parameter http://tempuri.org/:request. The InnerException message was 'Error in line 5 position 20. Expected state 'Element'.. Encountered "text" with name '', namespace ''.'.". I don't think setting this in dataset properties will work.
I have tried variations on the following to try to put the parameter in the query text
<Query>
<Method Name="GetUserWSToken" Namespace="http://tempuri.org/" />
<SoapAction>http://tempuri.org/WSTokenService/GetUserWSToken</SoapAction>
<Parameters>
<Parameter Name="request" type="xml">
<DefaultValue xmlns:a="some namespace">
<a:Password>password</a:Password>
<a:UserName>username</a:UserName>
</DefaultValue>
</Parameter>
</Parameters>
</Query>
but these all fail with a 500 error - "Object reference not set to an instance of an object.", presumably because the webservice is not finding the parameter or finding it is null.
Here is the XML that SoapUI produces (and works)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:civ="some namespace">
<soapenv:Header/>
<soapenv:Body>
<tem:GetUserWSToken>
<!--Optional:-->
<tem:request>
<civ:Password>password</civ:Password>
<civ:UserName>username</civ:UserName>
</tem:request>
</tem:GetUserWSToken>
</soapenv:Body>
</soapenv:Envelope>
Can this be converted into something I can use in SSRS query text?
This works:
<Query>
<Method Name="GetUserWSToken" Namespace="http://tempuri.org/">
<Parameters>
<Parameter Name="request" Type="XML" xmlns="some namespace">
<DefaultValue>
<Password>password</Password>
<UserName>username</UserName>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
<SoapAction>http://tempuri.org/WSTokenService/GetUserWSToken</SoapAction>
<ElementPath IgnoreNamespaces="true">*</ElementPath>
</Query>
and this is what it is converted to:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetUserWSToken xmlns="http://tempuri.org/">
<request><Password xmlns="some namespace">Password123</Password><UserName xmlns="some namespace">FifeIntegrationUser</UserName></request>
</GetUserWSToken>
</soap:Body>
</soap:Envelope>
Please someone could help. I have a set of data as csv(from excel multiple sheets i have formed csv)just i want to insert those data into multiple table depends the sheets of an excel.
please help me to sort out my issues.
I expected those csv in each iteration to form xml.
First, we can build the XML from CSV data and iterate through the XML. Please find a sample config below. In this sample, it will pick the CSV files from the source directory and process.
Smooks Config:
<?xml version="1.0"?>
<smooks-resource-list
xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.2.xsd">
<resource-config selector="org.xml.sax.driver">
<resource>org.milyn.csv.CSVReader</resource>
<param name="fields">firstname,lastname,gender,age,country</param>
<param name="rootElementName">people</param>
<param name="recordElementName">person</param>
</resource-config>
</smooks-resource-list>
Proxy:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="CSVToXML"
transports="https,http,vfs"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<smooks config-key="conf:/repository/smooks-config.xml">
<input type="text"/>
<output type="xml"/>
</smooks>
<!-- Here iterate through the XML -->
</inSequence>
<outSequence/>
</target>
<parameter name="transport.PollInterval">1000</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="Operation">urn:placeOrder</parameter>
<parameter name="transport.vfs.FileURI">file://<SOURCE_DIR></parameter>
<parameter name="transport.vfs.MoveAfterProcess">file://<PROCESSED_FILES_DIR></parameter>
<parameter name="transport.vfs.MoveAfterFailure">file://<FAILED_FILES_DIR></parameter>
<parameter name="transport.vfs.FileNamePattern">.*\.csv</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
<description/>
</proxy>
References:
1. https://docs.wso2.com/display/EI640/VFS+Transport
2. https://docs.wso2.com/display/EI640/Smooks+Mediator
3. https://docs.wso2.com/display/EI640/Iterate+Mediator
I'm using WSO2 ESB to process files: an inbound-endpoint with polling, detect a file and pass it to a sequence. That sequence read the file and process records (writing to database).
My question is about processing multiple files at once.
For now I have this configuration:
<?xml version="1.0" encoding="UTF-8"?>
<inboundEndpoint name="AssuresContratsGtIEP" onError="TechnicalExceptionSEQ" protocol="file" sequence="AssuresContratsGtSEQ" suspend="false" xmlns="http://ws.apache.org/ns/synapse">
<parameters>
<parameter name="interval">5000</parameter>
<parameter name="sequential">true</parameter>
<parameter name="coordination">true</parameter>
<parameter name="transport.vfs.FileProcessCount">2</parameter>
<parameter name="transport.vfs.ContentType">application/binary;charset=UTF-8</parameter>
<parameter name="transport.vfs.LockReleaseSameNode">false</parameter>
<parameter name="transport.vfs.AutoLockRelease">false</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.FileURI">/home/istya/Flux/REF_PERS/Input/</parameter>
<parameter name="transport.vfs.MoveAfterFailure">/home/istya/Flux/REF_PERS/Failure/</parameter>
<parameter name="transport.vfs.DistributedLock">false</parameter>
<parameter name="transport.vfs.FileNamePattern">.*ASSURES_CONTRATS_GT.*.csv</parameter>
<parameter name="transport.vfs.MoveAfterProcess">/home/istya/Flux/REF_PERS/Process/</parameter>
<parameter name="transport.vfs.Locking">disable</parameter>
<parameter name="transport.vfs.FileSortAttribute">none</parameter>
<parameter name="transport.vfs.FileSortAscending">true</parameter>
<parameter name="transport.vfs.CreateFolder">true</parameter>
<parameter name="transport.vfs.Streaming">true</parameter>
<parameter name="transport.vfs.Build">false</parameter>
</parameters>
</inboundEndpoint>
When I change the sequential parameter to "false", the program crashes: first mediator on the sequence says that the file does not exist (although the file is still in the polling folder...).
Does anyone knows how to process multiple files with the same inbound and sequences in WSO2 ESB ? Is it possible or do we need to install a cluster of ESB ?
Thanks for your support !
Julien
I am trying to set up an inbound endpoint in ESB 5.0.0. This works fine when setting a fixed value for the file uri. But i am not able to set this with a registry value.
In this question someone asked almost the same.
The answer is about setting <parameter name="transport.vfs.FileURI" key="conf:/repository/esb/esb-configurations/test"/>, but it does not explain what type of registry entry you need to have for a file endpoint.
Can someone give me a full explanation on how to set up a inbound endpoint with a fileuri that is defined in the registry?
The xml of the inbound endpoint
<?xml version="1.0" encoding="UTF-8"?>
<inboundEndpoint name="Poller.Label.Print.NL"
onError="FaultSequenceEmail" protocol="file" sequence="LabelPrint"
suspend="false" xmlns="http://ws.apache.org/ns/synapse">
<parameters>
<parameter name="interval">1000</parameter>
<parameter name="sequential">true</parameter>
<parameter name="coordination">true</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.LockReleaseSameNode">false</parameter>
<parameter name="transport.vfs.AutoLockRelease">false</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.FileURI">conf:/test</parameter>
<parameter name="transport.vfs.MoveAfterFailure">file:///c:\tdemo\error</parameter>
<parameter name="transport.vfs.MoveTimestampFormat">yyyyMMddHHmmss</parameter>
<parameter name="transport.vfs.DistributedLock">false</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.dd</parameter>
<parameter name="transport.vfs.FileProcessInterval">10</parameter>
<parameter name="transport.vfs.MoveAfterProcess">file:///c:\demo\archive</parameter>
<parameter name="transport.vfs.Locking">disable</parameter>
<parameter name="transport.vfs.FileSortAttribute">lastmodifiedtimestamp</parameter>
<parameter name="transport.vfs.FileSortAscending">true</parameter>
<parameter name="transport.vfs.CreateFolder">false</parameter>
<parameter name="transport.vfs.Streaming">true</parameter>
<parameter name="transport.vfs.Build">false</parameter>
</parameters>
</inboundEndpoint>
tested with the following xml, but did not work:
<?xml version="1.0" encoding="UTF-8"?>
<localEntry xmlns="ws.apache.org/ns/synapse" key="test">
file:///c:/demo/
</localEntry>
The file store in conf:/test need to have this content:
file:///c:\demo\
Check this:
I want to read some values from a file that being processed by the VFS transport.
My file is :
<sales>
<header>
<source>STORE1</source>
<target>HEADOFFICE</target>
</header>
So I use a property mediator to get the value I want using XPath. But when I print that property in Log Mediator it prints nothing. My proxy look like this :
<proxy name="Try1"
transports="vfs"
startOnLoad="true"
trace="disable">
<target>
<inSequence>
<property xmlns:ns="http://org.apache.synapse/xsd"
name="source"
expression="//header/source/text()"
scope="default"
type="STRING"/>
<log level="full">
<property xmlns:ns="http://org.apache.synapse/xsd"
name="Value_source"
expression="get-property('source')"/>
</log>
</inSequence>
</target>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.PollInterval">15</parameter>
<parameter name="transport.vfs.MoveAfterProcess">file:///Users/Target</parameter>
<parameter name="transport.vfs.FileURI">file:///Users/Source</parameter>
<parameter name="transport.vfs.MoveAfterFailure">file:///Users/Failure</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.txt</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
The log mediator result is
[2013-06-28 16:59:49,939] INFO - LogMediator Value_source=
So how can I get the values in file using XPath?
The issue is due to the ContentType set for the transport parameter:
Switch
<parameter name="transport.vfs.ContentType">text/plain</parameter>
with
<parameter name="transport.vfs.ContentType">application/xml</parameter>
since you're doing XPath operations on the message.
The problem is with the content of your file. Since it is not well-formed, the xpath expression fails. Isn't it possible for you to have the well-formed xml in the input content?
<sales>
<header>
<source>STORE1</source>
<target>HEADOFFICE</target>
</header>
</sales>