private ServiceAccesssResp ConvertToResponse(ServiceAccessRespEntity resp, ServiceAccesssReq req, ServiceAccesssReqHead head, ServiceAccesssReqBody body)
        {
            ServiceAccesssResp response = new ServiceAccesssResp()
            {
                Items =
                    new object[]{
                     new ServiceAccesssRespHead()
                     {  Dest_Address = head.Dest_Address,
                          Send_Address = head.Send_Address,
                           TransactionID = resp.Head.TransactionID,
                            Version = resp.Head.Version
                     }
                     , new ServiceAccesssRespBody()
                     {  Response = 
                         new ServiceAccesssRespBodyResponse[]
                         { 
                             new ServiceAccesssRespBodyResponse()
                             {
                                 OrderID = resp.Body.OrderID,
                                  Price = resp.Body.Price,
                                   PushID = resp.Body.PushID,
                                    RetCode = resp.Body.RetCode,
                                     SPID = resp.Body.SPID,
                                      SPServiceID = resp.Body.SPServiceID
                             }
                         }
                     }
                }
            };


            return response;
        }
        public ServiceAccesssResp GetResp(ServiceAccesssReq req)
        {
            if (req != null)
            {
                ServiceAccesssReqBody body = null;
                ServiceAccesssReqHead head = null;
                foreach (var item in req.Items)
                {
                    if (item != null && item is ServiceAccesssReqBody)
                        body = item as ServiceAccesssReqBody;
                    else if (item != null && item is ServiceAccesssReqHead)
                        head = item as ServiceAccesssReqHead;
                }

                using (Aspirecn.Entities.Cssp.CsspEntitiesContainer entities
                     = new CsspEntitiesContainer())
                {
                    ServiceAccessReqEntity reqEntity = AddRequestRecords(body, head, entities);
                    Aspirecn.Entities.Cssp.ServiceAccessRespEntity resp
                        = AddResponseRecords(body, head, entities, reqEntity);

                    entities.ServiceAccessReqEntities.Add(reqEntity);

                    entities.SaveChanges();
                    return this.ConvertToResponse(resp, req, head, body);
                }
            }

            return null;
        }