diff --git a/src/BeSimple/SoapBundle/Controller/SoapWebServiceController.php b/src/BeSimple/SoapBundle/Controller/SoapWebServiceController.php
index 952ad39..d65e434 100644
--- a/src/BeSimple/SoapBundle/Controller/SoapWebServiceController.php
+++ b/src/BeSimple/SoapBundle/Controller/SoapWebServiceController.php
@@ -92,10 +92,8 @@ class SoapWebServiceController extends ContainerAware
));
$query = $this->container->get('request')->query;
- if ($query->has('wsdl') || $query->has('WSDL')) {
- $response->headers->set('Content-Type', 'application/wsdl+xml');
- } else {
- $response->headers->set('Content-Type', 'text/xml');
+ if (!$query->has('wsdl') && !$query->has('WSDL')) {
+ $this->container->get('request')->setRequestFormat('xml');
}
return $response;
diff --git a/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php b/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php
index 941cbf0..3db1218 100644
--- a/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php
+++ b/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php
@@ -40,6 +40,8 @@ class BeSimpleSoapExtension extends Extension
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
+ $loader->load('request.xml');
+
$loader->load('loaders.xml');
$loader->load('converters.xml');
$loader->load('webservice.xml');
diff --git a/src/BeSimple/SoapBundle/EventListener/RequestFormatListener.php b/src/BeSimple/SoapBundle/EventListener/RequestFormatListener.php
new file mode 100644
index 0000000..3fbabd6
--- /dev/null
+++ b/src/BeSimple/SoapBundle/EventListener/RequestFormatListener.php
@@ -0,0 +1,15 @@
+getRequest()->setFormat('wsdl', 'application/wsdl+xml');
+ $event->getRequest()->setFormat('soap', 'application/soap+xml');
+ }
+}
diff --git a/src/BeSimple/SoapBundle/Resources/config/request.xml b/src/BeSimple/SoapBundle/Resources/config/request.xml
new file mode 100644
index 0000000..0fb4690
--- /dev/null
+++ b/src/BeSimple/SoapBundle/Resources/config/request.xml
@@ -0,0 +1,16 @@
+
+
+
+
+ BeSimple\SoapBundle\EventListener\RequestFormatListener
+
+
+
+
+
+
+
+
+
diff --git a/src/BeSimple/SoapBundle/Resources/config/routing/webservicecontroller.xml b/src/BeSimple/SoapBundle/Resources/config/routing/webservicecontroller.xml
index 98e80e4..b2ce4c0 100644
--- a/src/BeSimple/SoapBundle/Resources/config/routing/webservicecontroller.xml
+++ b/src/BeSimple/SoapBundle/Resources/config/routing/webservicecontroller.xml
@@ -6,13 +6,13 @@
BeSimpleSoapBundle:SoapWebService:Call
- xml
+ soap
POST
BeSimpleSoapBundle:SoapWebService:Definition
- xml
+ wsdl
GET