class OMSoap extends PluginStrategy
{
...............
...............
public function putPickingList(pickingList $pckList)
{
return 'ok';
}
public function putConsegne(consegne $consegne)
{
return 'ok';
}
public function Soap($f3)
{
$server = new SoapServer("src/Modules/OMSoap/app.wsdl", [
'classmap' => LAMBO_SOAP_CLASSMAP
]);
$server->setObject($this);
// $server->addFunction('putPickingList');
// $server->addFunction('putConsegne');
$server->handle();
}
}
If I try to check if all is working with http://localhost/lambo/soap?wsdl, I receive this error:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Bad Request</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>Help please :(
$server->handle($f3->get('BODY'));
$server->handle($f3->get('BODY'));
Any idea please?
public function Soap($f3)
{
if ($f3->get('VERB') == 'POST') {
$server = new SoapServer("src/Modules/OMSoap/app.wsdl", [
'classmap' => LAMBO_SOAP_CLASSMAP
]);
$server->setObject($this);
// $server->addFunction('putPickingList');
// $server->addFunction('putConsegne');
$server->handle($f3->get('BODY'));
} else { // GET
if ($f3->exists('GET.wsdl') || $f3->exists('GET.WSDL')) { // Some clients use uppercase WSDL
header('Content-Type: text/xml; charset="utf-8"');
readfile('src/Modules/OMSoap/app.wsdl'); // might be better to save path in a class const or variable and make sure this resolves to the file
} else {
$f3->error(404); // Not sure what to do for GET if WSDL is not provided.
}
}
}
$f3->route('GET|POST /soap','OMSoap->Soap');
- $f3->route('GET|POST /soap', __NAMESPACE__ . '\OMSoap->Soap');
Have you tried with a SOAP client to ensure that the post works as expected?
--
-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/f3-framework?hl=en
---
You received this message because you are subscribed to the Google Groups "Fat-Free Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to f3-framework...@googlegroups.com.
To post to this group, send email to f3-fra...@googlegroups.com.
Visit this group at https://groups.google.com/group/f3-framework.
To view this discussion on the web visit https://groups.google.com/d/msgid/f3-framework/ab6cb7a9-704d-4347-8672-b37e48ab8df7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.