code below - I'm stuck need help

4 views
Skip to first unread message

superzero

unread,
Apr 5, 2007, 6:27:30 PM4/5/07
to AdSense API Forum
I'm looking at the method, request and response which works fine as I
tested so what I'm supposed to do? I need to get this printed to the
client side?? how can I go about doing that please be gentle im a
newbie to soap =)

Method Called
method: createAdSenseAccount
param:
<createAdSenseAccount>
<loginEmail>users_add...@example.com
</loginEmail>
<entityType>Individual
</entityType>
<websiteUrl>http://test.aaa.com
</websiteUrl>
<websiteLocale>en
</websiteLocale>
<usersPreferredLocale>en_US
</usersPreferredLocale>
<emailPromotionPreferences>true
</emailPromotionPreferences>
<synServiceTypes>ContentAds
</synServiceTypes>
<hasAcceptedTCs>true
</hasAcceptedTCs>
</createAdSenseAccount>
Request

POST /api/adsense/v2/AccountService HTTP/1.0
Host: sandbox.google.com
User-Agent: NuSOAP/0.7.2 (1.94)
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
Content-Length: 993


<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:impl="http://www.google.com/api/adsense/v2">
<SOAP-ENV:Header>
<impl:developer_email>devel...@google.com
</impl:developer_email>
<impl:developer_password>devpass
</impl:developer_password>
<impl:client_id>NOT RELEVANT
</impl:client_id>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<createAdSenseAccount>
<loginEmail>users_add...@1234exampletestttt.com
</loginEmail>
<entityType>Individual
</entityType>
<websiteUrl>http://test.aaa.com
</websiteUrl>
<websiteLocale>en
</websiteLocale>
<usersPreferredLocale>en_US
</usersPreferredLocale>
<emailPromotionPreferences>true
</emailPromotionPreferences>
<synServiceTypes>ContentAds
</synServiceTypes>
<hasAcceptedTCs>true
</hasAcceptedTCs>
</createAdSenseAccount>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Cache-control: private
Date: Thu, 05 Apr 2007 22:19:46 GMT
Server: GFE/1.3
Connection: Close


<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Body>

<soapenv:Fault>

<faultcode>soapenv:Server.userException
</faultcode>

<faultstring>The specified email address is already in use.
</faultstring>

<detail>

<ns1:code
xmlns:ns1="http://www.google.com/api/adsense/v2">303
</ns1:code>

<ns2:message
xmlns:ns2="http://www.google.com/api/adsense/v2">The specified
email address is already in use.
</ns2:message>

<ns3:trigger
xmlns:ns3="http://www.google.com/api/adsense/
v2">users_add...@1234exampletestttt.com
</ns3:trigger>

<ns4:fault type="http://www.google.com/api/adsense/
v2:AdSenseApiException"
xmlns:ns4="http://www.google.com/api/adsense/v2">

<ns4:code>303
</ns4:code>

<ns4:internal>false
</ns4:internal>

<ns4:message>The specified email address is already in use.
</ns4:message>

<ns4:trigger>users_add...@1234exampletestttt.com
</ns4:trigger>

</ns4:fault>

</detail>

</soapenv:Fault>

</soapenv:Body>

</soapenv:Envelope>

Fault Code
Fault: 1
Code: soapenv:Server.userException
String: The specified email address is already in use.
Detail:

Justin Mattson

unread,
Apr 5, 2007, 8:09:26 PM4/5/07
to AdSen...@googlegroups.com
Just change the loginEmail address that you're using. The error you're getting means that there is already an AdSense account in the sandbox with that email address.

Cheers,
Justin
Google AdSense Team

superzero

unread,
Apr 5, 2007, 9:36:20 PM4/5/07
to AdSense API Forum
Hi Justin

Actually I was explaining that the method, request and response how am
I supposed to print it to the client end, "New Code" below I'm not
having a problem getting the program to execute properly my issue is
just getting it printed out to the client what steps should I take to
extract the data to the new user?

Method Called
method: createAdSenseAccount
param:
<createAdSenseAccount>

<loginEmail>users_add...@1234exampleteme.com


</loginEmail>
<entityType>Individual
</entityType>
<websiteUrl>http://test.aaa.com
</websiteUrl>
<websiteLocale>en
</websiteLocale>
<usersPreferredLocale>en_US
</usersPreferredLocale>
<emailPromotionPreferences>true
</emailPromotionPreferences>
<synServiceTypes>ContentAds
</synServiceTypes>
<hasAcceptedTCs>true
</hasAcceptedTCs>
</createAdSenseAccount>

Created Publisher
id: ca-pub-4720760633059146
type: ContentAds
$0.00

Click to see the product

On Apr 5, 8:09 pm, "Justin Mattson" <j...@google.com> wrote:
> Just change the loginEmail address that you're using. The error you're
> getting means that there is already an AdSense account in the sandbox with
> that email address.
>
> Cheers,
> Justin
> Google AdSense Team
>

