Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
e4cb612aed | |||
59ea6b1ce0 | |||
7bb849e394 | |||
02722eae8f | |||
b7581f29b0 | |||
dc6e1e0889 | |||
f986400dc2 | |||
67410805ba | |||
2ae7515294 | |||
cdfc3cd5bd | |||
9ac755d86e | |||
321dcf3058 |
@ -95,9 +95,10 @@ class SoapWebServiceController extends ContainerAware
|
||||
)
|
||||
));
|
||||
|
||||
$query = $this->container->get('request')->query;
|
||||
if (!$query->has('wsdl') && !$query->has('WSDL')) {
|
||||
$this->container->get('request')->setRequestFormat('xml');
|
||||
$request = $this->container->get('request');
|
||||
$query = $request->query;
|
||||
if ($query->has('wsdl') || $query->has('WSDL')) {
|
||||
$request->setRequestFormat('wsdl');
|
||||
}
|
||||
|
||||
return $response;
|
||||
|
@ -104,12 +104,8 @@ class BeSimpleSoapExtension extends Extension
|
||||
|
||||
$definition->replaceArgument(1, $defOptions);
|
||||
|
||||
if (!empty($options['classmap'])) {
|
||||
$classmap = $this->createClientClassmap($client, $options['classmap'], $container);
|
||||
$definition->replaceArgument(2, new Reference($classmap));
|
||||
} else {
|
||||
$definition->replaceArgument(2, null);
|
||||
}
|
||||
|
||||
$this->createClient($client, $container);
|
||||
}
|
||||
@ -120,9 +116,11 @@ class BeSimpleSoapExtension extends Extension
|
||||
$definition = new DefinitionDecorator('besimple.soap.classmap');
|
||||
$container->setDefinition(sprintf('besimple.soap.classmap.%s', $client), $definition);
|
||||
|
||||
if (!empty($classmap)) {
|
||||
$definition->setMethodCalls(array(
|
||||
array('set', array($classmap)),
|
||||
));
|
||||
}
|
||||
|
||||
return sprintf('besimple.soap.classmap.%s', $client);
|
||||
}
|
||||
|
@ -6,13 +6,13 @@
|
||||
|
||||
<route id="_webservice_call" pattern="/{webservice}">
|
||||
<default key="_controller">BeSimpleSoapBundle:SoapWebService:Call</default>
|
||||
<default key="_format">soap</default>
|
||||
<default key="_format">xml</default>
|
||||
<requirement key="_method">POST</requirement>
|
||||
</route>
|
||||
|
||||
<route id="_webservice_definition" pattern="/{webservice}">
|
||||
<default key="_controller">BeSimpleSoapBundle:SoapWebService:Definition</default>
|
||||
<default key="_format">wsdl</default>
|
||||
<default key="_format">xml</default>
|
||||
<requirement key="_method">GET</requirement>
|
||||
</route>
|
||||
</routes>
|
||||
|
@ -88,13 +88,19 @@ class Curl
|
||||
curl_setopt($this->ch, CURLOPT_PROXYUSERPWD, $options['proxy_user'] . ':' . $options['proxy_password']);
|
||||
}
|
||||
if (isset($options['login'])) {
|
||||
curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
|
||||
curl_setopt($this->ch, CURLOPT_HTTPAUTH, isset($options['extra_options']['http_auth']) ? $options['extra_options']['http_auth'] : CURLAUTH_ANY);
|
||||
curl_setopt($this->ch, CURLOPT_USERPWD, $options['login'].':'.$options['password']);
|
||||
}
|
||||
if (isset($options['local_cert'])) {
|
||||
curl_setopt($this->ch, CURLOPT_SSLCERT, $options['local_cert']);
|
||||
curl_setopt($this->ch, CURLOPT_SSLCERTPASSWD, $options['passphrase']);
|
||||
}
|
||||
if (isset($options['ca_info'])) {
|
||||
curl_setopt($this->ch, CURLOPT_CAINFO, $options['ca_info']);
|
||||
}
|
||||
if (isset($options['ca_path'])) {
|
||||
curl_setopt($this->ch, CURLOPT_CAPATH, $options['ca_path']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -113,6 +113,11 @@ class SoapClient extends \SoapClient
|
||||
$this->cliWebserverWorkaround = $options['cli_webserver_workaround'];
|
||||
}
|
||||
$this->curl = new Curl($options);
|
||||
|
||||
if (isset($options['extra_options'])) {
|
||||
unset($options['extra_options']);
|
||||
}
|
||||
|
||||
$wsdlFile = $this->loadWsdl($wsdl, $options);
|
||||
// TODO $wsdlHandler = new WsdlHandler($wsdlFile, $this->soapVersion);
|
||||
$this->soapKernel = new SoapKernel();
|
||||
@ -173,6 +178,8 @@ class SoapClient extends \SoapClient
|
||||
$headers = array();
|
||||
}
|
||||
|
||||
$headers = $this->filterRequestHeaders($soapRequest, $headers);
|
||||
|
||||
// execute HTTP request with cURL
|
||||
$responseSuccessfull = $this->curl->exec(
|
||||
$location,
|
||||
@ -253,6 +260,19 @@ class SoapClient extends \SoapClient
|
||||
return $soapResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters HTTP headers which will be sent
|
||||
*
|
||||
* @param SoapRequest $soapRequest SOAP request object
|
||||
* @param array $headers An array of HTTP headers
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function filterRequestHeaders(SoapRequest $soapRequest, array $headers)
|
||||
{
|
||||
return $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get last request HTTP headers.
|
||||
*
|
||||
@ -354,7 +374,7 @@ class SoapClient extends \SoapClient
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function loadWsdl($wsdl, array $options)
|
||||
protected function loadWsdl($wsdl, array $options)
|
||||
{
|
||||
// option to resolve wsdl/xsd includes
|
||||
$resolveRemoteIncludes = true;
|
||||
|
Reference in New Issue
Block a user