AdSense API Samples
Home     Google API Samples     Download Source Code     API Reference     AdSense API Forum     AdSense API Blog    
Account Services Content Services Report Services
Partial Class ApprovalStatusCheck
    Inherits System.Web.UI.Page

    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        CheckStatus()
    End Sub

    Public Sub CheckStatus()
        ' Checks the approval status of a client account. You must have a web reference added to 
        ' the URL "https://sandbox.google.com/api/adsense/v2/AccountService?wsdl" and name the 
        ' webreference as "AdSenseAccounts"
        Dim accountService As New AdSenseAccounts.AccountServiceService()

        ' Set the headers before you call the service method.

        ' Set the developer account email
        accountService.developer_emailValue = New AdSenseAccounts.developer_email()
        accountService.developer_emailValue.Text = New String() {"developer7@google.com"}

        ' Set the develoepr account password
        accountService.developer_passwordValue = New AdSenseAccounts.developer_password()
        accountService.developer_passwordValue.Text = New String() {"devpass"}

        ' Set the client Id. 
        accountService.client_idValue = New AdSenseAccounts.client_id()
        accountService.client_idValue.Text = New String() {txtClientId.Text}

        Try
            Dim status As String = accountService.getApprovalStatus(0)

            Response.Write("Approval status:" & status)

        Catch ex As System.Web.Services.Protocols.SoapException
            Response.Write("<font color=red><B>" & ex.Message & "</B></font>")
        End Try
    End Sub
End Class