Tsung. How to continue use the previous Jabber session after HTTP switching to and back? - tsung

I'm trying to create load testing scenario with tsung. I need to use 2 types of session: ts_jabber and ts_http. May I continue use Jabber session after HTTP switching to and back?
This is my code:
<sessions>
<session probability="100" name="session1" type="ts_http">
//some code
<change_type new_type="ts_jabber" host="*****" port="5222" server_type="tcp" store = "true"/>
<request subst="true">
<jabber type="connect" ack="local">
<xmpp_authenticate username="%%_loginForChat%%" passwd="%%_password%%"/>
</jabber>
</request>
<thinktime value="10"></thinktime>
<transaction name="authenticate">
<request>
<jabber type="auth_sasl" ack="local"></jabber></request>
<request>
<jabber type="connect" ack="local"></jabber> </request>
<request>
<jabber type="auth_sasl_bind" ack="local" ></jabber></request>
<request>
<jabber type="auth_sasl_session" ack="local" ></jabber></request>
</transaction>
<change_type new_type="ts_http" host="******" port="80" server_type="tcp"
//some code
<change_type new_type="ts_jabber" host="*******" port="5222" server_type="tcp" />
<request subst="true">
<jabber type="muc:join" ack="local" room="%%_app_id%%_%%_groupChat_room_id%%" nick="%%_loginForChat%%"/>
</request>
</session>
After run this code i get an error: "Error: Unknown msg {tcp_closed, #Port<0.1183>} receive in state wait_ack, stop"
Help me, please.

Related

NLog proper way to show username in asp.net

I'm using NLog and I'm getting the following:
[2021-10-06 11:52:51.1554] [INFO] [AccountController] admin Logged in. |user: notauth::
[2021-10-06 11:53:12.4143] [INFO] [UsersController] User info was changed for "Joe" |user: auth:ApplicationCookie:admin
[2021-10-06 11:53:19.8374] [INFO] [AccountController] admin Logged out. |user: auth:ApplicationCookie:admin
There are 2 issues:
Problem1: when I log who logged in, the user name is still not set.
Problem2: the username in the subsequent logs is shown with a prefix "auth:ApplicationCookie". I do not want that.
Here is my NLog.config
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<targets>
<target name="file" xsi:type="File" archiveFileName="${basedir}/Logs/Archive/nlog-{########}.log"
archiveNumbering = "Date" archiveDateFormat = "yyyyMMdd"
maxArchiveFiles="30" archiveEvery="Day"
fileName="${basedir}/Logs/nlog.log"
layout="[${longdate}] [${uppercase:${level}}] [${logger}] ${message} ${exception:format=tostring}|user: ${identity}"
concurrentWrites="false" keepFileOpen="false"/>
<target name="console" xsi:type="ColoredConsole"
layout="[${longdate}] [${uppercase:${level}}] [${logger:shortName=true}] ${message} ${exception:format=tostring}" />
</targets>
<rules>
<logger name="*" writeTo="console,file" />
</rules>
</nlog>
Any ideas?

Call mediator is throwing an error in WSO2

When I try to use call mediator within the sequence with blocking="true" its throwing an error while send mediator is working properly. Can someone please highlight where i am wrong.
I am using WSO2 APIM 2.6.0
Code:
<call blocking="true">
<endpoint>
<http method="get" uri-template="http://10.10.10.10:10/XYZ/rest/1.0/abc/{uri.var.userId}"/>
</endpoint>
</call>
<respond/>
I am getting below error message:
INFO {org.apache.axis2.transport.http.HTTPSender} - Unable to sendViaGet to url[http://10.10.10.10:10/XYZ/rest/1.0/abc/USERX] {org.apache.axis2.transport.http.HTTPSender}
org.apache.axis2.AxisFault: Transport error: 404 Error:
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:371)
at org.apache.axis2.transport.http.HTTPSender.sendViaGet(HTTPSender.java:109)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:63)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:459)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:286)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:441)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:227)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.sendReceive(BlockingMsgSender.java:490)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.send(BlockingMsgSender.java:382)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:88)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:85)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:547)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:384)
at org.apache.synapse.endpoints.HTTPEndpoint.send(HTTPEndpoint.java:85)
at org.apache.synapse.mediators.builtin.CallMediator.handleBlockingCall(CallMediator.java:164)
at org.apache.synapse.mediators.builtin.CallMediator.mediate(CallMediator.java:119)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.config.xml.AnonymousListMediator.mediate(AnonymousListMediator.java:37)
at org.apache.synapse.config.xml.SwitchCase.mediate(SwitchCase.java:69)
at org.apache.synapse.mediators.filters.SwitchMediator.mediate(SwitchMediator.java:134)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:169)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.mediate(APIManagerExtensionHandler.java:66)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.handleRequest(APIManagerExtensionHandler.java:75)
at org.apache.synapse.rest.API.process(API.java:325)
Try adding this before the call mediator.
<property name="REST_URL_POSTFIX" scope="axis2" action="remove"/>

Error ENTRY VALID ONLY FOR SUBSCRIBER PNR with TravelItineraryAddInfo Sabre

I want call TravelItineraryAddInfo to add passenger to PNR, but api return error ENTRY VALID ONLY FOR SUBSCRIBER PNR , ERR.SWS.HOST.ERROR_IN_RESPONSE.
How can I fix this issue ?
My request
<TravelItineraryAddInfoRQ xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" TimeStamp="2016-05-17T15:30:00-06:00" Version="2.2.0" ReturnHostCommand="false">
<AgencyInfo>
<Address>
<AddressLine>xxxx</AddressLine>
<CityName>xxx</CityName>
<CountryCode>XX</CountryCode>
<PostalCode>xxxx</PostalCode>
<StateCountyProv StateCode="xx"/>
<StreetNmbr>xx</StreetNmbr>
</Address>
</AgencyInfo>
<CustomerInfo>
<ContactNumbers>
<ContactNumber InsertAfter="0" LocationCode="VN" NameNumber="1.1" Phone="984163620" PhoneUseType="H"/>
</ContactNumbers>
<Email Address="xxx#gmail.com" LanguageOverride="O" NameNumber="1.1" Type="CC"/>
<PersonName Infant="false" NameNumber="1.1" PassengerType="ADT">
<GivenName>Smith</GivenName>
<Surname>TEST</Surname>
</PersonName>
</CustomerInfo>
This is response api:
<stl:SystemSpecificResults>
<stl:Message>.ENTRY VALID ONLY FOR SUBSCRIBER PNR</stl:Message>
<stl:ShortText>ERR.SWS.HOST.ERROR_IN_RESPONSE</stl:ShortText>
</stl:SystemSpecificResults>
</stl:Error>

How do I add SSR OSI to SABRE 2.2.1 API

