xml to xml field attribute transformation using ESQL on message broker compute node - messagebroker

I am new to message broker development. I tried to convert source SOAP over xml file to target SOAP over xml file.On my message flow source message discarded to catch terminal.I am not able to find out the problem
my flow : MQINPUT NODE ---> COMPUTE NODE --> MQOUTPUT NODE
If any provide solution on this that may me helpful for me.
DECLARE soapenv CHARACTER 'SOAP-ENV';
SET OutputRoot.XMNLSC.soapenv:Envelope.soapenv:Body.params.ORIGIN_TYPE_CD = InputRoot.XMNLSC.soapenv:Envelope.soapenv:Body.params.originType;
**

Your first line is definitely wrong, but you should be able to see that from the exceptions you are getting.
The first line should be:
DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
An in the further lines the domain should be XMLNSC not XMNLSC.

Related

What does "Building tree for null using TinyBuilder" mean with Saxon extension function and using -t option?

With my Saxon extension function code I have the log messages:
> java -cp ./saxon-he-10.2.jar:./ net.sf.saxon.Transform -t -init:MyInitializer -xsl:./exttest.xsl -o:./out.xml -it:initialtemplate
Saxon-HE 10.2J from Saxonica
Java version 14.0.2
Stylesheet compilation time: 305.437652ms
Processing (no source document) initial template = initialtemplate
Using parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
Building tree for null using class net.sf.saxon.tree.tiny.TinyBuilder
Tree built in 0.850325ms
Tree size: 3 nodes, 0 characters, 0 attributes
Execution time: 29.965658ms
Memory used: 14Mb
It is not clear to me wether Building tree for null using class net.sf.saxon.tree.tiny.TinyBuilder means that there is something wrong with my code https://gitlab.com/ms452206/socode20200915 and how to avoid it.
It's a poor message and I will improve it; the "null" would be the base URI (or systemId) of the document if it had one. The fact that the document has no known base URI could be a predictor of trouble downstream, since some things rely on a document having a known base URI; but it's not an error in itself.
It's most likely to happen if you build a document using a JAXP Source object whose systemId property is null. Which is what you have done when you wrote:
new StreamSource(new StringReader("<foo/>"))
This is likely to cause failures only if the document contains relative URIs (for example in external entity references or href or xml:base attributes), which is not the case with your simple XML document.

wsimport error while parsing the WSDL

I received the below error while parsing the WSDL.
Non unique body parts! In a port, as per BP 1.1 R2710 operations must have unique operation signaure on the wire for successful dispatch. In port HorizonWebServiceSOAP, Operations "GetTextInvitations" and "Version" have the same request body block. Try running wsimport with -extension switch, runtime will try to dispatch using SOAPAction.
The default option for wsimport what application is using is -XdisableSSLHostnameVerification but when I have used -extension it parsed successfully.
But because of application constraint, I have to use the default option only.
Please need your help to find out what is wrong in the WSDl and what needs to be modified.

change trace log format in emqtt message broker

