php + new SoapHeader

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • php + new SoapHeader

    Hallo Zusammen,

    ich versuch mich mal wieder mit php soap.

    Ich möchte eine https verbindung mit Abfrage auf einem ARS BMC MIT Tier Remedyserver durchführen.

    Leider bekomme ich denn Fehler:

    fatal error: Uncaught SoapFault exception: [soapenv:Server.userException] ARERR
    [9338] No authentication information is found: deapvipz in /home//public_html/env/soap
    /SOAPClient.class.php:139

    Wer kann man mir sagen, wie ich korrekt den Header oder genauer gesagt due Authentication hin bekomme?

    Hier mein Code:

    PHP-Code:
    public function __construct($wsdlconf NULL$trace 0$exception false) {
        
    $soapclient_opts = array('local_cert' => 'cert_key.pem');
        
    $this->client =& new SoapClient($wsdlconf, array(
                                
    'proxy_host' => 'proxy..com',
                                
    'proxy_port' => 80,
                                
    'trace' => $trace
                                
    'exceptions' => $exception
                                
    $soapclient_opts));
            
            
    $auth = new stdClass();//define a basic class object
            
    $auth->userName 'xxx';
            
    $auth->password 'xxx';
            
    $authvalues = new SoapVar($authSOAP_ENC_OBJECT);
            
            
    $headers[] = new SoapHeader('OpGetIncident''AuthenticationInfo'authvaluesfalse);

                    
    $this->client->__setSoapHeaders($header);
        }

    public function 
    makeSOAPCall($SOAPMethodName false$parameter = array(),  $getInstanz NULL$soapfault false$resxml false) {

        
    //kommt die Instanz von aussen...
            
    if($getInstanz !== NULL) {
                
    //kopiere die Instanz in den $this
                
    $this->client $getInstanz;
            }
            else {    
                if(
    $SOAPMethodName && is_array($parameter)) {
                    
    #$auth = new stdClass();//define a basic class object
                    #$auth->userName = 'xxx';
                    #$auth->password = 'xxx';
                    #$authvalues = new SoapVar($auth, SOAP_ENC_OBJECT);
                    
                    #$headers[] = new SoapHeader('OpGetIncident', 'AuthenticationInfo', $authvalues, false);
                    #print_r($headers);                        
                    #$this->client->__setSoapHeaders($header);
                    
                    
    $res $this->client->/* SOAP Method Name */$SOAPMethodName(/* Parameters */ $parameter);
                }
                else 
                    return 
    false;
            }    
            
    #print_r($res);
            
    if($soapfault === true) {
                if (
    is_soap_fault($res)) {
                    
    trigger_error("SOAP-Fehler: (Fehlernummer: {$res->faultcode}, "
                    
    ."\n<br />Fehlermeldung: {$res->faultstring})"E_ALL E_NOTICE);
                }
            }
            
    // als xml ausgeben
            
    if($resxml
                return 
    $this->LastRequest();
            else 
    //als array Object
                
    return $res;
        }


    Hier der Aufruf:


    require_once (
    "../soap/SOAPClient.class.php");

    $wsdlconf 'o2_IncidentReader_ssl.wsdl';

    $parameter = array('Request-ID' => 'IMG00000022222');

    $soap = new SOAP($wsdlconf1true);

    $res $soap->makeSOAPCall('OpGetIncident'$parameterNULLtruetrue);

    echo 
    "<pre>";
    print_r($res); 

    Vielen Dank!
    Zuletzt geändert von petro_0; 18.05.2009, 15:15.
    gruss pedro

  • #2
    Ich hab nochmal die Heade rund den Request raus gelassen.

    Hier fehlt komplett der Auth Header. Wie bekomme ich denn rein?

    LastRequestHeaders:

    POST /arsys/services/ARService?server=deapvipz&webService=o2_IncidentReader HTTP/1.1
    Host: deapviy4:8097
    Connection: Keep-Alive
    User-Agent: PHP SOAP 0.1
    Content-Type: text/xml; charset=utf-8
    SOAPAction: "urn2_IncidentReader/OpGetIncident"
    Content-Length: 290

    LastRequest:

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns1="urn2_IncidentReader"><SOAP-ENV:Body><ns1:OpGetIncident>
    <ns1:Request-ID>IMC000000714750</ns1:Request-ID></ns1:OpGetIncident></SOAP-
    ENV:Body></SOAP-ENV:Envelope>

    LastResponse:

    <?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:Body><soapenv:Fault>
    <faultcode>soapenv:Server.userException</faultcode><faultstring>ARERR [9338] No
    authentication information is found: deapvipz</faultstring><detail><ns1:hostname
    xmlns:ns1="http://xml.apache.org/axis/">deuxvi5y</ns1:hostname></detail>
    </soapenv:Fault></soapenv:Body></soapenv:Envelope>

    LastResponseHeaders :

    HTTP/1.1 500 Internal Server Error
    Date: Tue, 19 May 2009 06:04:21 GMT
    Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8h DAV/2 mod_jk/1.2.23
    Connection: close
    Transfer-Encoding: chunked
    Content-Type: text/xml;charset=utf-8
    gruss pedro

    Kommentar


    • #3
      Wie der Service die Authentikation erwartet, wirst du nur aus der Doku von diesem Service erfahren. Da gibt es viele Möglichkeiten.

      Kommentar


      • #4
        Danke für denn Tip.

        Da ich nirgends nach guggn kann, wie ich mich Auth muss, sonst noch wer einen Tip?

        Danke
        gruss pedro

        Kommentar


        • #5
          erledigt

          erledigt!

          Habe eine Lösung gefunden.

          Habe die ganzen SSL Geschichte nun per CURL gelöst.
          gruss pedro

          Kommentar

          Lädt...
          X