Below is sample request I made, and below is the response I'm getting.
If you can post sample SpecialServiceRq OSI entry request and response sample that would help a lot.
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<SpecialServiceRQ ReturnHostCommand="false" TimeStamp="2018-03-05T19:02:32.219-05:00" Version="2.2.1" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:ns2="http://services.sabre.com/STL/v01">
<SpecialServiceInfo>
<SecureFlight SegmentNumber="A">
<PersonName DateOfBirth="1969-02-25" Gender="M" NameNumber="1.1">
<GivenName>LIAM</GivenName>
<Surname>JACKSON</Surname>
</PersonName>
</SecureFlight>
<Service SSR_Code="OSI">
<Text>CTCE/ACCEPT//TEST.CORP.COMPANY.COM</Text>
</Service>
</SpecialServiceInfo>
</SpecialServiceRQ>]
[03-05-18 19:02:32.462] [SplitAgentBooker_10009498321_10009498321_2139481603] INFO SABREpl_timings - : T:0.234 secs S:ABE_ABEBOOKD01_9RVB_000000000002 A:SpecialServiceLLSRS M:2139481603_37114603_37772403_14 RSP: [<?xml version="1.0" encoding="UTF-8"?>
<SpecialServiceRS Version="2.2.1" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:stl="http://services.sabre.com/STL/v01" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<stl:ApplicationResults status="NotProcessed">
<stl:Error timeStamp="2018-03-05T18:02:32-06:00" type="BusinessLogic">
<stl:SystemSpecificResults>
<stl:Message>.CHECK ENTRY FORMAT.NOT ENT BGNG WITH</stl:Message>
<stl:Message>3OSI CTCE/ACCEPT//TEST.CORP.COMPANY.COM</stl:Message>
<stl:ShortText>ERR.SWS.HOST.ERROR_IN_RESPONSE</stl:ShortText>
</stl:SystemSpecificResults>
</stl:Error>
</stl:ApplicationResults>
</SpecialServiceRS>
If your intention is to create the 3CTCEA/ACCEPT//TEST.CORP.COMPANY.COM-1.1 format, then you don't have to use the SecureFlight node, as that one creates the 3DOCS format.
I would advise to remove it altogether:
<SpecialServiceRQ TimeStamp="2018-03-05T19:02:32.219-05:00" Version="2.2.1" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:ns2="http://services.sabre.com/STL/v01" ReturnHostCommand="true">
<SpecialServiceInfo>
<Service SSR_Code="CTCE" SegmentNumber="A">
<PersonName NameNumber="1.1"/>
<Text>ACCEPT//TEST.CORP.COMPANY.COM</Text>
</Service>
</SpecialServiceInfo>
This way you will create the above format. If this is not the format let me know which one is and I will help with that one as well.

Mule Capturing Oracle DB Change Notification

I'm pretty New to Java and Mulesoft, I have been working on one POC. It's nothing but capturing the Database Change Notification in Mule, where DB polling cannot be implemented due to performance issues & Datamapper cannot be used. Can anyone suggest me the right approach on this. Below is my sample code on which I have been working.
<db:oracle-config name="Oracle_Configuration" host="localhost" port="1521" instance="xe" user="HR" password="hr" doc:name="Oracle Configuration1"/>
<file:connector name="OutPutFile" autoDelete="false" streaming="true" validateConnections="true" doc:name="File" outputAppend="true" outputPattern="#[function:datestamp:dd-MM-yy]_#[function:systime].txt" dynamicNotification="true" writeToDirectory="C:\Users\IBM_ADMIN\MulesoftExamples"/>
<db:oracle-config name="Oracle_Configuration1" url="jdbc:thin.oracle://localhost:1521/HR" doc:name="Oracle Configuration1" transactionIsolation="READ_COMMITTED"/>
<http:request-config name="HTTP_Request_Configuration" host="localhost" port="1521" basePath="alertcapture" doc:name="HTTP Request Configuration"/>
<file:endpoint path="C:\Users\IBM_ADMIN\MulesoftExamples" outputPattern="#[function:datestamp:dd-MM-yy]_#[function:systime].txt" connector-ref="File" name="File" responseTimeout="10000" encoding="UTF-8" doc:name="File"/>
<flow name="alertcaptureFlow">
<poll doc:name="Poll">
<db:select config-ref="Oracle_Configuration" doc:name="ChangeNotify" target="#[flowVars.selectResult]" >
<db:parameterized-query><![CDATA[SELECT * FROM nfevents;]]></db:parameterized-query>
</db:select>
</poll>
<http:request config-ref="HTTP_Request_Configuration" path="/alertcapture/src/main/app" method="GET" doc:name="FetchData"/>
<file:outbound-endpoint path="/alertcapture/src/main/app" outputPattern="#[function:datestamp:dd-MM-yy]_#[function:systime].txt" connector-ref="OutPutFile" responseTimeout="10000" doc:name="Alertcapture" encoding="UTF-8" mimeType="text/xml" ref="File"/>
</flow>
>

Resources