Please, help. I get following exception when I call mutate method of
AdGroupService.
System.InvalidOperationException was unhandled
Message="There was an error generating the XML document."
Source="System.Xml"
StackTrace:
at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter
xmlWriter, Object o, XmlSerializerNamespaces namespaces, String
encodingStyle, String id)
at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter
xmlWriter, Object o, XmlSerializerNamespaces namespaces, String
encodingStyle)
at
System.Web.Services.Protocols.SoapHttpClientProtocol.Serialize
(SoapClientMessage message)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke
(String methodName, Object[] parameters)
at com.google.api.adwords.lib.SoapServiceBase.Call(String
methodName, Object[] parameters) in C:\_Projects
\awapi_dotnet_lib_6.0.0\src\lib\SoapServiceBase.cs:line 135
at com.google.api.adwords.lib.SoapServiceBase.Invoke(String
methodName, Object[] parameters) in C:\_Projects
\awapi_dotnet_lib_6.0.0\src\lib\SoapServiceBase.cs:line 86
at com.google.api.adwords.v200909.AdGroupService.mutate
(AdGroupOperation[] operations) in C:\_Projects
\awapi_dotnet_lib_6.0.0\src\v200909\AdWordsApi.cs:line 10739
at AdWordsGenerator.AdWordsGenerator.ProcessAdGroups
(IEnumerable`1 offerList) in C:\_Projects\Ambar\PriceListParser\AdWords
\AdWordsGenerator.cs:line 223
at AdWordsGenerator.AdWordsGenerator..ctor(OfferView[]
FullOfferView) in C:\_Projects\Ambar\PriceListParser\AdWords
\AdWordsGenerator.cs:line 49
at Ambar.PriceListParser.RefreshPricesForm.RefreshAdWords() in
C:\_Projects\Ambar\PriceListParser\RefreshPricesForm.cs:line 103
at Ambar.PriceListParser.RefreshPricesForm.btnOK_Click(Object
sender, EventArgs e) in C:\_Projects\Ambar\PriceListParser
\RefreshPricesForm.cs:line 97
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m,
MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage
(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc
(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW
(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop
(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner
(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop
(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at Ambar.PriceListParser.MainFormOffer.button2_Click_1(Object
sender, EventArgs e) in C:\_Projects\Ambar\PriceListParser
\MainForm.cs:line 385
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m,
MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage
(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc
(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW
(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop
(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner
(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop
(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Ambar.PriceListParser.Program.Main() in C:\_Projects\Ambar
\PriceListParser\Program.cs:line 18
InnerException: System.InvalidOperationException
Message="The type AmAdGroupOperation was not expected. Use the
XmlInclude or SoapInclude attribute to specify types that are not
known statically."
Source="ggaambfv"
StackTrace:
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterAdGroupService.Write275_AdGroupOperation
(String n, String ns, AdGroupOperation o, Boolean isNullable, Boolean
needType)
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterAdGroupService.Write281_mutate
(Object[] p)
at
Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer5.Serialize
(Object objectToSerialize, XmlSerializationWriter writer)
at System.Xml.Serialization.XmlSerializer.Serialize
(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces,
String encodingStyle, String id)
InnerException:
It looks like there may be a typo in your code somewhere:
"The type AmAdGroupOperation was not expected. Use the XmlInclude or
SoapInclude attribute to specify types that are not known statically."
Best,
- Eric Koleda, AdWords API Team