Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic TAU (steve huntington)
Decrease font size
Increase font size
Topic Title: about Encoding/Decoding (TTCN-3)
Topic Summary:
Created On: 19-Jul-2005 01:35
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 19-Jul-2005 01:35
User is offline View Users Profile Print this message


Hye-Jung Hwang

Posts: 3
Joined: 14-Jul-2005

Hello.


I have a question about TTCN3 in TAU Tester
when I implemented web service protocol program using TTCN3, I got a problem which is related to the EDS(Encoding/Decoding System)

When I defined the Message type like below.
But the result is always "fail" (because of timeout)
Otherwise, I chaged code(TTCN3) to receive any type message
   => portname.receive{.....
the result is pass

so I think EDS(encoding/decoding system) has the problem , 
when received data  is divided into proper fields as defined in data type (ATS) in decoding module of EDS.

I wrote the related code below.
( I can't find any logical & syntax error )

if anyone knows solution, Could you let me know it?

thanks



====
template MsearchRcvMsgType MsearchMsgR :={
 
 httpversion := "HTTP/1.1 200 OK" ,
 cachecontrol:= ?,
    EXT:= ?,
 Location:= ?,
 Server_ST:= ?,
 USN:= ?,
    Dummy := ?
 }

timer RetransTimer2;
   
     MSearchMsgPort.send(MsearchMsgD);
        RetransTimer2.start(30.0); 
     alt {


         [] MSearchMsgPort.receive(MsearchMsgR){     RetransTimer2.stop;
     setverdict(pass);
     stop;
        }
 
           [] RetransTimer2.timeout {
               setverdict(fail); 
            stop;
      }
   
       }        
=======================================
encoding/ Decoding part

3rt_codecs_result_t
msg_decode(t3rt_binary_string_iter_t *encoded_data,
                t3rt_type_t type,  t3rt_value_t *decoded_data,  t3rt_alloc_strategy_t strategy,
                t3rt_context_t ctx)
{
  t3rt_value_t tmp, tmp1,tmp2,tmp3 ;
  t3rt_type_t tmp_type;


  unsigned char string[125];

 int type_kind;

 *decoded_data = t3rt_type_instantiate_value(type, strategy, ctx);

  tmp1 = t3rt_value_field_by_name(*decoded_data, "httpversion", ctx);
  tmp_type =  t3rt_value_type(tmp1, ctx);
   type_kind = t3rt_type_kind(tmp_type, ctx);


  


  t3rt_bstring_iter_get_nbytes(encoded_data, 15, string, ctx);
   string[15] = '\0';
  *decoded_data = t3rt_type_instantiate_value(tmp_type, strategy, ctx);
   t3rt_value_set_string(*decoded_data, string, ctx);
  
  ///////////////////////////////////////////////////////////////


   *decoded_data = t3rt_type_instantiate_value(type, strategy, ctx);
 
   tmp1 = t3rt_value_field_by_name(*decoded_data, "cachecontrol", ctx);
 
   tmp_type =  t3rt_value_type(tmp1, ctx);
   type_kind = t3rt_type_kind(tmp_type, ctx);
 


   t3rt_bstring_iter_get_nbytes(encoded_data, 25, string, ctx);


  string[25] = '\0';

  *decoded_data = t3rt_type_instantiate_value(tmp_type, strategy, ctx);
  t3rt_value_set_string(*decoded_data, string, ctx);
  /////////////////////////////////////////////////////////////////////


  *decoded_data = t3rt_type_instantiate_value(type, strategy, ctx);
 
 
  tmp1 = t3rt_value_field_by_name(*decoded_data, "EXT", ctx);


  tmp_type =  t3rt_value_type(tmp1, ctx);
   type_kind = t3rt_type_kind(tmp_type, ctx);



  t3rt_bstring_iter_get_nbytes(encoded_data, 6, string, ctx);
  string[6] = '\0';


  *decoded_data = t3rt_type_instantiate_value(tmp_type, strategy, ctx);
  t3rt_value_set_string(*decoded_data, string, ctx);
/////////////////////////////////////////////////////////////////////////
*decoded_data = t3rt_type_instantiate_value(type, strategy, ctx);


  tmp1 = t3rt_value_field_by_name(*decoded_data, "Location", ctx);


  tmp_type =  t3rt_value_type(tmp1, ctx);
  type_kind = t3rt_type_kind(tmp_type, ctx);



  t3rt_bstring_iter_get_nbytes(encoded_data, 48, string, ctx);
  string[48] = '\0';


  *decoded_data = t3rt_type_instantiate_value(tmp_type, strategy, ctx);
  t3rt_value_set_string(*decoded_data, string, ctx);

/////////////////////////////////////////////////////////////////////////
 *decoded_data = t3rt_type_instantiate_value(type, strategy, ctx);


  tmp1 = t3rt_value_field_by_name(*decoded_data, "Server_ST", ctx);


  tmp_type =  t3rt_value_type(tmp1, ctx);
  type_kind = t3rt_type_kind(tmp_type, ctx);


  t3rt_bstring_iter_get_nbytes(encoded_data, 52, string, ctx);
  string[52] = '\0';


  *decoded_data = t3rt_type_instantiate_value(tmp_type, strategy, ctx);
  t3rt_value_set_string(*decoded_data, string, ctx);

/////////////////////////////////////////////////////////////////////////
 *decoded_data = t3rt_type_instantiate_value(type, strategy, ctx);
 
  tmp1 = t3rt_value_field_by_name(*decoded_data, "USN", ctx);


  tmp_type =  t3rt_value_type(tmp1, ctx);
  type_kind = t3rt_type_kind(tmp_type, ctx);


  t3rt_bstring_iter_get_nbytes(encoded_data, 63, string, ctx);
  string[63] = '\0';
 
  *decoded_data = t3rt_type_instantiate_value(tmp_type, strategy, ctx);
  t3rt_value_set_string(*decoded_data, string, ctx);

/////////////////////////////////////////////////////////////////////////
  *decoded_data = t3rt_type_instantiate_value(type, strategy, ctx);
 
  tmp1 = t3rt_value_field_by_name(*decoded_data, "Dummy", ctx);
 
  tmp_type =  t3rt_value_type(tmp1, ctx);
  type_kind = t3rt_type_kind(tmp_type, ctx);


 
  t3rt_bstring_iter_get_nbytes(encoded_data,121, string, ctx);
 string[121] = '\0';


  *decoded_data = t3rt_type_instantiate_value(tmp_type, strategy, ctx);
  t3rt_value_set_string(*decoded_data, string, ctx);
 return t3rt_codecs_result_succeeded_c;
   
}
================================================



Edited: 19-Jul-2005 at 06:42 by Hye-Jung Hwang
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic TAU forum.
There are currently 1 users logged in.
The most users ever online was 15 on 31-Mar-2008 at 16:22.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.