Service Virtualization

  • 1.  Virtual service with mime response

    Posted May 16, 2016 06:53 AM

    Hi ,

     

    I am trying to create a virtual service using soap request ,where in for the one soap request I need to retrieve a xml response and binary attachment from a response object in DEV TEST 8.1 .In simple words I am trying to create multipart mime responses. Can somebody help me on this.

     

    Regards,

    Ashwath.S



  • 2.  Re: Virtual service with mime response

    Posted May 16, 2016 10:18 AM

    For example I need the multipart mime responses as below:

    POST http://localhost:8001/services/Calculator.CalculatorHttpsSoap11Endpoint/ HTTP/1.1

    Accept-Encoding: gzip,deflate

    Content-Type: multipart/related; type="text/xml"; start="<rootpart@soapui.org>"; boundary="----=_Part_0_498003.1463404806228"

    SOAPAction: "urn:add"

    MIME-Version: 1.0

    Content-Length: 4621

    Host: localhost:8001

    Connection: Keep-Alive

    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

     

     

     

     

    ------=_Part_0_498003.1463404806228

    Content-Type: text/xml; charset=UTF-8

    Content-Transfer-Encoding: 8bit

    Content-ID: <rootpart@soapui.org>

     

     

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema">

      <soapenv:Body>

        <add xmlns="http://c.b.a">

          <!--n1 is optional-->

          <n1>1</n1>

          <!--n2 is optional-->

          <n2>1</n2>

        </add>

      </soapenv:Body>

    </soapenv:Envelope>

    ------=_Part_0_498003.1463404806228

    Content-Type: application/pdf; name=test.pdf

    Content-Transfer-Encoding: binary

    Content-ID: <test.pdf>

    Content-Disposition: attachment; name="test.pdf"; filename="test.pdf"

     

     

    %PDF-1.2

    %âãÏÓ

    3 0 obj

    <<

    /Linearized 1

    /O 5

    /H [ 760 157 ]

    /L 3908

    /E 3658

    /N 1

    /T 3731

    >>

    endobj

                                                                    xref

    3 15

    0000000016 00000 n

    0000000644 00000 n

    0000000917 00000 n

    0000001068 00000 n

    0000001224 00000 n

    0000001410 00000 n

    0000001589 00000 n

    0000001768 00000 n

    0000002197 00000 n

    0000002383 00000 n

    0000002769 00000 n

    0000003172 00000 n

    0000003351 00000 n

    0000000760 00000 n

    0000000897 00000 n

    trailer

    <<

    /Size 18

    /Info 1 0 R

    /Root 4 0 R

    /Prev 3722

    /ID[<d70f46c5ba4fe8bd49a9dd0599b0b151><d70f46c5ba4fe8bd49a9dd0599b0b151>]

    >>

    startxref

    0

    %%EOF

         

    4 0 obj

    <<

    /Type /Catalog

    /Pages 2 0 R

    /OpenAction [ 5 0 R /XYZ null null null ]

    /PageMode /UseNone

    >>

    endobj

    16 0 obj

    << /S 36 /Filter /FlateDecode /Length 17 0 R >>

    stream

    H‰b``àe``úÁ

    Regards,

    Ashwath.S



  • 3.  Re: Virtual service with mime response

    Posted May 17, 2016 10:15 AM

    similar to I need to stub an XML request that gets SOAP Response + PDF Attachment(Binary Format)

     

    Can we achieve this using lisa visualization? or does it require any customization.