http webharvest tag not working with http-param parameters - http

I am trying the below code in webharvest
<var-def name="url">https://www.athome.com/on/demandware.store/Sites-athome-Site/default/Stores-FindByZip?</var-def>
<var-def name="urlResult">
<html-to-xml>
<http url="${url}" method="GET" >
<http-param name="Content-Type">text/html;charset=UTF-8</http-param>
<http-param name="dwfrm_storelocator_countryCode">US</http-param>
<http-param name="dwfrm_storelocator_distanceUnit">mi</http-param>
<http-param name="dwfrm_storelocator_postalCode">07054</http-param>
<http-param name="dwfrm_storelocator_maxdistance">999999</http-param>
<http-param name="dwfrm_storelocator_findbyzip">Search</http-param>
</http>
</html-to-xml>
</var-def>
I get the error stating There was an error processing your request.
Screenshot of the error is Error Screenshot
But when i define the url with all the parameters, then i get the intended result
<var-def name="url"><template>https://www.athome.com/on/demandware.store /Sites-athome-Site/default/Stores-FindByZip?dwfrm_storelocator_countryCode=US&dwfrm_storelocator_distanceUnit=mi&dwfrm_storelocator_postalCode=07054&dwfrm_storelocator_maxdistance=999999&dwfrm_storelocator_findbyzip=Search</template></var-def>
<var-def name="urlResult">
<html-to-xml>
<http url="${url}" method="GET">
</http>
</html-to-xml>
</var-def>
Why we have this kind of differing behavior ?
Thank you !

Related

How to retrieve Itinerary remarks with GetReservationsRQ Api?

Running the command I¥ command returns:
2 AA1579X 16SEP 5 DFWORD HF1 0625 0846 /DCBA*SDAZXT /E
I have successfully sent a request using GetReservationRQ. Asking for the remarks sections but I am getting the result above which I would expect. (I assumed this is the right section and have tried Itinerary too, see below)
<GetReservationRQ version="1.1.0" xmlns="http://services.sabre.com/sp/updatereservation/v1_1">
<Profile>
<UniqueID id="......."/>
</Profile>
<SubjectAreas>
<SubjectArea>REMARKS</SubjectArea>
</SubjectAreas>
<ReturnOptions>
<ViewName>Default</ViewName>
<ResponseFormat>STL</ResponseFormat>
</ReturnOptions>
</GetReservationRQ>
Which returns 2 remarks as part of the response:
<Remarks>
<Remark id="44" index="1" type="HS">
<RemarkLines>
<RemarkLine>
<Text>POSSIBLE DUPE BOOKING. SEE PNR JZXWEI JBVFYC HUSTLM</Text>
</RemarkLine>
</RemarkLines>
</Remark>
<Remark id="45" index="2" type="HS">
<RemarkLines>
<RemarkLine>
<Text>POSSIBLE DUPE BOOKING. SEE PNR KDCFKD KQLLXF</Text>
</RemarkLine>
</RemarkLines>
</Remark>
</Remarks>
However as you can see they are not the same remark as when I run the command I¥. What am I doing wrong?
Here are links to the sabre documentation:
https://developer.sabre.com/docs/soap_apis/management/itinerary/Retrieve_Itinerary/help_doc?page=get-reservation-request-and-response-structure
Which says:
REMARKS Allows to display remark information (supported types: REG, HD, HS, CLIADR, DELADR, INVOICE, ITINERARY, INTERFACE, CODED_A, PRTONTKT, CORPORATE, FOP, QQ, FILLER, ITINSEGASSOC)

Can we create Munit for on Error propagate in mule 4?

