0

I have:

$data = file_get_contents('php://input');

and it returns this:

<soap:Header>
  <wsim:WSEAuthenticateHeader>
     <wsim:Usser>?</wsim:Usser>
     <wsim:Password>?</wsim:Password>
  </wsim:WSEAuthenticateHeader>
</soap:Header>
<soap:Body>
  <wsim:postScormRequest>
     <wsim:item1></wsim:item1>
     <wsim:item2></wsim:item2>
     <wsim:item3></wsim:item3>
  </wsim:postScormRequest>
</soap:'... (length=535)

How can I get the information of the user, password and items?

petezurich
  • 9,280
  • 9
  • 43
  • 57
Juan Medina
  • 164
  • 11
  • This is a duplicate of [How to parse SOAP XML](https://stackoverflow.com/questions/4194489/how-to-parse-soap-xml) . The [accepted answer](https://stackoverflow.com/a/24085540/5517065) should work for your purpose. – mtr.web Apr 04 '18 at 19:36
  • You were using the PHP `SoapClient` in your other questions. Why not use that here? – jjok Apr 05 '18 at 10:28

1 Answers1

1

Your XML is incomplete, as we talk on comments

Bezerra
  • 146
  • 10
  • Thanks a lot, but I can't use nusoap... I try to use simplexml whit `$obj = new SimpleXMLElement($data); var_dump ($obj);` and say _object(SimpleXMLElement)[58]_ and try to cast to string `var_dump ((string) $obj);` and say _string ' ' (length=9)_ – Juan Medina Apr 05 '18 at 09:50
  • There is something wrong with your payload. Where is the XML root tag (soap envelope) and its name Spaces? – Bezerra Apr 05 '18 at 11:08
  • Oh... you are rigth... the xml was wrong... When I fix it I can manage with SimpleXMLElement. Thanks a lot – Juan Medina Apr 06 '18 at 22:43