The error I get is that the header developer_email wasn't found.
It is difficult to know exactly what google got, so I tested with a
local echo service and this is the sample header that would be sent.
<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:Header>
<developer_email soapenv:actor="" soapenv:mustUnderstand="0"
xmlns="https://sandbox.google.com/api/adsense/v2" xmlns:ns1="https://
sandbox.google.com/api/adsense/v2">sandboxd...@google.com</
developer_email>
<developer_password soapenv:actor="" soapenv:mustUnderstand="0"
xmlns="https://sandbox.google.com/api/adsense/v2" xmlns:ns2="https://
sandbox.google.com/api/adsense/v2">devpass</developer_password>
</soapenv:Header>
<soapenv:Body><ns3:echo_me soapenv:encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/" xmlns:ns3="http://
googleapi"><in_here xsi:type="xsd:string">hello world</in_here></
ns3:echo_me></soapenv:Body>
</soapenv:Envelope>
Here is my CF code thus far. I actually try to set the header two
different ways. The formatting for how the header shows up is the
difference. I tried one way, the other way, and then for fun both.
All same error.
<cfscript>
myvar = CreateObject("webservice", "https://sandbox.google.com/api/
adsense/v2/AccountService?wsdl");
AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
"developer_email", "sandboxd...@google.com");
AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
"developer_password", "devpass");
// Set the password header as a CFML XML object.
doc2 = XmlNew();
doc2.developer_password = XmlElemNew(doc2, "https://www.google.com/
api/adsense/v2", "developer_password");
doc2.developer_password.XmlText = "devpass";
doc = XmlNew();
doc.developer_email = XmlElemNew(doc, "https://www.google.com/api/
adsense/v2", "developer_email");
doc.developer_email.XmlText = "sandboxd...@google.com";
AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
"developer_email", doc);
AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
"developer_password", doc2);
</cfscript>
<cfset servicelist = myvar.getAllSyndicationServices(1)>
<cfdump var="#servicelist#">
The error I get is:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/
envelope/}Server.userException
faultSubcode:
faultString: The request did not contain a header named
'developer_email'.
faultActor:
faultNode:
faultDetail:
{http://www.google.com/api/adsense/v2}code:101
{http://www.google.com/api/adsense/v2}message:The request did not
contain a header named 'developer_email'.
{http://www.google.com/api/adsense/v2}fault:
101
false
The request did not contain a header named 'developer_email'.
''
If I run an echo on setting those headers on my local machine I get
the following:
Echo Code:
<cfscript>
myvar = CreateObject("webservice",
"http://127.0.0.1:8500/googleapi/soaptest.cfc?WSDL");
AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
"developer_email", "sandboxd...@google.com");
AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
"developer_password", "devpass");
// Set the password header as a CFML XML object.
doc2 = XmlNew();
doc2.developer_password = XmlElemNew(doc2, "https://www.google.com/
api/adsense/v2", "developer_password");
doc2.developer_password.XmlText = "devpass";
doc = XmlNew();
doc.developer_email = XmlElemNew(doc, "https://www.google.com/api/
adsense/v2", "developer_email");
doc.developer_email.XmlText = "sandboxd...@google.com";
AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
"developer_email", doc);
AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
"developer_password", doc2);
myvar.echo_me("hello world");
req = getSOAPRequest(myvar);
</cfscript>
<cfoutput>#HTMLCodeFormat(xmlparse(req))#</cfoutput>
XML Output:
<?xml version="1.0" encoding="UTF-8"?>
<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:Header><ns1:developer_email soapenv:actor="http://
schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0"
xmlns:ns1="https://www.google.com/api/adsense/v2"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="soapenc:string">sandboxd...@google.com</
ns1:developer_email><ns2:developer_password soapenv:actor="http://
schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0"
xmlns:ns2="https://www.google.com/api/adsense/v2"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="soapenc:string">devpass</
ns2:developer_password><developer_email soapenv:actor=""
soapenv:mustUnderstand="0" xmlns="https://www.google.com/api/adsense/
v2" xmlns:ns3="https://www.google.com/api/adsense/
v2">sandboxd...@google.com</developer_email><developer_password
soapenv:actor="" soapenv:mustUnderstand="0" xmlns="https://
www.google.com/api/adsense/v2" xmlns:ns4="https://www.google.com/api/
adsense/v2">devpass</developer_password></
soapenv:Header><soapenv:Body><ns5:echo_me
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns5="http://googleapi"><in_here xsi:type="xsd:string">hello
world</in_here></ns5:echo_me></soapenv:Body></soapenv:Envelope>
On Apr 28, 12:26 pm, "Justin Mattson" <j...@google.com> wrote:
> The reason you're getting this error is that the namespace is incorrect in
> the header elements.
>
> xmlns:ns1="https://sandbox.google.com/api/adsense/v2"
>
> should be
>
> xmlns:ns1="https://www.google.com/api/adsense/v2"
>
> Namespaces are the same, regardless of the server you're accessing.
>
> Cheers,
> Justin
> Google AdSense Team
>
> On 4/28/07, Jcyr <j...@joshuacyr.com> wrote:
>
>
>
> > I am stumped on getting the header seen by the api. I am all new to
> > SOAP, so I am sure it is something silly.
>
> > The error I get is that the header developer_email wasn't found.
>
> > It is difficult to know exactly what google got, so I tested with a
> > local echo service and this is the sample header that would be sent.
>
> > <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:Header>
>
> > <developer_email soapenv:actor="" soapenv:mustUnderstand="0"
> > xmlns="https://sandbox.google.com/api/adsense/v2" xmlns:ns1="https://
> > sandbox.google.com/api/adsense/v2">sandboxdevelo...@google.com</
On Apr 28, 2:54 pm, "Justin Mattson" <j...@google.com> wrote:
> Now it appears that you have the headers twice <developer_email> and
> <ns1:developer_email>
>
> Cheers,
> Justin
> Google AdSense Team
>
> On 4/28/07, Jcyr <j...@joshuacyr.com> wrote:
>
>
>
> > Ok, good to know. Doesn't solve the error, but gets one problem out
> > of the way. :-)
>
> > Here is my CF code thus far. I actually try to set the header two
> > different ways. The formatting for how the header shows up is the
> > difference. I tried one way, the other way, and then for fun both.
> > All same error.
>
> > <cfscript>
> > myvar = CreateObject("webservice", "https://sandbox.google.com/api/
> > adsense/v2/AccountService?wsdl");
>
> > AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
> > "developer_email", "sandboxdevelo...@google.com");
>
> > AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
> > "developer_password", "devpass");
>
> > // Set the password header as a CFML XML object.
> > doc2 = XmlNew();
> > doc2.developer_password = XmlElemNew(doc2, "https://www.google.com/
> > api/adsense/v2", "developer_password");
> > doc2.developer_password.XmlText = "devpass";
>
> > doc = XmlNew();
> > doc.developer_email = XmlElemNew(doc, "https://www.google.com/api/
> > adsense/v2", "developer_email");
> > doc.developer_email.XmlText = "sandboxdevelo...@google.com";
> > "developer_email", "sandboxdevelo...@google.com");
>
> > AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
> > "developer_password", "devpass");
>
> > // Set the password header as a CFML XML object.
> > doc2 = XmlNew();
> > doc2.developer_password = XmlElemNew(doc2, "https://www.google.com/
> > api/adsense/v2", "developer_password");
> > doc2.developer_password.XmlText = "devpass";
>
> > doc = XmlNew();
> > doc.developer_email = XmlElemNew(doc, "https://www.google.com/api/
> > adsense/v2", "developer_email");
> > doc.developer_email.XmlText = "sandboxdevelo...@google.com";
>
> > AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
> > "developer_email", doc);
>
> > AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
> > "developer_password", doc2);
>
> > myvar.echo_me("hello world");
> > req = getSOAPRequest(myvar);
> > </cfscript>
>
> > <cfoutput>#HTMLCodeFormat(xmlparse(req))#</cfoutput>
>
> > XML Output:
>
> > <?xml version="1.0" encoding="UTF-8"?>
> > <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:Header><ns1:developer_email soapenv:actor="http://
> > schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0"
> > xmlns:ns1="https://www.google.com/api/adsense/v2"
> > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> > xsi:type="soapenc:string">sandboxdevelo...@google.com</
> > ns1:developer_email><ns2:developer_password soapenv:actor="http://
> > schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0"
> > xmlns:ns2="https://www.google.com/api/adsense/v2"
> > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> > xsi:type="soapenc:string">devpass</
> > ns2:developer_password><developer_email soapenv:actor=""
> > soapenv:mustUnderstand="0" xmlns="https://www.google.com/api/adsense/
> > v2" xmlns:ns3="https://www.google.com/api/adsense/
> > v2">sandboxdevelo...@google.com</developer_email><developer_password
Thanks!
On Apr 29, 1:02 pm, "Justin Mattson" <j...@google.com> wrote:
> Can you post the entire text of the message you're sending with namespace
> qualified headers?
>
> Thanks,
> Justin
> Google AdSense Team
>
Option A:
<?xml version="1.0" encoding="UTF-8"?>
<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:Header>
<ns1:developer_email soapenv:actor="http://schemas.xmlsoap.org/soap/
actor/next" soapenv:mustUnderstand="0" xmlns:ns1="https://
www.google.com/api/adsense/v2" xmlns:soapenc="http://
schemas.xmlsoap.org/soap/encoding/"
xsi:type="soapenc:string">sandboxd...@google.com</
ns1:developer_email>
<ns2:developer_password soapenv:actor="http://schemas.xmlsoap.org/soap/
actor/next" soapenv:mustUnderstand="0" xmlns:ns2="https://
www.google.com/api/adsense/v2" xmlns:soapenc="http://
schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:string">devpass</
ns2:developer_password>
</soapenv:Header>
</soapenv:Envelope>
Option B:
<?xml version="1.0" encoding="UTF-8"?>
<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:Header>
<developer_email soapenv:actor="" soapenv:mustUnderstand="0"
xmlns="https://www.google.com/api/adsense/v2" xmlns:ns1="https://
www.google.com/api/adsense/v2">sandboxd...@google.com</developer_email>
<developer_password soapenv:actor="" soapenv:mustUnderstand="0"
xmlns="https://www.google.com/api/adsense/v2" xmlns:ns2="https://
www.google.com/api/adsense/v2">devpass</developer_password>
</soapenv:Header>
</soapenv:Envelope>
Option A Code:
<cfscript>
myvar = CreateObject("webservice",
"http://127.0.0.1:8500/googleapi/soaptest.cfc?WSDL");
AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
"developer_email", "sandboxd...@google.com");
AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
"developer_password", "devpass");
myvar.echo_me("hello world");
req = getSOAPRequest(myvar);
</cfscript>
Option B Code:
<cfscript>
myvar = CreateObject("webservice",
"http://127.0.0.1:8500/googleapi/soaptest.cfc?WSDL");
// Set the password header as a CFML XML object.
doc2 = XmlNew();
doc2.developer_password = XmlElemNew(doc2, "https://www.google.com/
api/adsense/v2", "developer_password");
doc2.developer_password.XmlText = "devpass";
doc = XmlNew();
doc.developer_email = XmlElemNew(doc, "https://www.google.com/api/
adsense/v2", "developer_email");
doc.developer_email.XmlText = "sandboxd...@google.com";
AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
"developer_email", doc);
AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
"developer_password", doc2);
myvar.echo_me("hello world");
req = getSOAPRequest(myvar);
</cfscript>
On Apr 29, 5:05 pm, Jcyr <j...@joshuacyr.com> wrote:
> Ok Here are two different attempts. This is what I am sending, though
> I an running through my own local echo service to find out exactly how
> the headers are formated.
>
> Option A:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <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:Header>
>
> <ns1:developer_email soapenv:actor="http://schemas.xmlsoap.org/soap/
> actor/next" soapenv:mustUnderstand="0" xmlns:ns1="https://www.google.com/api/adsense/v2" xmlns:soapenc="http://
> schemas.xmlsoap.org/soap/encoding/"
> xsi:type="soapenc:string">sandboxdevelo...@google.com</
> ns1:developer_email>
>
> <ns2:developer_password soapenv:actor="http://schemas.xmlsoap.org/soap/
> actor/next" soapenv:mustUnderstand="0" xmlns:ns2="https://www.google.com/api/adsense/v2" xmlns:soapenc="http://
> schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:string">devpass</
> ns2:developer_password>
>
> </soapenv:Header>
>
> </soapenv:Envelope>
>
> Option B:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <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:Header>
>
> <developer_email soapenv:actor="" soapenv:mustUnderstand="0"
> xmlns="https://www.google.com/api/adsense/v2" xmlns:ns1="https://www.google.com/api/adsense/v2">sandboxdevelo...@google.com</developer_email>
>
> <developer_password soapenv:actor="" soapenv:mustUnderstand="0"
> xmlns="https://www.google.com/api/adsense/v2" xmlns:ns2="https://www.google.com/api/adsense/v2">devpass</developer_password>
>
> </soapenv:Header>
>
> </soapenv:Envelope>
>
> Option A Code:
>
> <cfscript>
> myvar = CreateObject("webservice",
> "http://127.0.0.1:8500/googleapi/soaptest.cfc?WSDL");
>
> AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
> "developer_email", "sandboxdevelo...@google.com");
>
> AddSOAPRequestHeader(myvar, "https://www.google.com/api/adsense/v2",
> "developer_password", "devpass");
>
> myvar.echo_me("hello world");
> req = getSOAPRequest(myvar);
> </cfscript>
>
> Option B Code:
>
> <cfscript>
> myvar = CreateObject("webservice",
> "http://127.0.0.1:8500/googleapi/soaptest.cfc?WSDL");
>
> // Set the password header as a CFML XML object.
> doc2 = XmlNew();
> doc2.developer_password = XmlElemNew(doc2, "https://www.google.com/
> api/adsense/v2", "developer_password");
> doc2.developer_password.XmlText = "devpass";
>
> doc = XmlNew();
> doc.developer_email = XmlElemNew(doc, "https://www.google.com/api/
> adsense/v2", "developer_email");
> ...
>
> read more »
> ...
>
> read more »
> read more �
http://www.usefulconcept.com/index.cfm/2007/4/30/Google-Adsense-API-Headers-with-ColdFusion
On Apr 30, 12:18 pm, "Justin Mattson" <j...@google.com> wrote:
> Yes, that would do it. Sorry that I gave you the wrong namespace.
>
> Cheers,
> Justin
> Google AdSense Team
>
> ...
>
> read more »