MicrosoftDocs / Advertising-docs

Creative Commons Attribution 4.0 International
15 stars 59 forks source link

Unexpected end of file. Following elements are not closed: Header, PriceTableRow, TableRows, AdExtension, AdExtensions, UpdateAdExtensionsRequest, Body, Envelope #693

Closed pijussau closed 5 years ago

pijussau commented 5 years ago

Not sure what I am doing wrong here but I am getting the Unexpected end of file when calling UpdateAdExtensions.

My output is: `

UpdateAdExtensions
  <AuthenticationToken i:nil="false">EwAYA3hlBAAUS26g+KHGWHId2M6BBkwqoP+OSdAAAXutUa8Zxs3uQy7lh+wdCrZy7xL5e3evgCMWEdFc0/u2GLgJIegx1vG7Etzpk+rBN4H7ZjjVhhIS3M8GUXu3TjsTY3fFtdukYzOp+NKoriKE4QnT+EJklpCb8oGPVx2eecpK41tQz7cPbykrY9gCj5JBcUMNjYbRos8hgYa3OjspklzfUmuxisWFxgK2VUn4fE5XABTKLxuc0XP9QKJiiSYhrhXV2XFWwpKlnDRmsYT1+asuxQUnbe+musBK+Gvqd1eXr8SQdNViuyXwuag+jiyFG6bqcBJd/gNYdc0rRV4kpJW0WV3cU7XXflaCzaPW/ZF5FLp3tucoQEeoAuT5jEIDZgAACK8dTXhGeW4c6AFOwzAXlX6z+WRYFznsBZ6tBlrt7HgbBObnH9LOqw3fj8BgcEzTMMcZv5LDySasQreoDj1tQ7QXnVVeqR9DMAX3Y9jzQ0hDZCc8wgQnSR3eaC85CpBINrR1I+tEg/dPGLywxgqEIZuLFEKakWbj1DdRhPq1yJZdAvb4kFJNdYu+qINu4q1bGkuH+lIQgwNAUuJBrchf8tvzZ54PzUEStHyk00DkDfBIk4nKnYVly/XkFK0g+6NSfK/eIGXloTgn1A/RdJZRZfTQW2ReDHb1T80z8pREds1BAEW5e4h/I5S04Qwxf0FLO7PWSdPGWnhVXUjnKEtnXrPQSOveORnrGqgvoBN++9+e+Nj4dHVrRi7s/01JLQVjaY0IuskzcGpDgHJ+DMZI07l3RPeL3JZ08MNDc0OHiJTfMUoQkRUJ+Eoh+nIG8JwYky8eh8i876V8FVXwFPU7/kMDRR6qI6N/iI5BPA4c2m+f+FK0Rov0lp7ympqZabbP11+dl01UjnsBACRRpl5JyMbiXRi+fLga9MHB6Pspv8r9vyO5FfEZG9HeY946p+WPssfJAxMeqASuzTMvW24GYxPnAeScyShdM8NqH+ilHDfrLdaKCTpGK00VQPzpJc3dZgru0bv+L0hJrK3cP1FAqv6SChwC</AuthenticationToken>
  <CustomerAccountId i:nil="false">150209601</CustomerAccountId>
  <CustomerId i:nil="false">250253143</CustomerId>
  <DeveloperToken i:nil="false">11957P0037216643</DeveloperToken>
  </s:Header>
  <s:Body>
  <UpdateAdExtensionsRequest xmlns="https://bingads.microsoft.com/CampaignManagement/v13">
  <AccountId>150209601</AccountId>

  <AdExtensions i:nil="false">

    <AdExtension i:type="PriceAdExtension" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

      <DevicePreference i:nil="false">0</DevicePreference>
      <Id i:nil="false">8177688859952</Id>
      <Status i:nil="false">Active</Status>

      <Type i:nil="false">PriceAdExtension</Type>
      <FinalUrlSuffix i:nil="false"></FinalUrlSuffix>
      <Language i:nil="false">Norwegian</Language>
      <PriceExtensionType i:nil="false">ProductTiers</PriceExtensionType>
      <Version i:nil="false">1</Version>

      <TableRows i:nil="false"><PriceTableRow>

          <CurrencyCode i:nil="false">SEK</CurrencyCode>
          <Description i:nil="false">Leveres umiddelbart</Description>

          <FinalMobileUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a1:string>https://spillhandel.no/the-sims-4-island-living?ref=bing</a1:string>
          </FinalMobileUrls>

          <FinalUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a1:string>https://spillhandel.no/the-sims-4-island-living?ref=bing</a1:string>
          </FinalUrls>

          <Header i:nil="false">The Sims 4: Island Living</Header>
          <Price>338</Price>

                        <PriceQualifier>From</PriceQualifier>
                        <PriceUnit>None</PriceUnit>
        </PriceTableRow><PriceTableRow>

          <CurrencyCode i:nil="false">SEK</CurrencyCode>
          <Description i:nil="false">Leveres umiddelbart</Description>

          <FinalMobileUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a1:string>https://spillhandel.no/the-sims-4-get-to-work-origin?ref=bing</a1:string>
          </FinalMobileUrls>

          <FinalUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a1:string>https://spillhandel.no/the-sims-4-get-to-work-origin?ref=bing</a1:string>
          </FinalUrls>

          <Header i:nil="false">The Sims 4: Get to Work</Header>
          <Price>310</Price>

                        <PriceQualifier>From</PriceQualifier>
                        <PriceUnit>None</PriceUnit>
        </PriceTableRow><PriceTableRow>

          <CurrencyCode i:nil="false">SEK</CurrencyCode>
          <Description i:nil="false">Leveres umiddelbart</Description>

          <FinalMobileUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a1:string>https://spillhandel.no/the-sims-4-expansion-katter-og-hunder-origin?ref=bing</a1:string>
          </FinalMobileUrls>

          <FinalUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a1:string>https://spillhandel.no/the-sims-4-expansion-katter-og-hunder-origin?ref=bing</a1:string>
          </FinalUrls>

          <Header i:nil="false">The Sims 4: Cats & Dogs</Header>
          <Price>277</Price>

                        <PriceQualifier>From</PriceQualifier>
                        <PriceUnit>None</PriceUnit>
        </PriceTableRow><PriceTableRow>

          <CurrencyCode i:nil="false">SEK</CurrencyCode>
          <Description i:nil="false">Leveres umiddelbart</Description>

          <FinalMobileUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a1:string>https://spillhandel.no/the-sims-4-expansion-livet-i-byen-origin?ref=bing</a1:string>
          </FinalMobileUrls>

          <FinalUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a1:string>https://spillhandel.no/the-sims-4-expansion-livet-i-byen-origin?ref=bing</a1:string>
          </FinalUrls>

          <Header i:nil="false">The Sims 4: Livet i byen</Header>
          <Price>297</Price>

                        <PriceQualifier>From</PriceQualifier>
                        <PriceUnit>None</PriceUnit>
        </PriceTableRow><PriceTableRow>

          <CurrencyCode i:nil="false">SEK</CurrencyCode>
          <Description i:nil="false">Leveres umiddelbart</Description>

          <FinalMobileUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a1:string>https://spillhandel.no/the-sims-4-seasons-dlc-origin?ref=bing</a1:string>
          </FinalMobileUrls>

          <FinalUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a1:string>https://spillhandel.no/the-sims-4-seasons-dlc-origin?ref=bing</a1:string>
          </FinalUrls>

          <Header i:nil="false">The Sims 4: Seasons</Header>
          <Price>335</Price>

                        <PriceQualifier>From</PriceQualifier>
                        <PriceUnit>None</PriceUnit>
        </PriceTableRow><PriceTableRow>

          <CurrencyCode i:nil="false">SEK</CurrencyCode>
          <Description i:nil="false">Leveres umiddelbart</Description>

          <FinalMobileUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a1:string>https://spillhandel.no/the-sims-4-expansion-get-together-origin?ref=bing</a1:string>
          </FinalMobileUrls>

          <FinalUrls i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a1:string>https://spillhandel.no/the-sims-4-expansion-get-together-origin?ref=bing</a1:string>
          </FinalUrls>

          <Header i:nil="false">The Sims 4: Get Togheter</Header>
          <Price>304</Price>

                        <PriceQualifier>From</PriceQualifier>
                        <PriceUnit>None</PriceUnit>
        </PriceTableRow></TableRows>

      </AdExtension>
      </AdExtensions>
      </UpdateAdExtensionsRequest>
      </s:Body>
      </s:Envelope>

The error I am getting: a:DeserializationFailedThe formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter https://bingads.microsoft.com/CampaignManagement/v13:AdExtensions. The InnerException message was 'There was an error deserializing the object of type Microsoft.AdCenter.Advertiser.CampaignManagement.Api.DataContracts.V13.AdExtension[]. Unexpected end of file. Following elements are not closed: Header, PriceTableRow, TableRows, AdExtension, AdExtensions, UpdateAdExtensionsRequest, Body, Envelope. Line 141, position 24.'. Please see InnerException for more details.Unexpected end of file. Following elements are not closed: Header, PriceTableRow, TableRows, AdExtension, AdExtensions, UpdateAdExtensionsRequest, Body, Envelope. Line 141, position 24. at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3) at System.Xml.XmlExceptionHelper.ThrowUnexpectedEndOfFile(XmlDictionaryReader reader) at System.Xml.XmlBufferReader.GetByte() at System.Xml.XmlUTF8TextReader.ReadCharRef() at System.Xml.XmlUTF8TextReader.ReadEscapedText() at System.Xml.XmlUTF8TextReader.Read() at System.Xml.XmlDictionaryReader.ReadContentAsString(Int32 maxStringContentLength) at System.Xml.XmlBaseReader.ReadElementContentAsString() at ReadPriceTableRowFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns) at ReadArrayOfPriceTableRowFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString , XmlDictionaryString , CollectionDataContract ) at System.Runtime.Serialization.CollectionDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns) at ReadPriceAdExtensionFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns) at ReadArrayOfAdExtensionFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString , XmlDictionaryString , CollectionDataContract ) at System.Runtime.Serialization.CollectionDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns) at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)System.Xml.XmlExceptionThere was an error deserializing the object of type Microsoft.AdCenter.Advertiser.CampaignManagement.Api.DataContracts.V13.AdExtension[]. Unexpected end of file. Following elements are not closed: Header, PriceTableRow, TableRows, AdExtension, AdExtensions, UpdateAdExtensionsRequest, Body, Envelope. Line 141, position 24. at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.DataContractSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName) at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.PartInfo.ReadObject(XmlDictionaryReader reader, XmlObjectSerializer serializer) at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)System.Runtime.Serialization.SerializationExceptionThe formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter https://bingads.microsoft.com/CampaignManagement/v13:AdExtensions. The InnerException message was 'There was an error deserializing the object of type Microsoft.AdCenter.Advertiser.CampaignManagement.Api.DataContracts.V13.AdExtension[]. Unexpected end of file. Following elements are not closed: Header, PriceTableRow, TableRows, AdExtension, AdExtensions, UpdateAdExtensionsRequest, Body, Envelope. Line 141, position 24.'. Please see InnerException for more details. at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest) at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)System.ServiceModel.Dispatcher.NetDispatcherFaultException</s:Fault></s:Body></s:Envelope>`

As you can see above all the paramenters are included but I am getting that something is wrong. What am I missing?

eric-urban commented 5 years ago

@pijussau I don't see the UpdateAdExtensionsRequest opening tag above. Also the AuthenticationToken, CustomerId, CustomerAccountId, and DeveloperToken tags (open and close) are missing. I see what are presumably the values of each, but no tags. Please double check. Thanks.

pijussau commented 5 years ago

Thank you for answering. Actually found the issue and it was with the & tag inside one of the Ad titles. Had to run an XML verifier on the whole request to find the problem. Anyway, thanks as always!

eric-urban commented 5 years ago

@pijussau thanks for confirming!