mulesoft

How to fix “AttributeError: 'module' object has no attribute 'SOL_UDP'” error in Python Connector Mule

流过昼夜 提交于 2021-02-19 08:45:44
问题 I'm trying to execute a basic script to return Cisco Config File as a JSON Format, and I have a success process over Python2.7.16 and Python 3.7.3, but when I'm trying to execute the same script over Python Connector for Mule ESB I receive the error refered in the title of this thread. This is for a Mule feature, the Python connector script in this tool, works with a Jython 2.7.1, and is loaded as a library for the Mule. I expect the output as a JSON file but actual output is: Root Exception

Mulesoft 3 DataWeave - split a string by an arbitrary length

懵懂的女人 提交于 2021-02-11 07:09:04
问题 In Mule 3 DataWeave, how do I split a long string into multiple lines by a set length? For instance, I have the following JSON input: { "id" : "123", "text" : "There is no strife, no prejudice, no national conflict in outer space as yet. Its hazards are hostile to us all. Its conquest deserves the best of all mankind, and its opportunity for peaceful cooperation many never come again." } The input system can only accept strings of 40 characters or less, so the output XML needs to conform as

Mulesoft 3 DataWeave - split a string by an arbitrary length

删除回忆录丶 提交于 2021-02-11 07:08:50
问题 In Mule 3 DataWeave, how do I split a long string into multiple lines by a set length? For instance, I have the following JSON input: { "id" : "123", "text" : "There is no strife, no prejudice, no national conflict in outer space as yet. Its hazards are hostile to us all. Its conquest deserves the best of all mankind, and its opportunity for peaceful cooperation many never come again." } The input system can only accept strings of 40 characters or less, so the output XML needs to conform as

Mulesoft 3 DataWeave - split a string by an arbitrary length

十年热恋 提交于 2021-02-11 07:08:10
问题 In Mule 3 DataWeave, how do I split a long string into multiple lines by a set length? For instance, I have the following JSON input: { "id" : "123", "text" : "There is no strife, no prejudice, no national conflict in outer space as yet. Its hazards are hostile to us all. Its conquest deserves the best of all mankind, and its opportunity for peaceful cooperation many never come again." } The input system can only accept strings of 40 characters or less, so the output XML needs to conform as

How do I flatten a JSON array to a csv file

时光总嘲笑我的痴心妄想 提交于 2021-02-08 11:30:48
问题 I have an incoming payload in JSON format where I am outputting some of the objects to a CSV file. The payload also has one array: "Chargebacks": [ { "CostCenterCode": "123ABC", "AllocationPercentage": 100 }, { "CostCenterCode": "456DEF", "AllocationPercentage": 100 } ] I need the CSV file to contain: <other headers from the objects>,Cost Center Code 1, Allocation Percentage 1, Cost Center Code 2, Allocation Percentage 2 <other object values>,123ABC,100,456DEF,100 My first attempt was to

How to compare JSON in powershell

匆匆过客 提交于 2021-02-08 07:51:56
问题 I have a requirement where I need to compare JSON object from a file to the JSON message which comes into Anypoint MQ queue. I am able to get the message from the queue. I have used below script but it is not working. I did both -eq and Compare-Object but they are not working. $po_ps_output = $filemessagecontent | ConvertFrom-Json $po_python_output = $mqmessagecontent.body | ConvertFrom-Json $result = $po_ps_output -eq $po_python_output 回答1: If you just want to know if the two JSON-originated

How to compare JSON in powershell

那年仲夏 提交于 2021-02-08 07:51:53
问题 I have a requirement where I need to compare JSON object from a file to the JSON message which comes into Anypoint MQ queue. I am able to get the message from the queue. I have used below script but it is not working. I did both -eq and Compare-Object but they are not working. $po_ps_output = $filemessagecontent | ConvertFrom-Json $po_python_output = $mqmessagecontent.body | ConvertFrom-Json $result = $po_ps_output -eq $po_python_output 回答1: If you just want to know if the two JSON-originated

How to send a file using http request connector in mule4

倖福魔咒の 提交于 2021-02-08 06:35:34
问题 I am trying to add attachments to JIRA issue using JIRA rest api. I am using mulesoft to develop this flow. But I am not able to figure out how to send a file using request connector in mule 4. JIRA only accepts file in the form of multipart content type. I went through some of the documentation and it seems that till mule 3 using set attachment we can do this. In mule 4 dataweave is used to achieve this functionality but i am not able to find working code that can be used to implement this.

Maven - How to replace value in any file in other location?

断了今生、忘了曾经 提交于 2021-01-29 10:12:58
问题 I have to replace value in file: test.xml This file location is: src/main/app . It is possible ? 回答1: Properties could be changed based on the ${app.name}. There is no need to change flow to change property file. <configuration-properties doc:name="Configuration properties" file="/var/mule/${MULE_ENV}/${app.name}/global.yaml" /> https://simpleflatservice.com/mule4/Properties.html 来源: https://stackoverflow.com/questions/61912352/maven-how-to-replace-value-in-any-file-in-other-location

Recursively parse XML to create JSON array using dataweave 2

爱⌒轻易说出口 提交于 2021-01-29 06:49:18
问题 I am trying to parse an XML recursively to create JSON array using dataweave 2 but I am not able to do so. My Input XML is given below - <?xml version="1.0" encoding="UTF-8"?> <Envelope xmlns="http://schemas.microsoft.com/dynamics/2011/01/documents/Message"> <Header> <MessageId>{8736346D-A766-4BE1-8592-C263A4CC2AB5}</MessageId> <Action>http://schemas.microsoft.com/dynamics/2008/01/services/BomBillsofMaterialsService/read</Action> </Header> <Body> <MessageParts xmlns="http://schemas.microsoft