Support the ongoing development of Laravel.io →
posted 9 years ago
Requests
Last updated 2 years ago.
0

Thanks to this article, I found a solution to my problem, but I appreciate it if anyone can suggest a better solution.

class SoapController extends Controller
{
  public function soap() {
    $server = new \SoapServer('http://example.com/soap/soap.wsdl');
    $server->setClass('App\SoapClass');

    $response = new Response();
    $response->headers->set("Content-Type","text/xml; charset=utf-8");

    ob_start();
    $server->handle();
    $response->setContent(ob_get_clean());

    return $response
  }
}
Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

fsalehpour fsalehpour Joined 23 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.