logo       
Google Custom Search
    AddThis Social Bookmark Button

Problems using nuSOAP for Paypal Requests: msg#00006

Subject: Problems using nuSOAP for Paypal Requests
Hello,

On implementing a paypal connection I run into the following problem. The Soap header is supposed to look like:

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
                   xmlns:xsd="http://www.w3.org/2001/XMLSchema";
                   xmlns:ns2="urn:ebay:apis:CoreComponentTypes"
                   xmlns:ns3="urn:ebay:apis:eBLBaseComponents"
                   xmlns:ns1="urn:ebay:api:PayPalAPI">
  <SOAP-ENV:Header>
    <ns1:RequesterCredentials SOAP-ENV:mustUnderstand="1">
      <Credentials>
        <Username>username</Username>
        <Password>password</Password>
        <Subject>subject</Subject>
      </Credentials>
    </ns1:RequesterCredentials>
  </SOAP-ENV:Header>
[...]
</SOAP-ENV:Envelope>

My code snippet that is supposed to create the header looks like:

function makeHeader() {
  $credentials= array();
  $credentials[]= new soapval("Username",
                              "xs:string",
                              $this->api_username,
                              false,
                              "http://www.w3.org/2001/XMLSchema";);
  $credentials[]= new soapval("Password",
                              "xs:string",
                              $this->api_password,
                              false,
                              "http://www.w3.org/2001/XMLSchema";);
  $credentials[]= new soapval("Subject",
                              "xs:string",
                              $this->api_subject,
                              false,
                              "http://www.w3.org/2001/XMLSchema";);

  $requesterCredentials= new soapval("Credentials",
                                     "ebl:UserIdPasswordType",
                                     $credentials,
                                     false,
                                     "urn:ebay:apis:eBLBaseComponents");
  $header= array();
  $header[]= new soapval("RequesterCredentials",
                         "ebl:CustomSecurityHeaderType",
                         $requesterCredentials,
                         "urn:ebay:api:PayPalAPI",
                         false,
                         array("SOAP-ENV:mustUnderstand" => "1"));

  return $header;
}

later the header is set by using
$client->setHeaders(makeHeader());

The XML that is created by this code looks like:
<SOAP-ENV:Header>
  <Credentials xmlns:ns4194="urn:ebay:apis:eBLBaseComponents"
               xsi:type="ns4194:ebl:UserIdPasswordType">
    <Username xsi:type="xsd:string">username</Username>
    <Password xsi:type="xsd:string">password</Password>
    <Subject xsi:type="xsd:string">signature</Subject>
  </Credentials>
</SOAP-ENV:Header>

I am missing the node RequesterCredentials as the root element of the header but can not see why this is not created. I guess I am missing something here on how to use soapval() correctly.
Does anyone have a suggestion for me?

Thank you.

Ingo Fischer
--
Ingo Fischer
_____________________________________________________________________

Ingo Fischer
1&1 Internet AG
Karlsruhe
Tel.: 0721/91374-0             Secure Internet-Payment:
http://www.1und1.de                           https://ipayment.de
_____________________________________________________________________

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nusoap-general mailing list
Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/nusoap-general

Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>