MSSQL server audit

MSSQL Server Auditing on AWS RDS Enable MSSQL Server Auditing on AWS RDS To enable MSSQL server auditing on AWS RDS, please follow these steps: Login to AWS console and go to RDS. Create an option group under RDS > Option groups Give name as 'SqlServerAudit' Provide description as 'Option group for SQL Server audit' Choose the engine as same as the one used while creating the database in RDS. Choose the latest engine version. Save. Go to RDS > Option groups and select the radio button on the option group you just created Click on Add Option. Select SQLSERVER_AUDIT under “Option name” Choose the S3 bucket name where you want to keep the audit files once they grow more than the specified limit. Choose the appropriate IAM role with write access to the S3 bucket. Scheduling > Immediately and then click on “Add Option“....

Log the SOAP request xml in Mule flow

Hello Reader,

Recently I came across in a situation where I wanted to see the actual SOAP request xml which was sent to Mule endpoint. I tried adding a Logger component as advised on mulesoft blog but the request was not getting logged. So I did some hit and trials in the Mule flow mentioned here to finally make the SOAP request xml print in the logs.

Below is what I did to success :
1. In Anypoint studio, searched for logger component from right pane and dropped it just before the SOAP component. 2. In the "Mule Properties View" of this component, put #[payload] against "message" textbox. This text box is to log whatever you want to log using this component. Since we want whole xml to be logged hence we will use #[payload] 3. Save and run the Mule application. 4. Call the Mule SOAP endpoint using your favorite tool like SOAPUI. 5. You will see below logging in the logs

INFO  2015-04-01 17:11:19,307 [[soap-ws-mule].Connector_Config.worker.01] org.mule.api.processor.LoggerMessageProcessor: org.glassfish.grizzly.utils.BufferInputStream@1edafedb
But this was not that what we intended to print in logs. Here Mule passes the request input stream to the logger component and the logger tries to print it directly using toString() method of the input stream. In order to print the request message in correct format we need to tell Mule to convert the request stream to a String first and then pass it to Logger component.

For this we need add a "Object to String" transformer before the logger component. This transformer will transform the request xml object to a String and pass it to logger component for further processing.

After adding the transformer, restart mule application again and send the soap request again. You can now see the soap request xml in console.

Below is the updated mule flow xml with these 2 new components added (object-to-string-transformer and logger)

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
 xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd">

    <http:listener-config name="Connector_Config" host="localhost" port="8090" 
     doc:name="HTTP Listener Configuration" basePath="mulesvc"/>
    
    <flow name="soap-webservice-muleFlow">
        <http:listener config-ref="Connector_Config" path="sample/soapws/DoubleIt.svc" doc:name="HTTP"/>
        <object-to-string-transformer doc:name="Object to String"/>
        <logger message="#[payload]" level="INFO" doc:name="Logger"/>
        <cxf:jaxws-service service="DoubleIt.svc" serviceClass="com.sample.mule.DoubleItPortType" doc:name="CXF" wsdlLocation="C:\Mule-workspace\workspace\soap-ws-mule\src\main\resources\example-soap-ws.wsdl"/>
        <component class="com.sample.mule.impl.DoubleItPortTypeImpl" doc:name="Java"/>
    </flow>

</mule>

See the highlighted lines above which were added by these 2 new components. Hope this helps.


Comments

  1. Learning new technolgoy would help oneself at hard part of their career. And staying updated is the only way to survive in current position. Your content tells the same. Thanks for sharing this information in here. Keep blogging like this.

    Best JAVA Training institute in Chennai

    ReplyDelete

  2. the blog is about log the soap request xml in mule flow for more updates on mulesoft follow the link
    mulesoft Online Training

    For more info on other technologies go with below links

    tableau online training hyderabad

    ServiceNow Online Training

    Python Online Training

    ReplyDelete
  3. the blog is good and Interactive it is about Mulesoft Anypoint Studio it is useful for students and Mulesoft Developers for more updates on Mulesoft mulesoft Online training hyderabad

    ReplyDelete

Post a Comment

Popular posts from this blog

Unmarshall SOAP Message (XML) to Java Object using JAXB

Circuit breaker implementation in spring boot2

Hibernate inserts duplicate child on cascade