Reputation: 7361
I am trying to update google contact. When i hit http request with below xml body, i am getting error "Invalid XML Document."
Below is my XML request.
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n
<entry>\n
<category scheme=\"https://schemas.google.com/g/2005#kind\" term=\"https://schemas.google.com/contact/2008#contact\"/>\n
<title>test Sun 1:00pm Kinjal S</title>\n
<gd:name>\n
<gd:fullName>test Sun 1:00pm Kinjal S</gd:fullName>\n</gd:name>
<gd:phoneNumber label=\"Mobile\" primary=\"true\">+6598765432</gd:phoneNumber>
<gd:phoneNumber label=\"Father\">+6598732465</gd:phoneNumber>
<gd:phoneNumber label=\"Friend\">+6589898989</gd:phoneNumber>
<gContact:groupMembershipInfo deleted=\"false\" href=\"https://www.google.com/m8/feeds/groups/[email protected]/base/6\"/>\n
</entry>"
Can someone help me to resolve this issue?
Upvotes: 1
Views: 779
Reputation: 1864
I believe the 2 namespaces gd
and gContact
is not defined. I just added the namespaces and it seems good. Here is the modified XML with dummy namespaces (Please correct it accordingly),
<?xml version="1.0" encoding="UTF-8"?>
<entry
xmlns:gd = "http://www.w3.org/TR/html4/"
xmlns:gContact = "http://www.w3.org/TR/html4/">
<category scheme="https://schemas.google.com/g/2005#kind" term="https://schemas.google.com/contact/2008#contact"/>
<title>test Sun 1:00pm Kinjal S</title>
<gd:name>
<gd:fullName>test Sun 1:00pm Kinjal S</gd:fullName>
</gd:name>
<gd:phoneNumber label="Mobile" primary="true">+6598765432</gd:phoneNumber>
<gd:phoneNumber label="Father">+6598732465</gd:phoneNumber>
<gd:phoneNumber label="Friend">+6589898989</gd:phoneNumber>
<gContact:groupMembershipInfo deleted="false" href="https://www.google.com/m8/feeds/groups/[email protected]/base/6"/>
</entry>
Upvotes: 3