I have a REST service and trying to invoke through SHELL script but It throws below error message.
curl: (3) Illegal characters found in URL
I have the below Test.sh file that will try to invoke the REST service:
test="$(cat testng-results.xml)"
test1="$(cat testng-results_1.xml)"
echo "$test"
echo"http://10.239.61.4:8083/testngXML/getTestNGMerge/${test}/originalXML/${test1}"
curl -O --globoff -X GET "http://10.239.61.4:8083/testngXML/getTestNGMerge/${test}/originalXML/${test1}"
I'm trying to pass the XML content as query parameter in the end URL because I have rest client deployed in different host and accessing the shell script in different host that's the reason passing the XML content as REST end point URL.
how to make it the above REST url to work, and Is it right way to do that and if its not then which is the best way to do that
testNG-Result.xml:
<?xml version="1.0" encoding="UTF-8"?>
<testng-results skipped="0" failed="0" total="10" passed="10">
<suite name="TransferMoney-Suite" duration-ms="157605" started-at="2018-11-14T04:34:27Z" finished-at="2018-11-14T04:37:05Z">
<test name="TransferMoneyTest" duration-ms="153141" started-at="2018-11-14T04:34:27Z" finished-at="2018-11-14T04:37:01Z">
<class name="com.paypal.test.e2e.millennium.transfermoney.TransferMoneyMillenniumE2ETest">
<test-method status="PASS" signature="initializeDataProvider(java.lang.String, java.lang.String, java.lang.String)[pri:0, instance:com.paypal.test.e2e.millennium.transfermoney.TransferMoneyMillenniumE2ETest#3168e461]" name="initializeDataProvider" is-config="true" duration-ms="27" started-at="2018-11-13T20:34:30Z" finished-at="2018-11-13T20:34:30Z">
<params>
<param index="0">
<value>35,</value>
</param>
<param index="1">
<value is-null="true"/>
</param>
<param index="2">
<value is-null="true"/>
</param>
</params>
</test-method>
<!-- initializeDataProvider -->
<!-- transferMoneyPaymentE2ETest -->
</class>
<!-- com.paypal.test.e2e.millennium.transfermoney.TransferMoneyMillenniumE2ETest -->
</test>
<!-- TransferMoneyTest -->
<test name="Suite setup and teardown" duration-ms="4312" started-at="2018-11-14T04:37:01Z" finished-at="2018-11-14T04:37:05Z">
<class name="com.paypal.test.e2e.millennium.settlement.SettlementE2ESuite">
<test-method status="FAIL" signature="suiteSetup(org.testng.ITestContext)[pri:0, instance:com.paypal.test.e2e.millennium.settlement.SettlementE2ESuite#681da322]" name="suiteSetup" is-config="true" duration-ms="56" started-at="2018-11-13T20:34:27Z" finished-at="2018-11-13T20:34:27Z">
<params>
<param index="0">
<value>org.testng.TestRunner#74bc72e0</value>
</param>
</params>
</test-method>
<!-- suiteSetup -->
<test-method status="PASS" signature="dumpTransactionInfo()[pri:0, instance:com.paypal.test.e2e.millennium.settlement.SettlementE2ESuite#681da322]" name="dumpTransactionInfo" is-config="true" duration-ms="23" started-at="2018-11-13T20:37:05Z" finished-at="2018-11-13T20:37:05Z"/>
<!-- dumpTransactionInfo -->
</class>
<!-- com.paypal.test.e2e.millennium.settlement.SettlementE2ESuite -->
</test>
<!-- Suite setup and teardown -->
</suite>
</testng-results>
TestNG-Result_1.xml:
<?xml version="1.0" encoding="UTF-8"?>
<testng-results skipped="0" failed="0" total="10" passed="10">
<suite name="TransferMoney-Suite" duration-ms="157605" started-at="2018-11-14T04:34:27Z" finished-at="2018-11-14T04:37:05Z">
<test name="TransferMoneyTest" duration-ms="153141" started-at="2018-11-14T04:34:27Z" finished-at="2018-11-14T04:37:01Z">
<class name="com.paypal.test.e2e.millennium.transfermoney.TransferMoneyMillenniumE2ETest">
<test-method status="PASS" signature="initializeDataProvider(java.lang.String, java.lang.String, java.lang.String)[pri:0, instance:com.paypal.test.e2e.millennium.transfermoney.TransferMoneyMillenniumE2ETest#3168e461]" name="initializeDataProvider" is-config="true" duration-ms="27" started-at="2018-11-13T20:34:30Z" finished-at="2018-11-13T20:34:30Z">
<params>
<param index="0">
<value>35,</value>
</param>
<param index="1">
<value is-null="true"/>
</param>
<param index="2">
<value is-null="true"/>
</param>
</params>
</test-method>
<!-- initializeDataProvider -->
<!-- transferMoneyPaymentE2ETest -->
</class>
<!-- com.paypal.test.e2e.millennium.transfermoney.TransferMoneyMillenniumE2ETest -->
</test>
<!-- TransferMoneyTest -->
<test name="Suite setup and teardown" duration-ms="4312" started-at="2018-11-14T04:37:01Z" finished-at="2018-11-14T04:37:05Z">
<class name="com.paypal.test.e2e.millennium.settlement.SettlementE2ESuite">
<test-method status="FAIL" signature="suiteSetup(org.testng.ITestContext)[pri:0, instance:com.paypal.test.e2e.millennium.settlement.SettlementE2ESuite#681da322]" name="suiteSetup" is-config="true" duration-ms="56" started-at="2018-11-13T20:34:27Z" finished-at="2018-11-13T20:34:27Z">
<params>
<param index="0">
<value>org.testng.TestRunner#74bc72e0</value>
</param>
</params>
</test-method>
<!-- suiteSetup -->
<test-method status="PASS" signature="dumpTransactionInfo()[pri:0, instance:com.paypal.test.e2e.millennium.settlement.SettlementE2ESuite#681da322]" name="dumpTransactionInfo" is-config="true" duration-ms="23" started-at="2018-11-13T20:37:05Z" finished-at="2018-11-13T20:37:05Z"/>
<!-- dumpTransactionInfo -->
</class>
<!-- com.paypal.test.e2e.millennium.settlement.SettlementE2ESuite -->
</test>
<!-- Suite setup and teardown -->
</suite>
</testng-results>
Related
I was configuring Freeswitch to make a video conference. It was normal for everyone to enter the conference ,can watch each other and screen share. but It still existed these problems:
1: conference video record was splited several files that every leg in itself file, but I wanted a mix video that everyone was recorded in one file.how can I configure It?
2:I wanted the screen share is in a fixed position,so I customized conference_layouts.conf.xml and added a new rule.How can I make screen share can be in the floor position,and It screen share not open this postion was empty.
these is my configuration:
dialplan/default.xml
<extension name="my-mcu_conferences">
<condition field="destination_number" expression="^my(\d{5})$">
<action application="export" data="record_concat_video=true"/>
<action application="record_session" data="/freeswitch/recordings/archive/${destination_number}_${strftime(%Y-%m-%d-%H-%M-%S)}.mp4"/>
<action application="answer"/>
<action application="conference" data="$1#my-mcu"/>
</condition>
</extension>
<!-- STEREO 48kHz conferences / Video MCU -->
<extension name="my-mcu-screen_conferences">
<condition field="destination_number" expression="^my(\d{5}).*?-screen$">
<action application="answer"/>
<action application="send_display" data="FreeSWITCH Conference|$1"/>
<!-- I want screen share on the floor -->
<action application="set" data="conference_member_flags=join-vid-floor"/>
<action application="conference" data="$1#my-mcu"/>
</condition>
</extension>
autoload_configs/conference.conf.xml
<profile name="my-mcu">
<param name="domain" value="$${domain}"/>
<param name="rate" value="48000"/>
<param name="channels" value="2"/>
<param name="interval" value="20"/>
<param name="energy-level" value="200"/>
<!-- <param name="tts-engine" value="flite"/> -->
<!-- <param name="tts-voice" value="kal16"/> -->
<param name="muted-sound" value="conference/conf-muted.wav"/>
<param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
<param name="alone-sound" value="conference/conf-alone.wav"/>
<param name="moh-sound" value="$${hold_music}"/>
<param name="enter-sound" value="tone_stream://%(200,0,500,600,700)"/>
<param name="exit-sound" value="tone_stream://%(500,0,300,200,100,50,25)"/>
<param name="kicked-sound" value="conference/conf-kicked.wav"/>
<param name="locked-sound" value="conference/conf-locked.wav"/>
<param name="is-locked-sound" value="conference/conf-is-locked.wav"/>
<param name="is-unlocked-sound" value="conference/conf-is-unlocked.wav"/>
<param name="pin-sound" value="conference/conf-pin.wav"/>
<param name="bad-pin-sound" value="conference/conf-bad-pin.wav"/>
<param name="caller-id-name" value="$${outbound_caller_name}"/>
<param name="caller-id-number" value="$${outbound_caller_id}"/>
<param name="comfort-noise" value="false"/>
<param name="conference-flags" value="livearray-json-status|json-events|video-floor-only|rfc-4579|livearray-sync|minimize-video-encoding|manage-inbound-video-bitrate|video-required-for-canvas|video-mute-exit-canvas|mute-detect"/>
<param name="video-auto-floor-msec" value="1000"/>
<param name="video-mode" value="mux"/>
<param name="video-layout-name" value="1floor_top+4"/>
<!--<param name="video-layout-name" value="group:grid"/>-->
<param name="video-canvas-size" value="1920x1080"/>
<param name="video-canvas-bgcolor" value="#333333"/>
<param name="video-layout-bgcolor" value="#000000"/>
<param name="video-codec-bandwidth" value="3mb"/>
<param name="video-fps" value="30"/>
<!-- <param name="video-codec-config-profile-name" value="conference"/> -->
</profile>
autoload_configs/conference_layouts.conf.xml
<layout name="1floor_top+4">
<image x="45" y="90" scale="270" floor="true" floor-only="true" />
<image x="0" y="0" scale="90" />
<image x="90" y="0" scale="90" />
<image x="180" y="0" scale="90" />
<image x="270" y="0" scale="90" />
</layout>
I have resolved the recording problem by configuring conference.conf.xml adding
<param name="auto-record" value="/freeswitch/recordings/archive/${conference_name}_${strftime(%Y-%m-%d-%H-%M-%S)}.mp4"/>
I am currently switching from static configs to using mod_xml_curl and have encountered a problem with setting up call groups.
Inside my dialplan (served dynamically, working as expected) I am bridging to a group:
<action application="bridge" data="${group_call(call-group#domain-a.com)}"/>
Freeswitch is making a request with section=directory&action=group_call to the web server, to which I respond with a chunk of the directory containing the group and all relevant users:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="directory">
<domain name="domain-a.com">
<params>
<param name="dial-string" value="{presence_id=${dialed_user}#${dialed_domain}}${sofia_contact(${dialed_user}#${dialed_domain})}" />
</params>
<variables>
<variable name="user_context" value="domain-a.com" />
</variables>
<group name="call-group">
<users>
<user id="john" number-alias="1000">
<params>
<param name="password" value="1234" />
<param name="vm-password" value="1000" />
</params>
<variables>
<variable name="toll_allow" value="domestic,international,local" />
<variable name="accountcode" value="1000" />
<variable name="outbound_caller_id_name" value="John at domain-a.com" />
<variable name="outbound_caller_id_number" value="1234567" />
</variables>
</user>
<user id="lucy" number-alias="1001">
<params>
<param name="password" value="1234" />
<param name="vm-password" value="1000" />
</params>
<variables>
<variable name="toll_allow" value="domestic,international,local" />
<variable name="accountcode" value="1001" />
<variable name="outbound_caller_id_name" value="Lucy" />
<variable name="outbound_caller_id_number" value="12345678" />
</variables>
</user>
</users>
</group>
</domain>
</section>
</document>
However, group_call() seems to fail and in the logs I get ``:
2016-02-24 10:42:14.249534 [DEBUG] mod_dptools.c:1498 SET sofia/internal/michael#domain-a.com [call_timeout]=[15]
2016-02-24 10:42:14.529107 [CONSOLE] mod_xml_curl.c:323 XML response is in /tmp/2f772a8a-4c3a-46f2-834f-b9ba2c735feb.tmp.xml
EXECUTE sofia/internal/michael#domain-a.com bridge(error/NO_ROUTE_DESTINATION)
Perhaps anyone has experience setting up group calls with mod_xml_curl and could explain what exactly Freeswitch is expecting in the response?
After a little gnashing of teeth, I got this working. The clue was here underneath the group_call description:
Please note: If you need to have outgoing user variables set in leg B,
make sure you don't have dial-string and group-dial-string in your
domain or dialed group variables list; instead set dial-string or
group-dial-string in the default group of the user. This way
group_call will return user/101 and user/ would set all your user
variables to the leg B channel.
So, when you receive an action of type group_call, move the dial-string param to the group level, so instead of
<domain name="domain-a.com">
<params>
<param name="dial-string" value="{presence_id=${dialed_user}#${dialed_domain}}${sofia_contact(${dialed_user}#${dialed_domain})}" />
</params>
<variables>
<variable name="user_context" value="domain-a.com" />
</variables>
<group name="call-group">
<users>
<user id="john" number-alias="1000">
...
send this
<domain name="domain-a.com">
<variables>
<variable name="user_context" value="domain-a.com" />
</variables>
<group name="call-group">
<params>
<param name="dial-string" value="{presence_id=${dialed_user}#${dialed_domain}}${sofia_contact(${dialed_user}#${dialed_domain})}" />
</params>
<users>
<user id="john" number-alias="1000">
...
After I made that change, everything was hunky dory. Cheers!
It's related to your dialplan.It's not generated perfectly. just check the domain-a.com context in the dialplan.
I'm trying to implement a fire-and-forget flow to log messages on a database by calling an Oracle procedure, everything works fine but I'd like to log any exception I get when, by any chance, I misconfigured the xml or whatever else could go wrong (any exception thrown by the procedure?).
I've searched for quite some time but I'm probably missing out something...
Here's the actual setting:
I've got a gateway interface
public interface gatewayInterfaceDEF{
void monitoring(Object payload);
}
XML definition of the gateway
<int:gateway service-interface="gatewayInterfaceDEF">
<int:method name="monitoring" request-channel="monitoringGatewayInbound" />
</int:gateway>
Then the JDBC-outbound-gateway xml configuration that calls an oracle procedure:
<int:channel id="monitoringGatewayInbound">
<int:dispatcher task-executor="monitoringTaskExecutor"/>
</int:channel>
<int-jdbc:stored-proc-outbound-gateway
id="monitoringGatewayProcedure" request-channel="monitoringGatewayInbound"
data-source="dataSource" stored-procedure-name="procedureName"
return-value-required="false" ignore-column-meta-data="true">
<int-jdbc:sql-parameter-definition
someparameters />
<int-jdbc:parameter parameter mapping />
</int-jdbc:stored-proc-outbound-gateway>
Thanks in advance
I've found this: http://java.dzone.com/articles/spring-async-and-exception
But it's not working: could it be me not being able to implement it, but still.
UPDATE: the wrapped log I get.
|TEST|2014-10-17 17:09:08,999|||059EF53A6C4D2F67E0540003BA7A7C43|[monitoringTaskExecutor-1]|INFO |STDOUT|17:09:08,999 ERROR [LoggingHandler] org.springframework.integration.MessageHandlingException: error occurred in message handler [org.springframework.integration.jdbc.StoredProcOutboundGateway#0]
UPDATE2: the jboss-log4j.xml I'm using
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
<log4j:configuration debug="true" xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="STDFILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
<param name="append" value="true" />
<param name="file" value="/var/share/test/logs/test-ws_out.log" />
<param name="datePattern" value="yyyy-MM-dd" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="TEST|%d|%X{req.remoteHost}|%X{sessionid}|%X{lcontext}|[%t]|%-5p|%c|%m%n|" />
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="STDFILE" />
</root>
</log4j:configuration>
Since you are using ExcutorChannel, any Exception from the downstream flow is wrapped to the ErrorMessage and sent to the default errorChannel: http://docs.spring.io/spring-integration/docs/latest-ga/reference/html/configuration.html#namespace-errorhandler
By default all those exceptions are looged by LoggingHandler under category org.springframework.integration.handler with ERROR level.
From other side you can add ExpressionEvaluatingRequestHandlerAdvice to the <int-jdbc:stored-proc-outbound-gateway>: http://docs.spring.io/spring-integration/docs/latest-ga/reference/html/messaging-endpoints-chapter.html#expression-advice
And get deal with exception just only on that target MessageHandler
I'm trying to run Apache Synapse samples on ubuntu 11.04 64-bit and I have found problem with evaluating XPath expression in sample nr 2.
My XPath expression:
$ <definitions xmlns="http://ws.apache.org/ns/synapse"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ws.apache.org/ns/synapse http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd">
<sequence name="main">
<switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="http://services.samples">
<case regex="IBM">
<!-- the property mediator sets a local property on the *current* message -->
<property name="symbol" value="Great stock - IBM"/>
</case>
<case regex="MSFT">
<property name="symbol" value="Are you sure? - MSFT"/>
</case>
<default>
<!-- it is possible to assign the result of an XPath expression as well -->
<property name="symbol" expression="fn:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)"/>
</default>
</switch>
<log level="custom">
<!-- the get-property() XPath extension function allows the lookup of local message properties
as well as properties from the Axis2 or Transport contexts (i.e. transport headers) -->
<property name="symbol" expression="get-property('symbol')"/>
<!-- the get-property() function supports the implicit message headers To/From/Action/FaultTo/ReplyTo -->
<property name="epr" expression="get-property('To')"/>
</log>
<!-- Send the messages where they are destined to (i.e. the 'To' EPR of the message) -->
<send/>
</sequence>
It is run on following data:
$ <soapenv:Body><m0:getQuote xmlns:m0="http://services.samples"><m0:request><m0:symbol>IBM</m0:symbol></m0:request></m0:getQuote></soapenv:Body></soapenv:Envelope>
And result is:
2011-08-08 15:37:04,227 [-] [HttpClientWorker-1] DEBUG SwitchMediator XPath : //m0:getQuote/m0:request/m0:symbol evaluates to :
2011-08-08 15:37:04,227 [-] [HttpClientWorker-1] DEBUG SwitchMediator None of the switch cases matched - executing default
while it should go to:
$<case regex="IBM">
<!-- the property mediator sets a local property on the *current* message -->
<property name="symbol" value="Great stock - IBM"/>
</case>
Does anyone knows what can be the problem? I have installed that ubuntu few days ago, so there is possibility, that there is something missing on that system.
Try with full xpath..
<switch xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m0="http://services.samples" source="//soapenv:Envelope/soapenv:Body/m0:getQuote/m0:request/m0:symbol">
I'm working with a Google Search Appliance machine using the feed type metadata-and-url.
I posted the feed to the GSA machine sucessfully, but when I do a search (using my appliance URL) to get the XML from the GSA machine, I cannot see the metadata in the returning XML. Should I use some querystring parameter?
Any idea?
This is the xml posted to the GSA machine:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE gsafeed PUBLIC "-//Google//DTD GSA Feeds//EN" "">
<gsafeed>
<header>
<datasource>TestXMLFeed</datasource>
<feedtype>metadata-and-url</feedtype>
</header>
<group>
<record url="http://www.WHATEVERURL" action="add" mimetype="text/html" lock="true">
<metadata>
<meta name="Creator" content="testcreator"/>
<meta name="Project" content="testproject"/>
<meta name="TypeOfContent" content="testtypeofcontent"/>
</metadata>
</record>
</group>
</gsafeed>
This is what I get from the search:
<GSP VER="3.2">
<TM>0.010752</TM>
<Q>Test page</Q>
<PARAM name="q" value="testpage" original_value="testpage"/>
<PARAM name="site" value="test" original_value="test"/>
<PARAM name="sort" value="date:D:L:d1" original_value="date:D:L:d1"/>
<PARAM name="oe" value="UTF-8" original_value="UTF-8"/>
<PARAM name="ie" value="UTF-8" original_value="UTF-8"/>
<PARAM name="ud" value="0" original_value="0"/>
<PARAM name="ip" value="whateverip" original_value="whateverip"/>
<PARAM name="access" value="p" original_value="p"/>
<RES SN="1" EN="1">
<M>1</M>
<XT/>
<R N="1">
<U>http://www.WHATEVERURL</U>
<UE>http://www.WHATEVERURL</UE>
<T>Test title</T>
<RK>8</RK>
<CRAWLDATE>1 Feb 2011</CRAWLDATE>
<FS NAME="date" VALUE=""/>
<S>
Summary test
</S>
<LANG>es</LANG>
<HAS>
<L/>
<C SZ="5k" CID="o7iCf_ghuzAJ" ENC="UTF-8"/>
</HAS>
</R>
</RES>
</GSP>
Add the parameter &getfields=* to your google search appliance search url page.
And for filtering after on those metadata is necessary to add partialfields=Creator:testcreator in the querystring too.