Does on Error Propagate Munit should fail or pass?
Scenario:
When I get db connectivity error, it triggers email with error notification. Flow reference to Error email flow. Flow reference is placed in On Error Propagate.
I have mocked database with Error, DB CONNECTIVITY in error tab and wrap flow Ref in Try block. My tests are failing.
Test suite should fail with error message or pass with green colour in Munit tests?
<munit:test name="implementation-suiteTest" doc:id="804123309-0b27-4e5a-beb3-5372b91eafc3" expectedErrorType="DB:QUERY_EXECUTION">
<munit:behavior >
<munit:set-event doc:name="Set Event" doc:id="5d0290f4-9855-42ba-b434-a4322457819c">
<munit:payload value="#[output application/java --- readUrl('classpath://insertdatabaseFlowtest\mock_payload.dwl')]" />
</munit:set-event>
<munit-tools:mock-when doc:name="Mock " doc:id="d8493233-303b-4765-89b4-9ae19bdffa1f" processor="db:bulk-insert">
<munit-tools:with-attributes>
<munit-tools:with-attribute whereValue="b645fb60-7b08-4939-894d-a476ee58b325" attributeName="doc:id" />
</munit-tools:with-attributes>
<munit-tools:then-return >
<munit-tools:payload value="#[output application/java --- readUrl('classpath://insertdatatodatabaseFlowtest\mock_payload1.dwl')]" />
<munit-tools:error typeId="DB CONNECTIVITY" />
</munit-tools:then-return>
</munit-tools:mock-when>
<munit-tools:mock-when doc:name="Send Email" doc:id="c9cb74e7-9b56-4634-a272-d954d4ab8fb2" processor="email:send">
<munit-tools:with-attributes >
<munit-tools:with-attribute whereValue="3f8bda1c-2e22-43d8-8e0a-3da9a6653dd7" attributeName="doc:id" />
</munit-tools:with-attributes>
<munit-tools:then-return >
<munit-tools:payload value="#[output application/java --- readUrl('classpath://insertdatatodatabaseFlowtest\mock_payload2.dwl')]" />
</munit-tools:then-return>
</munit-tools:mock-when>
</munit:behavior>
<munit:execution>
<try doc:name="Try" doc:id="e73eae0a-25fb-46bb-b0e9-e845bb7310e0" >
<flow-ref doc:name="Flow-ref " doc:id="8582675c-3203-4f70-8988-370e82cd5249" name="insert-dataFlow" />
<error-handler >
<on-error-continue enableNotifications="true" logException="true" doc:name="On Error Continue" doc:id="7999aa4b-4959-4c64-98c4-284f883c5778" >
<logger level="INFO" doc:name="Logger" doc:id="6018dc63-a176-41aa-9ca3-be39264c9e0f" />
</on-error-continue>
</error-handler>
</try>
</munit:execution>
<munit:validation>
<munit-tools:assert-that doc:name="Assert that" doc:id="6b255b30-e43a-4001-a62d-e6374a9d16f0" expression="#[payload]" is="#[MunitTools::containsString('Error Email Sent')]"/>
</munit:validation>
</munit:test>
Thanks

ejabberd reports bad request/modify when attempting to delete user

I'm trying to delete user using ejabberd yet I'm receiving 400/modify bad-request error. The stanzas sent by Smack are by the spec [1] as far as I can tell; it also works fine with OpenFire.
Ejabberd runs in rroemhild/docker-ejabberd docker container version 17.03-1 (the latest available; for reasons why I am not using the processone container see [2]) with the config file being stock from there (sections removed; full copy at [3])
hosts:
- "xmppserver.com"
auth_method:
- internal
acl:
admin:
user:
- "admin": "xmppserver.com"
- "adminaccount": "xmppserver.com"
local:
user_regexp: ""
access:
(nothing of interest here)
modules:
mod_adhoc: {}
host_config:
"xmppserver.com":
domain_certfile: "/opt/ejabberd/ssl/xmppserver.com.pem"
(Yes, I will properly configure SSL once I verify it works for me)
First I confirm the user is authorised to issue admin commands:
SENT
<iq to='xmppserver.com' id='Ghtu9-15' type='get'>
<query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/commands'/>
</iq>
RECEIVED
<iq xml:lang='en' to='appserver#xmppserver.com/39058022031067483561501494598609310' from='xmppserver.com' type='result' id='Ghtu9-15'>
<query node='http://jabber.org/protocol/commands' xmlns='http://jabber.org/protocol/disco#items'>
...
<item node='http://jabber.org/protocol/admin#add-user' name='Add User' jid='xmppserver.com'/>
<item node='http://jabber.org/protocol/admin#delete-user' name='Delete User' jid='xmppserver.com'/>
...
</query>
</iq>
As you can see the delete-user command is listed as available. Then I proceed to delete a user:
SENT
<iq to='xmppserver.com' id='2vM3f-17' type='set'>
<command xmlns='http://jabber.org/protocol/commands' action='execute' node='http://jabber.org/protocol/admin#delete-user'></command>
</iq>
RECEIVED
<iq xml:lang='en' to='adminaccount#xmppserver.com/163923254889085958281501260654263394' from='xmppserver.com' type='result' id='2vM3f-17'>
<command status='executing' sessionid='2017-07-28T16:51:12.784282Z' node='http://jabber.org/protocol/admin#delete-user' xmlns='http://jabber.org/protocol/commands'>
<actions execute='complete'>
<complete/>
</actions>
<x type='form' xmlns='jabber:x:data'>
<title>Delete User</title>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/admin</value>
</field>
<field var='accountjids' type='jid-multi' label='Jabber ID'>
<required/>
</field>
</x>
</command>
</iq>
Here I'm not sure what the <actions...> tag is about; it's not mentioned in XEP-133. Other than that the form looks good.
SENT
<iq to='xmppserver.com' id='2vM3f-19' type='set'>
<command xmlns='http://jabber.org/protocol/commands' sessionid='2017-07-28T16:51:12.784282Z' node='http://jabber.org/protocol/admin#delete-user'>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/admin</value>
</field>
<field var='accountjids' type='jid-multi'>
<value>jid#xmppserver.com</value>
</field>
</x>
</command>
</iq>
RECEIVED
<iq xml:lang='en' to='adminaccount#xmppserver.com/163923254889085958281501260654263394' from='xmppserver.com' type='error' id='2vM3f-19'>
<command sessionid='2017-07-28T16:51:12.784282Z' node='http://jabber.org/protocol/admin#delete-user' xmlns='http://jabber.org/protocol/commands'>
<x type='submit' xmlns='jabber:x:data'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/admin</value>
</field>
<field var='accountjids' type='jid-multi'>
<value>jid#xmppserver.com</value>
</field>
</x>
</command>
<error code='400' type='modify'>
<bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
I also tried sending bare JIDs (i.e. without the hostname part) but the result is the same.
This is not a particularly helpful error message.
What am I doing wrong?
[1] https://xmpp.org/extensions/xep-0133.html#delete-user
[2] https://github.com/processone/ejabberd/issues/1890
[3] https://pastebin.com/5D0rEbFR
Apparently <error code='400' type='modify'> is eJabberD's way of saying 'user not found, nothing to delete'.

