2

I need to accept an unmodifiable SOAP message that includes some data. It is posted to my WSDL file and then PHP SoapServer. How can I extract specific data (wrapped in an xml key) in the message via my wsdl or php?

Data flow (actions are arrows, with the second arrow originating from the SoapServer.php bubble and receiving a response): Data flow (actions are arrows, with the second arrow originating from the SoapServer.php bubble and receiving a response)

werdnanoslen
  • 102
  • 4
  • 7
  • 22
  • I must admit that I'm puzzled by your question. What are trying to do? Which WSDL where? Where is which client and what server is talking to where? How and why and when and is this stacked? Mabye it helps if you draw some quick graphic showing the data flow. – hakre May 31 '12 at 14:20
  • Good idea, @hakre, give me a minute to draw a flow diagram... – werdnanoslen May 31 '12 at 14:30
  • Kinda how it works: http://imgur.com/diJoW ---- What I need to figure out is how to just get the ID from the first POST from the ecommerce service. Is there another way to expose my SoapServer.php (does all the work) to accept POSTs from the ecommerce service? – werdnanoslen May 31 '12 at 15:01
  • I still have problems to understand that. Probably you should add time to the graphic so it's clear what happens when. Some arrows even go into both directions which is not possible in computing for data. – hakre May 31 '12 at 15:10
  • The double-ended arrow originates from the SoapServer.php bubble and receives a response, referred to as POST (2). The time flow starts at the ecommerce notification POST (1) and continues clockwise in the img. – werdnanoslen May 31 '12 at 15:15
  • still having problems. Take care, it's late here ;) – hakre May 31 '12 at 15:17
  • When my SoapServer.php receives input, it reformats that input into a new message. The problem I have is how to get that input. How can I expose my php script to receive incoming POSTs in SOAP format? Note that I cannot modify what is being POSTed TO my script. – werdnanoslen May 31 '12 at 16:09

1 Answers1

2

Turns out that the best way to do what I'm looking for is simply file_get_contents("php://input").

This is an easy way to trigger scripts by listening for POSTs. I simply point a service's webhook url to the script, which file_get_contents("php://input"), cast to an array, and then simplexml_load_string() to parse it and use one of the keys' data as the parameter for my script.

whoan
  • 8,143
  • 4
  • 39
  • 48
werdnanoslen
  • 102
  • 4
  • 7
  • 22