Forum Discussion

GregMelb's avatar
GregMelb
Visitor
10 years ago

XML message corruption with Ready API

Hi All,

 

at my company, we have a small Web Service to calculate a building replacment cost.

 

Following is a sample XML request message, cut down to remove company-specific details and to aid clarity:

 

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
      <getBuildingCostRqst>
         <requestHeader>
            <environmentId>I4</environmentId>
            <requestCreatedTime>2015-03-08T10:01:02</requestCreatedTime>
         </requestHeader>
         <bldCalcRqst>
            <effectiveDt>2012-09-03</effectiveDt>  
            <state>ABC</state>   
            <postcode>12345</postcode> 
            <buildingTypeCd>L</buildingTypeCd>
            <constructionTypeCd>C</constructionTypeCd>  
            <yearBuilt>1920</yearBuilt> 
            <noOfLevelsCd>T</noOfLevelsCd>   
            <constructionStdCd>T</constructionStdCd>
            <noOfBedrooms>4</noOfBedrooms> 
         </bldCalcRqst>
      </getBuildingCostRqst>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

This worked perfectly in soapUI free (v4.5.1) when run as a standalone step under a binding and also when run as a test step of a test suite.

 

However, when the same XML step was run a part of a test suite using SoapUI Pro and now with Ready API, I get a soap fault, and the following is shown from using Ready API (v1.2.1):

 

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode>SOAP-ENV:Client</faultcode>
         <faultstring>Conversion from SOAP failed</faultstring>
         <detail>
            <CICSFault xmlns="http://www.ibm.com/software/htp/cics/WSFault">DFHPI1007 09/03/2015 14:37:47 PRI4CICS 04845 XML to data transformation failed because of incorrect input (ARRAY_OVERFLOW getBuildingCostRqst) for WEBSERVICE NPR_PIW_getBuildingCost.</CICSFault>
         </detail>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

Yes, I'm sending the message to a CICS region on an IBM mainframe.

 

When I open up the request XML in Ready API, I see at the bottom of the XML request message:

 

         </bldCalcRqst>
      </getBuildingCostRqst>
  <req:getBuildingCostRqst xmlns:req="http://request.model.policy.companyname.com.au/"><bldCalcRqst/><requestHeader><underwritingCompany/><channel/><product/><brand/><serviceVersion/><environmentId/><rqstTargetService/><messageId/><requestAction/><requestCreatedTime/></requestHeader></req:getBuildingCostRqst></SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

That is, it inserts a whole heaps of tags that really should not be there. 

 

As an aside, when the project was first created in soapUI Free, the default request message created under the binding did have "req:" at the top and bottom of the message. When run as a standalone step, it worked fine. When they were present in an soapUI step though that was part of a testsuite, it caused a soap fault  - this was the case even in SoapUI Free v4.5.1 and was also the case with soapUI Pro.).

So I manually removed them (the "req:" from the top and bottom of the XML request message) and the test suite ran fine. 

 

In the past because SoapUI Pro also messed up the messages, I tended not to use it.

Now that I've started to use Ready API, it's about time I got to the bottom of the problem.

 

So I had the error where "req" got added at the top and bottom. When I removed it, that problem went away.

 

Now I still have the problem of loads of tags AND "req" being present, and causing soap faults.

 

User error perhaps?

Has anyone else experinced a similar problem?

 

Thanks, Greg.

 

 

1 Reply

  • danm's avatar
    danm
    Occasional Visitor

    We also see a similar problem for our webservice using ReadyAPI 1.3.0. This issue is causing our tests to fail.


    We have the following defined within one of our interfaces /WSDL's which can be loaded and saved in to our project:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.services.att.abc/">
    <soapenv:Header/>
    <soapenv:Body>
    <key>
    <eventRef>123456</eventRef>
    <destination>customer</destination>
    </key>
    </soapenv:Body>
    </soapenv:Envelope>



    However after closing and opening ReadyAPI we have noticed that the below is added by ReadyAPI automatically which invalidates our request:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.services.att.abc/">
    <soapenv:Header/>
    <soapenv:Body>
    <key>
    <eventRef>123456</eventRef>
    <destination>customer</destination>
    </key>
    <stat:invoke xmlns:stat="http://status.services.att.abc/"/></soapenv:Body>
    </soapenv:Envelope>

     

    So....

    readyAPI is adding this to the message

    <stat:invoke xmlns:stat="http://status.services.att.abc/"/>

     


    How can we stop this from happening please?

     

    I've also raised a support request as this is a severe one for us.