SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Apr 2005
    Location
    London, UK
    Posts
    506
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SoapHeader->sessionHeader

    Folks,

    I知 struggling to append my sessionid in the SoapHeader, I知 close, but something is missing.
    My SoapHeader needs to look like this in the request:
    PHP Code:
    <soapenv:Header>
          <
    sil:sessionHeader>
             <
    sil:sessionid>?</sil:sessionid>
          </
    sil:sessionHeader>
       </
    soapenv:Header
    However, when I run my code I知 only able to generate the header like this:
    PHP Code:
    <SOAP-ENV:Header>
    <
    ns2:sessionHeader>
    <
    item>
    <
    key>sessionid</key>
    <
    value>sdfsdf345345sdfsdf345345345B9</value>
    </
    item>
    </
    ns2:sessionHeader>
    </
    SOAP-ENV:Header
    And here is my php code:
    PHP Code:
    $header =  new SoapHeader('http://xxx.xxxxx.com/xxx?wsdl'"sessionHeader", array("sessionid"=>$this->sessionid), false);

            
    $this->soap_client->__setSoapHeaders(array($header)); 
    Any ideas what I知 doing wrong or whats missing?

  2. #2
    SitePoint Evangelist
    Join Date
    Apr 2005
    Location
    London, UK
    Posts
    506
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the sticking point is this bit:
    PHP Code:
    <item
    <
    key>sessionid</key
    <
    value>sdfsdf345345sdfsdf345345345B9</value
    </
    item
    needs to look like this:
    PHP Code:
    <ns:sessionid>sdfsdf345345sdfsdf345345345B9</ns:sessionid

  3. #3
    SitePoint Evangelist
    Join Date
    Apr 2005
    Location
    London, UK
    Posts
    506
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have this now solved. I realized I was using the wrong name space in my SoapHeader() and second I used SoapVar() to pass in the exact format of my <ns:2sessionHeader> and <ns:2sessionid>balue</ns2:....></ns2:....>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •