I check everything. It is hard to debug based on just these few things. Debug Console printed both objects in NSLog Objective-C NSString. If you convert them into NSString to compare, it doesn't look different.
I assume the error you receive is 500 error - server error. You may want to build a server script to test and compare both XML responses. On Sat, Jan 22, 2011 at 8:31 AM, Doc Tag <[email protected]> wrote: > A little more info. If I construct an GDataXMLElement using a string > (initWithXMLString:error) I can successfully upload to GoogleHealth. > If I construct the same element using the addChild message it is > rejected. > > Here are the two elements when logging using the description of the > element. Although they appear to be the same according to the > isEqualToString method they are not equal. > > 2011-01-22 11:24:48.115 DocTag[53096:207] GDataXMLElement 0x10b79db0: > {type:1 name:ContinuityOfCareRecord xml:"<ContinuityOfCareRecord > xmlns="urn:astm- > > org:CCR"><Body><Medications><Medication><Product><ProductName><Text>TestMed</ > Text></ProductName></Product></Medication></Medications></Body></ > ContinuityOfCareRecord>"} > > 2011-01-22 11:24:48.121 DocTag[53096:207] GDataXMLElement 0x10b7ae00: > {type:1 name:ContinuityOfCareRecord xml:"<ContinuityOfCareRecord > xmlns="urn:astm- > > org:CCR"><Body><Medications><Medication><Product><ProductName><Text>TestMed</ > Text></ProductName></Product></Medication></Medications></Body></ > ContinuityOfCareRecord>"} > > Here is the code used to construct each element: > > initWithXMLString code > ---------------------------------------------------- > NSString* pstring = @"<ContinuityOfCareRecord xmlns=\"urn:astm-org:CCR > \"><Body><Medications><Medication><Product><ProductName><Text>TestMed</ > Text></ProductName></Product></Medication></Medications></Body></ > ContinuityOfCareRecord>"; > > GDataXMLElement* root = [GDataXMLNode alloc]; > [root initWithXMLString:pstring error:nil]; > ---------------------------------------------------- > > > > addChild code > ---------------------------------------------------- > //Create root xml element > GDataXMLElement* root = [GDataXMLElement > elementWithName:@"ContinuityOfCareRecord"]; > GDataXMLNode* attribute = [GDataXMLNode attributeWithName:@"xmlns" > stringValue:@"urn:astm-org:CCR"]; > [root addAttribute:attribute]; > > //Create body branch child elements > GDataXMLElement* body = [GDataXMLNode elementWithName:@"Body"]; > GDataXMLElement* medications = [GDataXMLNode > elementWithName:@"Medications"]; > GDataXMLElement* medication = [GDataXMLNode > elementWithName:@"Medication"]; > GDataXMLElement* product = [GDataXMLNode elementWithName:@ > "Product"]; > GDataXMLElement* productname = [GDataXMLNode > elementWithName:@"ProductName"]; > GDataXMLElement* text = [GDataXMLNode elementWithName:@"Text" > stringValue:@"TestMed"]; > > //Add children to body branches > [productname addChild:text]; > [product addChild:productname]; > [medication addChild:product]; > [medications addChild:medication]; > [body addChild:medications]; > > //Add branches to root > [root addChild:body]; > > ---------------------------------------------------- > > Thanks in advance, > DT > > > > > > On Jan 21, 4:40 pm, "Paul (Google)" <[email protected]> wrote: > > It definitely would be helpful to see the XML (Atom+CCR) that's being > posted > > by the code. Is it possible to capture it somehow before it's sent to > the > > service? > > > > Paul > > -- > You received this message because you are subscribed to the Google Groups > "Google Health Developers" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<googlehealthdevelopers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/googlehealthdevelopers?hl=en. > > -- Bess Ho UI Architect / Developer / Designer iPhone Developer Silicon Valley Web Builder (SVWB) Founder The information transmitted is intended only for the person or entity to which it is addressed and may contain CONFIDENTIAL material. If you receive this material/information in error, please contact the sender and delete or destroy the material/information. -- You received this message because you are subscribed to the Google Groups "Google Health Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/googlehealthdevelopers?hl=en.
