Forum Discussion

ntupitza's avatar
ntupitza
New Contributor
12 years ago

Web Service Script: ...error while lexing character f when passing additional nodes to a parameter

I am trying to write a script to our web service and i am having an issue passing nodes to a parameter. I.e. <FieldsValues> is dynamic and can take different fields declared as follows <FieldsValuePair FieldName="" FieldValue=""> . I can get this to work in WCFStorm and i can see the xml it generates, but i cannot figure out how to pass these values in the TestComplete Script. I have also tried using <![CDATA[]]> does anyone have any suggestions?



XML from WCFStorm:

<AddEntityRecord>

  <MethodParameters>

    <TenantId>SomeGUID</TenantId>

    <SessionId>SomeGUID</SessionId>

    <EntityId>SomeGUID</EntityId>

    <FieldsValues>&lt;FieldsValues&gt;&lt;FieldValuePair FieldName="Title" FieldValue="TestComplete 1" /&gt;&lt;FieldValuePair FieldName="EntityFormId" FieldValue="SomeGUID" /&gt;&lt;/FieldsValues&gt;</FieldsValues>

    <isRunWorkflow>false</isRunWorkflow>

  </MethodParameters>

</AddEntityRecord>



Script Syntax i have in TestComplete which Results in "...Error while lexing character f"

var cFieldsValue = "&lt;FieldsValues&gt;&lt;FieldValuePair FieldName="Title" FieldValue="TestComplete 2" /&gt;&lt;FieldValuePair FieldName="EntityFormId" FieldValue="568344ef-eb51-4e92-bae8-86b8c3abbcf2" /&gt;&lt;/FieldsValues&gt;";

1 Reply

  • ntupitza's avatar
    ntupitza
    New Contributor
    The Resolution to this issue was using different quotation marks



    var cFieldsValue = ' <FieldsValues><FieldValuePair FieldName= " Title " FieldValue= " TestComplete 1 " '