Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SOAPUI not apply pretty-print format to response

How can I get response as pretty-print xml format.

In coding no problem and got all responses, however response comes as a single line with not pretty-print format applied.

Request Xml

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://ctsnis.att.com/ticket/v1" xmlns:v3="http://cio.att.com/commonheader/v3">
   <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken>
            <wsse:Username>Test_User</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">!TestInterface!</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
      <wsh:WSHeader xmlns:wsh="http://cio.att.com/commonheader/v3">
         <wsh:WSContext>
            <wsh:FromAppId>Test_User</wsh:FromAppId>
            <wsh:SourceIPAddress>test</wsh:SourceIPAddress>
         </wsh:WSContext>
      </wsh:WSHeader>
   </soapenv:Header>
   <soapenv:Body>
      <v1:ListNotificationDetailsRequest>
         <v3:WSHeader>
            <!--Optional:-->
            <v3:WSEndUserToken>
               <!--Optional:-->
               <v3:Token>?</v3:Token>
               <!--Optional:-->
               <v3:TokenType>?</v3:TokenType>
               <!--Zero or more repetitions:-->
               <v3:WSNameValue>
                  <v3:Name>?</v3:Name>
                  <v3:Value>?</v3:Value>
               </v3:WSNameValue>
            </v3:WSEndUserToken>
            <!--Optional:-->
            <v3:WSContext>
               <!--Optional:-->
               <v3:FromAppId>?</v3:FromAppId>
               <!--Optional:-->
               <v3:ToAppId>?</v3:ToAppId>
               <!--Optional:-->
               <v3:Version>
                  <v3:major>?</v3:major>
                  <v3:minor>?</v3:minor>
               </v3:Version>
               <!--Optional:-->
               <v3:SourceIPAddress>?</v3:SourceIPAddress>
               <!--Zero or more repetitions:-->
               <v3:WSNameValue>
                  <v3:Name>?</v3:Name>
                  <v3:Value>?</v3:Value>
               </v3:WSNameValue>
            </v3:WSContext>
            <!--Optional:-->
            <v3:WSCallback>
               <!--Optional:-->
               <v3:URL>?</v3:URL>
               <!--Optional:-->
               <v3:WSCorrelationId>?</v3:WSCorrelationId>
               <!--Optional:-->
               <v3:FaultURL>?</v3:FaultURL>
            </v3:WSCallback>
            <!--Optional:-->
            <v3:WSConversationId>?</v3:WSConversationId>
            <!--Optional:-->
            <v3:WSMessageData>
               <!--Optional:-->
               <v3:MessageId>?</v3:MessageId>
               <!--Optional:-->
               <v3:RefToMessageId>?</v3:RefToMessageId>
               <!--Optional:-->
               <v3:Timestamp>?</v3:Timestamp>
            </v3:WSMessageData>
            <!--Optional:-->
            <v3:WSResponseMessageExpiration>?</v3:WSResponseMessageExpiration>
            <!--Optional:-->
            <v3:WSEnterpriseLogging>
               <!--Optional:-->
               <v3:ApplicationID>?</v3:ApplicationID>
               <!--Optional:-->
               <v3:LoggingKey>?</v3:LoggingKey>
            </v3:WSEnterpriseLogging>
         </v3:WSHeader>
         <v1:TicketNumber>5671671618722</v1:TicketNumber>
      </v1:ListNotificationDetailsRequest>
   </soapenv:Body>
</soapenv:Envelope>

Response XML

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns2:ListNotificationDetailsResponse xmlns="http://cio.att.com/commonheader/v3" xmlns:ns2="http://ctsnis.att.com/ticket/v1"><ns2:ListNotificationDetails><ns2:NotificationDetailsList><ns2:NotificationID>NTMW00127101576</ns2:NotificationID><ns2:SourceID>8888999999</ns2:SourceID><ns2:CUID>zz8000</ns2:CUID><ns2:When>1410053628</ns2:When><ns2:Message>Ticket found in corresponding table. we can use this ticket for further purpose</ns2:Message><ns2:SourceSchemaName>FMS-TroubleTicket</ns2:SourceSchemaName><ns2:Region>SOUTHEAST</ns2:Region><ns2:Market>JACKSONVILLE-PANHANDLE</ns2:Market><ns2:District>ALL</ns2:District><ns2:Zone>ALL</ns2:Zone><ns2:CreateDate>2014-09-07T01:34:05.000Z</ns2:CreateDate><ns2:LastModifiedBy>AR_ESCALATOR</ns2:LastModifiedBy><ns2:ModifiedDate>2014-09-07T01:34:05.000Z</ns2:ModifiedDate><ns2:MethodList/><ns2:Status>Fail</ns2:Status><ns2:NotificationType><ns2:Individual>INDIVIDUAL</ns2:Individual></ns2:NotificationType><ns2:Log>1410053645AR_ESCALATORNo notification sent. No notification method selected.</ns2:Log><ns2:SubmittedBy>AR_ESCALATOR</ns2:SubmittedBy></ns2:NotificationDetailsList></ns2:ListNotificationDetails></ns2:ListNotificationDetailsResponse></soapenv:Body></soapenv:Envelope>
like image 708
Jagadeeshwaran Kuppuraj Avatar asked Mar 19 '23 09:03

Jagadeeshwaran Kuppuraj


2 Answers

Your question is not really clear, I suppose that when you said that you're xml is "unformatted" you means that you want your xml with pretty-print applied (http://en.wikipedia.org/wiki/Prettyprint).

To do so for your response in SOAPUI, you have the follow two options:

  • Right click on the response panel and select Format XML:

enter image description here

  • Other option is to set the Pretty print property of your TestRequest Properties which makes automatically Pretty print format to your responses:

enter image description here

Note that pretty-print only works when XML is well formed, if it's not (some missing tag, not well closed etc) SOAPUI can't pretty-print it.

Hope this helps,

like image 80
albciff Avatar answered Mar 27 '23 20:03

albciff


Just answering to make emphasis on Validate.

On SoapUI 5.3.0

Right click on the xml --> Format XML

If it still doesn't work, even a white space can be a problem (my case).

Right click on the xml --> Validate

Correct errors showed in the console. Example:

line -1: error: Whitespace missing after attribute value 

(it means-> attribute="values"<space needed here>attribute="value")

And try formatting again:

Right click on the xml --> Format XML
like image 43
tec Avatar answered Mar 27 '23 19:03

tec