开发者

Passing parameter to SOAP Web Service Requests Using Visual Studio Team System 2008

How can I pass in the current datetime parameter to a SOAP request? I know you can pass in parameters by开发者_开发百科 adding a datasource to the web test project and reference it like this {{DataSource.TableName.FieldName}}.

But I want to pass in current datetime parameter as a dynamic value (something like DateTime.Now). How do I go about doing this? Below is sample SOAP request that I put into String Body:

<soap:body>
   <MyQuery xmlns="http://something.com">
      <req>
         <QueryType>{{DataSource.Table.QueryType}}</QueryType>
         <Name>{{DataSource.Table.Name}}</Name>
         <RequestDateTime>{{insert DateTime.Now here}}</RequestDatetime>
      </req>
   </MyQuery>
</soap:body>

P.S. Running web test by adding Web Service Request in Visual Studio Team System 2008


Convert it to a coded test. Easy enough to add a Datetime.Now.ToString(format) call.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