Forum Discussion

hastikeyvan's avatar
hastikeyvan
New Contributor
10 years ago

don't get attachment while sending mtom message with wcf in soapUI

I'm implementing a service which receives some string as request and should return back a pdf file in mtom attachment format. When I test it on my own machine with the client forms I can read the data from the content of message but when I checked the output in SOAPUI I found that the message is not sending in mtom format and is sending message in inline format . The raw view of the out put is as follows:

HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 1252359
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
Set-Cookie: ASP.NET_SessionId=itqdxvdxyovixbj1iglyy5n0; path=/; HttpOnly
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 20 Jan 2016 13:13:58 GMT

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><GetMaintenanceProtocolPdfAttachmentResponse xmlns="http://xmlns.scania.com/maintenance/schema/technicalinformationmsgs/v1"><GetMaintenanceProtocolPdfAttachmentResult>JVBERi0xLjQNCiXi48/TDQo

 How can I activate mtom to get the attachment in the output? ( I changed the messageEncoding to Mtom but doesn't work I think)

1 Reply

  • JDR2500's avatar
    JDR2500
    Frequent Contributor

    Hi,
    We call PowerShell from our scripts to compare files.  We then get a return value from PS to determine if the files match.  To accomplish this we use WshShell. Perhaps this could be adapted for your needs.  Below is a VBScript code snippet.

    Here is a link to the docs:  WshShell Object | TestComplete Documentation

    Here is the code we use:

    Set oShell = Sys.OleObject("WScript.Shell") 
      
      '-- Compare the files using Powershell
      s_PowershellInput = "powershell -command Compare-Object -ReferenceObject $(Get-Content '" & RFile & "') -DifferenceObject $(Get-Content '" & TFile & "') | where {$_.SideIndicator -eq '<=' -and !$_.InputObject.StartsWith('#')} | select -ExpandProperty inputObject"
      Set oExec = oShell.Exec(s_PowershellInput)
      oExec.StdIn.Close ' Close standard input before reading output
    
      ' Get PowerShell output with the comparison results
      strOutput = oExec.StdOut.ReadAll
    
      '-- If strOutput is "" then the files matched
      If strOutput = "" Then 
        AtsCompareFilesPS = True
      Else  'Return false and save the output to a text file in the same location as the test file
        AtsCompareFilesPS = False
     End If

     

    • roli62's avatar
      roli62
      Occasional Contributor

      I just called my testedApp "python". 

      The python script it calls works fine from testComplete. The issue is just how to wait for the app to finish and how to get the exit code of "main.py". 

      • rraghvani's avatar
        rraghvani
        Icon for Champion Level 3 rankChampion Level 3

        Once main.py has finished, the exit code is returned back to Python, and not back to TestComplete. Refer to the Python documentation on how to retrieve the exit code.