Question Testing with SoapUI

Contissi

Member
Joined
Apr 16, 2012
Messages
5
Programming Experience
Beginner
I have created a simple service that looks up a case number from an Oracle DB and returns all associated data for that case. I write this data to an XML file and also return it to the client.

My problem is, when I test the service using SoapUI, it adds a beginning CDATA tag to the response and adds additional CDATA closing tags to anywhere in the response where I actually use a CDATA tag (hence closing the tag twice).

Example: <![CDATA[Some text]]> would be returned <![CDATA[Some text]]>]]>

The XML written to the actual XML file looks fine... It is just in the response in SoapUI that it messes up the return XML.

C# code:
C#:
public Case GetCaseInfo(string CaseNumber)
        {
            Case rtnVal = null;
            rtnVal = new Case();
            string caseInformation = "";
            rtnVal.CaseInfo = caseInformation;

            using (OracleConnection objConn = new OracleConnection("Data Source=asdasd; User ID=asdasd; Password=asdasd"))
            {
                OracleCommand objCmd = new OracleCommand("efilingtest.getcasehistory", objConn);
                objCmd.CommandType = CommandType.StoredProcedure;
                OracleParameter returnXml = new OracleParameter("casehistoryxml", OracleType.Clob);
                returnXml.Direction = System.Data.ParameterDirection.ReturnValue;
                objCmd.Parameters.Add(returnXml);

                // Add parameter for caseid
                OracleParameter pPartyInformation = new OracleParameter("caseid", OracleType.Number);
                pPartyInformation.Direction = ParameterDirection.Input;
                pPartyInformation.Value = CaseNumber;
                objCmd.Parameters.Add(pPartyInformation);

                try
                {
                    objConn.Open();
                    objCmd.ExecuteNonQuery();
                    OracleLob myLob = (OracleLob)returnXml.Value;

                    caseInformation = Convert.ToString(myLob.Value);

                    rtnVal.CaseInfo = caseInformation;
                    
                    // CREATE XML OUTPUT FILE
                    WriteToXml(caseInformation, "test.xml");

                    return rtnVal;
                }
                catch (Exception ex)
                {
                    // WRITE EXCEPTION TO LOG FILE
                    WriteToLog(ex, true, ex.Message);
                    string exStr = "The following exception has occurred: " + ex.Message + ". Please check log file for details...";
                    
                    // RETURN EXCEPTION MESSAGE BACK TO THE CLIENT
                    rtnVal.CaseInfo = exStr;
                    return rtnVal;
                }
                finally
                {
                    objConn.Close();
                }
            }
        }


Any ideas why this is happening? Any way for SoapUI to just take the string of XML and not wrap CDATA tags around it to escape it seeing as it has already been done for the returned XML?
 

Latest posts

Back
Top Bottom