none
Unable to pass variable to WCF-WebHTTP Send Port from XML RRS feed

  • Question

  • Hello,

    I have a simple orchestration which queries a table using WCF-SQL and retuens back a fromdate and to date. I want to pass this as a variable to my WCF-WebHTTP send port however it always errors.

    The XML looks like this:

    <?xml version="1.0" encoding="utf-8"?>
    <SP_DataComAU_DatesResponse xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo">
     <SP_DataComAU_DatesResult>
      <DataSet xmlns="http://schemas.datacontract.org/2004/07/System.Data">
       <xs:schema id="NewDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <xs:element msdata:IsDataSet="true" name="NewDataSet">
         <xs:complexType>
          <xs:sequence>
           <xs:element minOccurs="0" maxOccurs="unbounded" name="NewTable">
            <xs:complexType>
             <xs:sequence>
              <xs:element minOccurs="0" name="fromDate" type="xs:string" />
              <xs:element minOccurs="0" name="toDate" type="xs:string" />
             </xs:sequence>
            </xs:complexType>
           </xs:element>
          </xs:sequence>
         </xs:complexType>
        </xs:element>
       </xs:schema>
       <diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
        <NewDataSet xmlns="">
         <NewTable>
          <fromDate>2017-07-16</fromDate>
          <toDate>2017-07-17</toDate>
         </NewTable>
        </NewDataSet>
       </diffgr:diffgram>
      </DataSet>
     </SP_DataComAU_DatesResult>
     <ReturnValue>0</ReturnValue>
    </SP_DataComAU_DatesResponse>

    The Send port is setup as follows:

    <BtsHttpUrlMapping>
    <Operation Name = "Operation_1" Method="GET" Url="orders?fromdate={FromDate}&amp;todate={ToDate}&amp;ActiveFilter=ActiveOnly" />
    </BtsHttpUrlMapping>

    And variables as follows:

    However i always get the following error:

    System.Net.WebException: The remote server returned an unexpected response: (400) Bad Request.
    The argument cannot be null

    If i dont use variables and hard code the dates in then it works fine.

    Friday, October 6, 2017 9:24 AM

All replies

  • Hi

    Looks like the values are not being promoted.

    Can you inspect the suspended message in Admin Console -> Context Properties?

    Try to create your own message instead of the SQL generated schema. Map from the SQL schema to the new schema that has the date fields. Create a property schema that promotes the two fields in your custom schema. Use this property schema and it's properties in the "Variable Mapping" section on the SendPort.


    Thanks Arindam

    Tuesday, October 10, 2017 1:06 AM
    Moderator