Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [XML][PHP]SOAP błąd w pliku wsdl, jak nadpisać określony fragment xml
eMCeH
post
Post #1





Grupa: Zarejestrowani
Postów: 48
Pomógł: 1
Dołączył: 1.04.2012
Skąd: Świętokrzyskie

Ostrzeżenie: (0%)
-----


Witam,

po wywołaniu:
Kod
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        
        <?php
        echo '<br />';
//Utworzenie obiektu klienta SOAP
        $client = new SoapClient("https://ewus.nfz.gov.pl/ws-broker-server-ewus/services/Auth?wsdl");
        $functions = $client->__getFunctions();
        echo '<br />';
        var_export($functions);
        echo '<br />';
//Logowanie
        $user = 'user';
        $pass = 'haslo';
        echo '<br />';
        $sesja = $client->login($user, $pass);
        var_dump($sesja);
        ?>


serwer zgłasza błąd:

Kod
Uncaught SoapFault exception: [soapenv:Server] org.apache.axis2.databinding.ADBException: Unexpected subelement {http://xml.kamsoft.pl/ws/kaas/login_types}login in C:\xampp\htdocs\ewus\index.php:21 Stack trace: #0 C:\xampp\htdocs\ewus\index.php(21): SoapClient->__call('login', Array) #1 C:\xampp\htdocs\ewus\index.php(21): SoapClient->login('user', 'haslo') #2 {main} thrown in C:\xampp\htdocs\ewus\index.php on line 21


na forum Delphi
Kod
http://pl.comp.lang.delphi.narkive.com/1m1aRvZb/import-wsdl-z-adresu-urla.2

znalazłem informację, iż plik definicji usługi zawiera błąd i należy poprawić sekcję login poprzez nadpisanie pobranego kodu z pliku definicji na inny kod
czy możecie mi pomóc w jaki sposób w nadpisać?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
kufalo
post
Post #2





Grupa: Zarejestrowani
Postów: 251
Pomógł: 2
Dołączył: 24.08.2005

Ostrzeżenie: (0%)
-----


na podstawie ich wersji demo wzialem credentials:

Kod
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:auth="http://xml.kamsoft.pl/ws/kaas/login_types">
   <soapenv:Header/>
   <soapenv:Body>
             <auth:login>
                <auth:credentials>
                    <auth:item>
                        <auth:name>domain</auth:name>
                        <auth:value><auth:stringValue>01</auth:stringValue></auth:value>
                    </auth:item>
                    <auth:item>
                        <auth:name>type</auth:name>
                        <auth:value><auth:stringValue>SWD</auth:stringValue></auth:value>
                    </auth:item>
                    <auth:item>
                        <auth:name>idntSwd</auth:name>
                        <auth:value><auth:stringValue>123456789</auth:stringValue></auth:value>
                    </auth:item>
                    <auth:item>
                        <auth:name>login</auth:name>
                        <auth:value><auth:stringValue>TEST</auth:stringValue></auth:value>
                    </auth:item>
                </auth:credentials>
                        <auth:password>qwerty!@#</auth:password>
            </auth:login>
   </soapenv:Body>
</soapenv:Envelope>


Kod
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>
      <ns1:session id="6F3FE3EA6BE54C5630F4F08E6FD0B803" xmlns:ns1="http://xml.kamsoft.pl/ws/common"/>
      <ns1:authToken id="BSbgyPBVy9Ww0B6al0DFuf" xmlns:ns1="http://xml.kamsoft.pl/ws/common"/>
   </soapenv:Header>
   <soapenv:Body>
      <ns1:loginReturn xmlns:ns1="http://xml.kamsoft.pl/ws/kaas/login_types">3</ns1:loginReturn>
   </soapenv:Body>
</soapenv:Envelope>


vad_dump zwraca tylko loginReturn czyli 3

my potrzebujemy session i authToken

Ten post edytował kufalo 2.01.2013, 13:00:46
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 02:20