I am using emqtt message broker for mqtt.
I am not a erlang developer and has zero knowledge on that.
I have used this erlang based broker, because after searching many open source broker online and suggestions from people about the advantage of erlang based server.
Now i am kind of stuck with the out put of the emqttd_cli trace command.
Its not json type and if i use a perl parser to convert to json type i am getting delayed output.
I want to know, in which file i could change the trace log output format.
I looked on the trace code of the broker and found a file src/emqttd_protocol.erl. An exported function named trace/3 has the code that you need.
Second argument of this function, named Packet, has the information of receive & send data via broker. You can fetch required data from it and format according to how you want to print.
Edit : Sample modified code added
trace(recv, Packet, ProtoState) ->
PacketHeader = Packet#mqtt_packet.header,
HostInfo = esockd_net:format(ProtoState#proto_state.peername),
%% PacketInfo = {ClientId, Username, ClientIP, ClientPort, Payload, QoS, Retain}
PacketInfo = {ProtoState#proto_state.client_id, ProtoState#proto_state.username, lists:nth(1, HostInfo), lists:nth(3, HostInfo), Packet#mqtt_packet.payload, PacketHeader#mqtt_packet_header.qos, PacketHeader#mqtt_packet_header.retain},
?LOG(info, "Data Received ~s", [PacketInfo], ProtoState);

Apache Camel And Printing Producer

This one should be simple but for the life of me I cannot figure out how to get it running. What I want to do is read files from a folder and send them to a printer.
So I had a look at the documentation for the printer component in Camel and it seemed straight forward.
I produced the following DSL route:
<camelContext trace="false" id="blueprintContext" xmlns="http://camel.apache.org/schema/blueprint">
<route id="printSpoolRoute">
<from uri="file:d:/printspool?delay=1000&move=.done/printed/${date:now:yyyyMMdd}/${file:onlyname.noext}_DONE_${date:now:yyyyMMddHHmmss}.${file:name.ext}&readLock=changed""/>
<to uri="lpr:localhost/default?flavor=DocFlavor.INPUT_STREAM&mimeType=AUTOSENSE&mediaSize=iso-a4"/>
</route>
</camelContext>
When I start it up I get the following exception:
[ Blueprint Extender: 1] BlueprintCamelContext ERROR Error occurred during starting Camel: CamelContext(blueprintContext) due Failed to create Producer for endpoint: Endpoint[lpr://localhost/default?flavor=DocFlavor.INPUT_STREAM&mediaSize=iso-a4&mimeType=AUTOSENSE]. Reason: java.lang.NullPointerException
org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[lpr://localhost/default?flavor=DocFlavor.INPUT_STREAM&mediaSize=iso-a4&mimeType=AUTOSENSE]. Reason: java.lang.NullPointerException
If the exception had more detail I might be able to look for something so I suspect I made a mistake in the URI of the printing producer.
While I am looking at the URI of the printer producer I just wanted to check if my understanding of the URI is correct when using a network printer.
Let assume I want to produce documents on a network printer connected to a server call SRV-07 with a name of HP LaserJet 4104 will the following URI be correct:
<to uri="lpr:SRV-07/HP LaserJet 4104?flavor=DocFlavor.INPUT_STREAM&mimeType=AUTOSENSE&mediaSize=iso-a4"/>
I am worried about dashes and spaces in the name and someone that has worked with this component before could shed some light here.
Right leaving this here for reference.
Answer is that the mediaSize parameter must be specified according to the documentation found at this link. I had the parameter as iso-a4 instead of ISO_A4. Maybe the camel developers could give a little more descriptive exception here.
Also the question about the URI for network printers does work as I have specified.

lack of CR - TCP Sampler

I am trying to use TCP Sampler for creating an automatic tests on top of IMAP4.
I am not using the Mail Reader Sampler because i need to allow injecting pure IMAP4 commands.
My IMAP4 server (like any IMAP4 server) expect to receive any IMAP4 command end with CRLF (0D0A) so there fore i have ended my command in the Text to send area with a new line (Enter).
I sniffed the traffic and noticed that the JMeter added only LF (0A) after the command (without the Carriage return)
Is there something that i am missing here ?
How can i enforce JMeter TCP Sampler to add CRLF at the end of every TCP command ?
Using XML-escaped solved the problem !!!
http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
In the JMX file that is based on XML I appended the 0xD Character explicitly:
1 login 972557557566#is433.email.com a123456A
While I could not get the EOL fix to work, nor the XML approach, I did find the following post which provides another solution: http://community.blazemeter.com/knowledgebase/articles/268778-how-to-send-control-characters-using-the-jmeter-tc. The general idea is to do the following:
Create user defined variables called 'new_line' and 'carriage_return'.
Set those user defined variables to %0A and %0D, respectively.
Before your tcp sampler, create a BeanShell PreProcessor.
In the BeanShell PreProcessor, overwrite the variable values like so:
vars.put("new_line_char",URLDecoder.decode(vars.get("new_line_char"), "ASCII"));
vars.put("carriage_return_char",URLDecoder.decode(vars.get("carriage_return_char"), "ASCII"));
In your TCP Sampler, include your new variables at the end of your line
some data to send to some place${carriage_return_char}${new_line_char}

Resources