开发者

NSString always same value problem

开发者 https://www.devze.com 2023-01-26 18:56 出处:网络
I created simple iPhone application. I send data to web service. First time when I debug application I hardcoded date like this:

I created simple iPhone application. I send data to web service. First time when I debug application I hardcoded date like this:

NSString *TA_DAY = @"5/6/2009 11:00:00 AM";

Just to check is it ok, and it works. But next time I changed this line to:

NSString *TA_DAY = @"11/23/2010 11:00:00 AM";

When I debug TA_DAY is '11/23...' but when it come to database it is '5/6...' I added [TA_DAY release] but nothing. Any ide开发者_JAVA技巧a what am I doing wrong?

Ok, I found where the problem is but don't know what to do exactly: This is how I send data:

int TA_COUNTER = 666090;
    NSString *TA_DAY = @"6/2/2009 11:00:00 AM";
    NSString *TA_FILEREF = @"sad";
    NSString *TA_PICKUPHOUR = @"12/12/2009 11:00:00 AM";
    NSString *TA_DLVRYCOMPANY = @"sps";
    NSString *TA_AIRLINE = @"BA";
    NSString *TA_AGREEMENT = @"";
...
NSString *soapMsg = 
    [NSString stringWithFormat:
     @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
     "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
     "<soap:Body>"
     "<AddTaxiVoucher xmlns=\"http://??????????/\">"
     "<ta_counter>%i</ta_counter>"
     "<ta_day>%@</ta_day>"
     "<ta_fileref>%@</ta_fileref>"
     "<ta_pickuphour>%@</ta_pickuphour>"
     "<ta_dlvrycompany>%@</ta_dlvrycompany>"
     "<ta_airline>%@</ta_airline>"
     "<ta_agreement>%@</ta_agreement>"
"</AddTaxiVoucher>"
     "</soap:Body>"
     "</soap:Envelope>",TA_COUNTER,TA_DAY,TA_FILEREF,TA_PICKUPHOUR,TA_DLVRYCOMPANY,TA_AIRLINE];

But somehow TA_PICKUPHOUR is saved in database where TA_DAY should be saved. What I did wrong here?

But again... this is the soap massage that I send to WService:

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><AddTaxiVoucher xmlns="http://??????/"><ta_counter>666090</ta_counter><ta_day>6/2/2009 11:00:00 AM</ta_day><ta_fileref>sad</ta_fileref><ta_pickuphour>12/12/2009 11:00:00 AM</ta_pickuphour><ta_dlvrycompany>AKS</ta_dlvrycompany><ta_airline>BA</ta_airline><ta_agreement></ta_agreement><ta_name>VLADA</ta_name><ta_address1>Trg Topolivaca</ta_address1><ta_address2></ta_address2><ta_telephone>064 333 444</ta_telephone>...


I would say that the problem is likely to be one of these:

  1. You're not running the updated version of the iPhone app (so you're using the original code).

  2. The iPhone app is not sending updated data to the web service.

  3. The server app is not actually updating the record at all.

To identify the area of the problem, you could add extra logging or use a packet sniffer.

0

精彩评论

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

关注公众号