Talend - ESB - SOAP webservice - esb

I need to realize a Talend ESB project that basically have an input SOAP WS ,based on a parameter it needs to execute different subjobs.
This is the SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.talend.org/service/">
<soapenv:Header/>
<soapenv:Body>
<ser:test_callOperationRequest>
<user>user</user>
<password>psw/password>
<id_customer>test ESB</id_customer>
<query>test mirror quality</query>
<command>JOB1</command>
</ser:test_callOperationRequest>
</soapenv:Body>
</soapenv:Envelope>
So I'd like to call specific subjob based on "command" parameter (i.e.:JOB1).
This is my actual project structure:
Any suggestion on right Talend component to use? Shall I include Routes?
Thanks in advance.

You can use the option "Use dynamic job" of tRunJob component :
Once you check the option, you get a field called "Context job", in which you specify the name of the child job you want to run, from a list of jobs that you choose by clicking "..." next to the Job field.
You can connect tJavaRow_1 to tRunJob_1 by a main flow, and in the Context job field, specify the incoming flow's column containing the name of the job to run (in my example it's row2.JobToRun).
The corresponding childjob is then called for each incoming row.

Related

Logic App dynamic content give null or ""

I want to create small automation between Jira and Azure. To do this, I execute HTTP trigger from Jira, which send all request properties to Azure Logic App. In "When a HTTP request is received" step in Logic App I can see properly JSON schema with all data which I need. In next steps for example I want to add user to Azure AD group. And problem starts here.
For example, I want to Initialize variable and set it with value from JSON. I choose properties from dynamic menu, but after script execute always it is null value ( but in first step in "raw output" I see whole schema with data). I tried many things - parse, compose, many different conversion - always without any luck - null value or "".
Expected value - when I want to initialize variable using Properties from Dynamic Content I want to have value from input json.
Output from Jira
Output with the same JSON send from Postman
Thanks for any help !
--
Flow example
Flow result
If you send the json with application/json content-type, you could just select the property with the dynamic content, however if not you have to parse it to json format with Parse Json action.
AS for the schema, you need use your json data to generate it with Use sample payload to generate schema. Paste the sample json payload.
Then you will be able to select property. However you could not implement it dynamic content, you have to write the expression. The format will be like this body('Parse_JSON')['test1'] and if your json has array data, you need to point the index it will be like this body('Parse_JSON')['test2'][0]['test3'].
Below is my test, you could have a try.

SSRS: How to use XML document data source with parameters

