![]() |
Telelogic TAU (steve huntington) | ![]() |
Topic Title: about problem in EDS(encoding/Decoding system) Topic Summary: Created On: 19-Jul-2005 06:40 Status: Read Only
|
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hello.
I have a question about TTCN3 in TAU Tester when I implemented web service protocol program using TTCN3, I got a problem related to the EDS(Encoding/Decoding System) When I defined the Message type like below. But the result is always "fail" (because of timeout) without any error messages. Otherwise I changed the code like below ( receiving any message without any message format) ==> 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 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; } ================================================ |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.