"XMLCommand.initialize failed: java.lang.NullPointerException" when using dataset-proxy in a workflow databroker

I'm creating a workflow databroker, and in the pre-workflow I am using a dataset-proxy to iterate over the populate-dataset. However I get the following error when I compile:
XMLCommand.initialize failed: java.lang.NullPointerException
at nz.co.aviarc.xml.command.dataset.DatasetProxy.initialize(DatasetProxy.java:35)
at com.aviarc.framework.xml.command.XMLCommandElementImpl.finalize(XMLCommandElementImpl.java:90)
at com.aviarc.framework.xml.compilation.XMLSAXHandler.endElement(XMLSAXHandler.java:336)
at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:391)
at net.sf.saxon.event.NamespaceReducer.endElement(NamespaceReducer.java:213)
at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:443)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:598)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:673)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1645)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:875)
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:798)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1198)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:564)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:404)
at net.sf.saxon.event.Sender.send(Sender.java:193)
at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:30)
at com.aviarc.framework.xml.compilation.AviarcXMLResourceCompiler.compile(AviarcXMLResourceCompiler.java:137)
...
I get exactly the same error even when I use the code example straight out of the documentation (com.aviarc.dataset:1.1.0):
<workflow xmlns:ds="urn:aviarc:xmlcommand:com.aviarc.dataset">
<ds:dataset-proxy dataset="ds" proxyname="dsproxy">
<set-current-row dataset="dsproxy" position="2" />
<set-field field="dsproxy.email" value="test#test.com" />
</ds:dataset-proxy>
</workflow>
Turns out that the documentation is wrong, as proxyname is not a valid attribute on dataset-proxy. I didn't see it at first (because of the huge stack trace) but I was also getting this warning:
Unknown attribute 'proxyname'
The correct attribute is name, not proxyname. Changing this resolved the error.

XML Parsing error in Flex

I am passing a XML document form the Java to Flex using Remote Object.
My XML is as follows
"
<root
<dept ID="1" Name="RND"
<Emp ID="1" Name="Aj"/>
</dept>
<dept ID="2" Name="ENG">
<Emp ID="1" Name="Aj"/>
</dept>
<dept ID="3" Name="MECH">
<Emp ID="1" Name="Aj"/>
</dept>
</root>
"
In Flex i am trying to access using below code
treeData = event.result as XML;
deptTree.dataProvider = treeData;
When i am trying to access the result object and i am getting the below exception
"
[RPC Fault faultString="org.w3c.dom.DOMException : INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified. " faultCode="Server.Processing" faultDetail="null"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
at mx.rpc::Responder/fault()
at mx.rpc::AsyncRequest/fault()
at NetConnectionMessageResponder/statusHandler()
at mx.messaging::MessageResponder/status()
"
Please help me to resolve this issue.
Thanks in advance.
Aj
<root
<dept ID="1" Name="RND"
Close root tag:
<root>

Resources