> On 4/5/07, superzero <m...@viralvideo.co.uk> wrote:
>
>
>
> > I'm looking at the method, request and response which works fine as I
> > tested so what I'm supposed to do? I need to get this printed to the
> > client side?? how can I go about doing that please be gentle im a
> > newbie to soap =)
>
> > Method Called
> > method: createAdSenseAccount
> > param:
> > <createAdSenseAccount>

> > <loginEmail>users_address_h...@example.com

> > <impl:developer_email>develop...@google.com


> > </impl:developer_email>
> > <impl:developer_password>devpass
> > </impl:developer_password>
> > <impl:client_id>NOT RELEVANT
> > </impl:client_id>
> > </SOAP-ENV:Header>
> > <SOAP-ENV:Body>
> > <createAdSenseAccount>

> > <loginEmail>users_address_h...@1234exampletestttt.com

> > v2">users_address_h...@1234exampletestttt.com


> > </ns3:trigger>
>
> > <ns4:fault type="http://www.google.com/api/adsense/
> > v2:AdSenseApiException"
> > xmlns:ns4="http://www.google.com/api/adsense/v2">
>
> > <ns4:code>303
> > </ns4:code>
>
> > <ns4:internal>false
> > </ns4:internal>
>
> > <ns4:message>The specified email address is already in use.
> > </ns4:message>
>

> > <ns4:trigger>users_address_h...@1234exampletestttt.com

Justin Mattson

unread,
Apr 5, 2007, 10:46:48 PM4/5/07
to AdSen...@googlegroups.com
I'm not sure I understand your question. You mean, how are you supposed to display the newly created account's id to the user? This depends on what you are using for your implementation. What programming language are you using to interface with the service? In general, the response object contains this information, but the particulars of how you read the response object depend on the language you are using. The sample code should contain an example for whatever you are using.

Cheers,
Justin
Google AdSense Team

superzero

unread,
Apr 5, 2007, 11:04:35 PM4/5/07
to AdSense API Forum
yep im using the php sample to execute the program.

You mean, how are you supposed to
display the newly created account's id to the user? yep thats what I
mean as stupid as it sounds im really a noob at soap not sure why I
took on this job but I would like an idea how am I supposed to get
this info printed client side.

On Apr 5, 10:46 pm, "Justin Mattson" <j...@google.com> wrote:
> I'm not sure I understand your question. You mean, how are you supposed to
> display the newly created account's id to the user? This depends on what you
> are using for your implementation. What programming language are you using
> to interface with the service? In general, the response object contains this
> information, but the particulars of how you read the response object depend
> on the language you are using. The sample code should contain an example for
> whatever you are using.
>
> Cheers,
> Justin
> Google AdSense Team
>

> On 4/5/07, superzero <m...@viralvideo.co.uk> wrote:
>
>
>
> > Hi Justin
>
> > Actually I was explaining that the method, request and response how am
> > I supposed to print it to the client end, "New Code" below I'm not
> > having a problem getting the program to execute properly my issue is
> > just getting it printed out to the client what steps should I take to
> > extract the data to the new user?
>
> > Method Called
> > method: createAdSenseAccount
> > param:
> > <createAdSenseAccount>

> > <loginEmail>users_address_h...@1234exampleteme.com

Justin Mattson

unread,
Apr 5, 2007, 11:09:29 PM4/5/07
to AdSen...@googlegroups.com
Take a look at http://code.google.com/apis/adsense/developer/samples/php/common.php.txt and the showCreatedPublisher() method for some insight into the structure of the response. Note that because NuSOAP handles things a little oddly the structure of the response will be different if you sign the user up for AFC and AFS.

Instead of $response['id'] having the id, $response[0]['id] and $reponse[1]['id'] will contain the two ids.


Cheers,
Justin
Google AdSense Team

superzero

unread,
Apr 5, 2007, 11:23:50 PM4/5/07
to AdSense API Forum
Thanks alot Justin I was so tied up in the code itself, I totally
forgot about common.php
wow I need a vacation and also in common.php everything is foot
printed, wow I'm a noob or I need a tequila & vacation.


On Apr 5, 11:09 pm, "Justin Mattson" <j...@google.com> wrote:
> Take a look athttp://code.google.com/apis/adsense/developer/samples/php/common.php.txtand


> the showCreatedPublisher() method for some insight into the structure of the
> response. Note that because NuSOAP handles things a little oddly the
> structure of the response will be different if you sign the user up for AFC
> and AFS.
>
> Instead of $response['id'] having the id, $response[0]['id] and
> $reponse[1]['id'] will contain the two ids.
>
> Cheers,
> Justin
> Google AdSense Team
>

Reply all
Reply to author
Forward
0 new messages