Cant display the results, Please help me!!!!!!!

Oct 28, 2010 at 10:23 PM

I am newbie to this mailchimp and trying to create simple application.
I am using ASP.net 3.5 and VB. I added reference to an
PerceptiveMCAPI.dll. Its not giving error and its not displaying
anything in the label.Please help me. This is my Code.

Default.aspx
        ..............................

.............................
        ...........................................................
       <asp:GridView ID="GridView1" runat="server">
       </asp:GridView>
       <asp:Label ID="Label1" runat="server" Text="Label"></
asp:Label>
       <asp:Label ID="Label2" runat="server" Text="Label"></
asp:Label>
        ...........................................................
        ...........................................................

Defult.aspx.vb

Imports PerceptiveMCAPI
Imports PerceptiveMCAPI.Types
Imports PerceptiveMCAPI.Methods


Partial Public Class _Default
   Inherits System.Web.UI.Page

   Private AccessType As EnumValues.AccessType =
MCAPISettings.default_AccessType
   Private OutputType As EnumValues.OutputType =
MCAPISettings.default_OutputType
   Private MethodType As EnumValues.MethodType =
MCAPISettings.default_MethodType
   Private EncodeRequest As Boolean =
MCAPISettings.default_EncodeRequest
   Private ValidateRequest As Boolean =
MCAPISettings.default_Validate

  ' Dim userid As String = "yyy1"
  ' Dim password As String = "yyy2"
   Dim apikey As String = "yyy3-us2"

   Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
             Whatever1()
   End Sub

   Structure Outer
       Dim Inner1 As Date
       Dim Inner2 As String
       Dim Inner3 As String
       Dim Inner4 As String
 End Structure


   Private Sub Whatever1()
       Dim input As listBatchSubscribeInput = New
listBatchSubscribeInput()
       input.api_Validate = False
       Input.api_AccessType = EnumValues.AccessType.Serial
       Input.api_OutputType = EnumValues.OutputType.JSON

       Dim gAccountInput As getAccountDetailsInput = New
getAccountDetailsInput(apikey)
       Dim gAccountDetails As getAccountDetails = New
getAccountDetails(gAccountInput)
       Dim gAccountOutput As getAccountDetailsOutput =
gAccountDetails.Execute()

       Dim StructInstance As Outer
       'StructInstance.Inner1 = gAccountOutput.result.username
       StructInstance.Inner2 = gAccountOutput.result.username
       StructInstance.Inner3 = gAccountOutput.result.user_id
       StructInstance.Inner4 = gAccountOutput.result.timezone

       Dim StructInstance2 As Outer2
       StructInstance2.Inner1 = gcampaignTemplatesOutput.result

       Label1.Text = StructInstance.Inner2
       Label2.Text = StructInstance.Inner4

   End Sub

End Class


Web.config i added this bit
<section name="MailChimpAPIconfig"
type="PerceptiveMCAPI.MCAPISettings, PerceptiveMCAPI"/>
<MailChimpAPIconfig>
               <MCAPI
               SecureAccess="true"
               Validate="true"
               />
</MailChimpAPIconfig>
Coordinator
Oct 29, 2010 at 5:19 AM

If you're trying to test a simple application, why put all the garbage in there that you have...

What do you mean by 'not giving an error' -- just because the program doesn't blow up, doesn't mean there are no errors. Did you check the api_ErrorMessages?

You have Validate=true specified in the web.config -- did you check to see if there are validation errors -- if yes, the api method won't execute, so no result.

What is the listBatchSubscribe doing there?

What is the gcampaignTemplatesOutput.result there?

Have you gotten anything to work, like ping()?

I think that you are trying to get information from the account details; but who knows.

I'm afraid I'm not looking at this until it's cleaned up.

dbm

Nov 2, 2010 at 2:16 AM

Hi David,

Thanks for the little nudge, in the config file i forgot to add datacenter=us2.

thanks anyway.

vettr