I am trying to create an SSRS report that has an XML data source, but am stuck.
I have a URL that accepts a parameter (Below, parameter is named Id with value param1) and returns the following XML data:
https://site1/test/GetInfo/param1
or
https://site1/test/GetInfo?Id=param1
<Contract xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Dynamics.Ax.Application">
<Id>param1</Id>
<City>Los Angeles</City>
<Country>USA</Country>
<Customer>Customer1</Customer>
<State>WA</State>
<Street>150 Main Street</Street>
<Zip>99999</Zip>
</Contract>
This isn't a web service per se since it simply accepts parameter/query at the URI, so I am believing this to be an XML document.
In SSRS 2016 Report Builder, I did the following:
In my report, I created a Datasource with ConnectionType = XML, and Connection string = https://site1/test/GetInfo
Created a dataset pointing to above data source, with Query type = Text, with the following:
<Query>
<Method Namespace="http://schemas.datacontract.org/2004/07/Dynamics.Ax.Application" Name="GetInfo">
<Parameters>
<Parameter Name="Id">
<DefaultValue>DefaultValue1</DefaultValue>
</Parameter>
</Parameters>
</Method>
</Query>
Upon clicking OK button to complete the dataset, I get the following error:
Could not create a list of fields for the query. Verify that you can connect to the data source and that your query syntax is correct.
Failed to execute web request for the specified URL.
Method Not Allowed: The remote server returned an error: (405) Method Not Allowed.
The remote server returned an error: (405) Method Not Allowed.
<Error><Message>The requested resource does not support http method 'POST'.</Message></Error>
The Method name in the query maps to the actual method name in the class, and and the operation is a GET method.
It's been a while since I played w/ the XML Data Provider, but my recollection is that the XML Data Provider will do a POST with a SOAP payload for any URL that doesn't have a file extension of xml (for example, http://www.example.com/mywebservice). Parameters in this case are included in the SOAP request payload. Since you don't have a web service, then your server likely doesn't support the POST method on the HTTP request which is likely why you're getting the 405 Method not allowed error.
If you have an extension of xml in your url, then the XML Data Provider will do a GET request and include the parameters in the query string of the URL (for example, http://www.example.com/mywebservice/myfile.xml?name=Joe).
If you don't have a way to process these parameters on the server, then it may be easier to return the entire XML data and do a table filter.
Or if you have a Power BI Pro account, then you can create a Power BI Dataset from the XML data, create a Power BI Dataset Connection in RB, then filter the data in a DAX query in Power BI Report Builder (note that Power BI Dataset connections are only supported in Power BI Report Builder and Power BI Premium Capacities, not in SSRS or PBIRS).

Mule Collection aggregator

I am trying to use Mule 3.2.0 s Collection Aggregator. I tried using Mule Studio but seems it is still not available in Mule studio for configuration though the icon does appear in the "Flow Control" section.
My use case is -
I get a message from a VM Inbound endpoint. I now want to pass that to 3 different flows - all using the same request object but performing different operations - say A,B,C. All of them update their respective databases but they are all part of a common Order_ID(somethig internal to our application). The 3 processes may take different processing times but once done each of them return the same success response. I want to use an aggregator which will aggregate all these responses without timing out and then forward that to a Java component or another VM Endpoint for further processing.
The Mule documentation for Collection Aggregator doesn't seem to be very informative so if some one who has used Collection Agg can help me out with the xml config for the above scenario it will be very helpful
Instead of Collection Aggregator use All message processor. It sends the same message to every processor inside it and aggregates the results after they finish.
http://www.mulesoft.org/documentation/display/MULE3USER/Routing+Message+Processors#RoutingMessageProcessors-All
Sample config: (I send "foo" to the vm endpoint)
<flow name="main" processingStrategy="asynchronous">
<vm:inbound-endpoint path="in"/>
<all>
<flow-ref name="flow1"/>
<flow-ref name="flow2"/>
</all>
<logger message="#[payload:]" level="INFO"/>
</flow>
<flow name="flow1">
<append-string-transformer message="bar1"/>
</flow>
<flow name="flow2">
<append-string-transformer message="bar2"/>
</flow>
Console output:
INFO 2012-08-15 17:26:01,749 [main.stage1.02] org.mule.api.processor.LoggerMessageProcessor: [foobar1, foobar2]
HTH
I would go with to use ALL component and the endpoint you use should be request-response (two-way where the flow waits for the response).
Thus the ALL component will aggregate the response an then returns you a CopyOnWriteArrayList with all the response from the flows A,B and C. This Array list you can transform in any desired way using a custom transformer by extending AbstractTransformer in your java class.
Cheers,
Naveen Raj

Assistance with a simple WSO2 ESB project

I'm very very new to this and need some help writing an ESB script to take an event posted via HTTPS on Port 9090 in WSO2 and transform it into a message to be apended to an XML file on the server:
The HTTPS data will contain : “ID=Servername|Severity=sevtype” (Where Servername is a device name and Sevtype can either be "WARNING" or "OK" depending on whether the server is down or up)
This then needs to be transformed and appended to an existing XML file in the following format:
<event>
<componentID>Servername</componentID>
<timestamp>2012-04-27 01:37:10</timestamp> ***(Date and time the event was received)***
<severity>NORMAL</severity> ***(If original is WARNING then severity = SEVERE else it = NORMAL)***
<eti>NodeStatus</eti><etivalue>Up</etivalue> ***(If original is WARNING then severity = Down else it = Up)***
<\event>
Please could someone assist me i'm really floundering with what seems to be a simple thing
Many Many Thanks
Simon
You can write a simple task to poll your data into the server and can do a xslt transformation to construct that particular xml format message.
Some references to write a task;
http://wso2.org/project/esb/java/4.0.3/docs/configuration_language.html#TaskConcept
http://docs.wso2.org/wiki/display/ESB403/Writing+Tasks
http://wso2.org/library/2900
How do you get the ID and Severity? are they http headers?
Generally you can use payload factory mediator[1] to build the payload messages with some input parameter data.
[1] http://wso2.org/project/esb/java/4.0.3/docs/samples/message_mediation_samples.html#Sample17

Integrating Biztalk and SalesForce

I'm trying to communicate with SalesForce from Biztalk.
To make a POC where I just login I tried the following:
Visual Studio:
Generate schema from SalesForce partner wsdl
Biztalk:
I made a receive location which reads a login.xml message containing username and password. Then imported the SforceService.BindingInfo.xml to make my sendport and setup filters on it.
When I run the example i get the following exception:
WcfSendPort_SforceService_Soap
https://login.salesforce.com/services/Soap/u/24.0
System.InvalidOperationException: An action mapping was defined but BTS.Operation
was not found in the message context.
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient
I want to invoke the following operation on the SalesForce webservice:
<Operation Name="login" Action="" />
Any ideas on how to call login without using orchestrations ?
From http://msdn.microsoft.com/en-us/library/bb743856.aspx
Specifying action mapping for WCF.Action in an Expression shape is not supported. You need to specify the action mapping in the WCF transport properties dialog box. Then the WCF adapter will look up the SOAP action by using the BTS.Operation context property, which the orchestration sets to the name of the operation on the port where the message is sent.
If outgoing messages are routed with content-based routing (CBR) where the http://schemas.microsoft.com/BizTalk/2003/system-properties#Operation property is not set, WCF send adapters will set the whole action mapping string to the action of the outgoing WCF messages. To work around this, you can do one of the following:
Set the action field on the send port to http://MyService/IMyContract/MyAction1.
Set the BTS.Operation context property in a pipeline. For example, set the value of http://schemas.microsoft.com/BizTalk/2003/system-properties#Operation to Operation1.
Leave the action field blank and use the action from the incoming message instead.
You can also use the BizTalk WCF Service Consuming Wizard to consume the WCF services with single action or action mapping. For more details, see How to Use the BizTalk WCF Service Consuming Wizard to Consume a WCF Service.