Hello, Look at this blog, we provide another example of how to do that.

http://www.systemdeveloper.info/2013/11/trace-soap-requestresponse-xml-with.html

I hope you find it helpful


El jueves, 6 de abril de 2006 18:35:06 UTC-4, briguy escribió:
>
> I'm using VB.NET to use the Google API and I want to be able to check
> the SOAP call and trace when I run into unexpected problems.  However,
> this is done "behind-the-scenes" in .NET so I can't see the actually
> SOAP call being generated or returned from the server.  Basically, I
> just add Web References to my project when I want to use the Google
> API.  Is there a way to obtain the actual SOAP call and/or trace before
> and after I call my API function?  Here's some example code:
>
>     Private Function addCampaign(ByVal username As String, ByVal
> password As String) As Object
>
>         Dim camp As Campaign = New Campaign
>         Dim operation As String = ""
>
>         Try
>
>             Dim service As CampaignServiceService = New
> CampaignServiceService
>             service.emailValue = New com.google.adwordsCampaign.email
>             service.emailValue.Text =
> Array.CreateInstance(GetType(String), 1)
>             service.emailValue.Text.SetValue(username, 0)
>             service.passwordValue = New
> com.google.adwordsCampaign.password
>             service.passwordValue.Text =
> Array.CreateInstance(GetType(String), 1)
>             service.passwordValue.Text.SetValue(password, 0)
>             service.useragentValue = New
> com.google.adwordsCampaign.useragent
>             service.useragentValue.Text =
> Array.CreateInstance(GetType(String), 1)
>             service.useragentValue.Text.SetValue("webmetro", 0)
>             service.tokenValue = New com.google.adwordsCampaign.token
>             service.tokenValue.Text =
> Array.CreateInstance(GetType(String), 1)
>             service.tokenValue.Text.SetValue("token", 0)
>
>                     operation = "Add Campaign"
>                     camp.dailyBudget = 3000000
>                     camp.name = "add another one"
>                     camp.status =
> com.google.adwordsCampaign.CampaignStatus.Active
>                     camp.endDate = New Date(Now.Year + 4, 12, 31)
>                     camp.optInSearchNetwork = True
>                     camp.optInContentNetwork = True
>                     camp = service.addCampaign(camp)
>
>         Catch ex As System.Web.Services.Protocols.SoapException
>             errorMsg += nl + operation
>             If Not camp.name Is Nothing Then
>                 If camp.name.Length > 0 Then
>                     errorMsg += nl + " with name: " + camp.name
>                 End If
>             End If
>
>             If Not ex.Detail("ns2:message") Is Nothing Then
>                 errorMsg += nl + "<br>" +
> ex.Detail("ns2:message").InnerText()
>             End If
>
>             If Not ex.Detail("ns3:Trigger") Is Nothing Then
>                 errorMsg += nl + "<br>trigger: " &
> ex.Detail("ns3:trigger").InnerText()
>             End If
>
>             If Not ex.Detail("ns3:violations") Is Nothing Then
>                 Dim violations As String =
> ex.Detail("ns3:violations").InnerText()
>                 Dim doc As New Xml.XmlDocument
>                 doc.InnerXml = "<root>" & violations & "</root>"
>                 Dim root As Xml.XmlElement = doc.DocumentElement
>
>                 For i As Integer = 0 To root.ChildNodes.Count - 1
>
>                     If (Not root.ChildNodes(i)("trigger") Is Nothing)
> And (Not root.ChildNodes(i)("reason") Is Nothing) Then
>                         errorMsg += nl + "<br>Reason: " &
> root.ChildNodes(i)("reason").InnerText()
>                     End If
>                 Next
>             End If
>
>             camp.id = -1
>
>         End Try
>
>         Return camp
>     End Function
>
> Any help would be greatly appreciated.  Thanks.
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to