I am getting this error message on HttpWebRequest.GetResponse

Here is my xml string (sXML):

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<SOAP:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"; xmlns="https://
adwords.google.com/api/adwords/v13">
  <SOAP:Header>
    <email>[email protected]</email>
    <password>xxx</password>
    <clientEmail>[email protected]</clientEmail>
    <developerToken>[email protected]++usd</developerToken>
  </SOAP:Header>
  <SOAP:Body>
    <addCampaign>
      <campaign>
        <budgetAmount>100000</budgetAmount>
        <budgetPeriod>Daily</budgetPeriod>
        <geoTargeting>
          <countryTargets>
            <countries>US</countries>
          </countryTargets>
        </geoTargeting>
        <languageTargeting>
          <languages>en</languages>
        </languageTargeting>
        <name>Simple Campaign</name>
        <networkTargeting>
          <networkTypes>SearchNetwork</networkTypes>
          <networkTypes>ContentNetwork</networkTypes>
        </networkTargeting>
        <schedule>
          <intevals>
            <day>Monday</day>
            <endHour>17</endHour>
            <endMinute>0</endMinute>
            <multiplier>1</multiplier>
            <startHour>8</startHour>
            <startMinute>0</startMinute>
          </intevals>
          <intevals>
            <day>Friday</day>
            <endHour>17</endHour>
            <endMinute>0</endMinute>
            <multiplier>1</multiplier>
            <startHour>8</startHour>
            <startMinute>0</startMinute>
          </intevals>
          <status>Enabled</status>
        </schedule>
        <status>Active</status>
      </campaign>
    </addCampaign>
  </SOAP:Body>
</SOAP:Envelope>


Here is my code:

Public Function CreateCampaign() As Boolean

        Try

            Dim ASCIIEnc As New System.Text.ASCIIEncoding
            Dim bPostData As Byte() = Text.Encoding.UTF8.GetBytes
(sXML)

            Dim HttpReq As HttpWebRequest, sServerResponse As String =
""

            HttpReq = HttpWebRequest.Create("https://
sandbox.google.com")

            HttpReq.Timeout = 60000
            HttpReq.Method = "POST"
            HttpReq.ContentType = "text/xml"
            HttpReq.ContentLength = bPostData.Length
            HttpReq.GetRequestStream.Write(bPostData, 0,
bPostData.Length)

            Dim ReadBuffer(bPostData.Length) As Byte, ReadCount As
Integer = 0
            Dim RespStream As Stream =
HttpReq.GetResponse.GetResponseStream()
            Do
                ReadCount = RespStream.Read(ReadBuffer, 0,
ReadBuffer.Length)
                sServerResponse &= ASCIIEnc.GetString(ReadBuffer, 0,
ReadCount)
            Loop While ReadCount > 0
            RespStream.Close()

            Return True
        Catch ex As Exception

        End Try
        Return False
End Function

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to