diff options
Diffstat (limited to 'ext/soap')
70 files changed, 74 insertions, 3 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 97a79a349e..ee28d99dc0 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -1834,11 +1834,12 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * zend_hash_internal_pointer_reset_ex(model->u.content, &pos); while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) { - if (!model_to_xml_object(node, *tmp, object, style, (*tmp)->min_occurs > 0 TSRMLS_CC)) { - if ((*tmp)->min_occurs > 0) { + if (!model_to_xml_object(node, *tmp, object, style, strict && ((*tmp)->min_occurs > 0) TSRMLS_CC)) { + if (!strict || (*tmp)->min_occurs > 0) { return 0; } } + strict = 1; zend_hash_move_forward_ex(model->u.content, &pos); } return 1; @@ -1861,7 +1862,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * return ret; } case XSD_CONTENT_GROUP: { - return model_to_xml_object(node, model->u.group->model, object, style, model->min_occurs > 0 TSRMLS_CC); + return model_to_xml_object(node, model->u.group->model, object, style, strict && model->min_occurs > 0 TSRMLS_CC); } default: break; diff --git a/ext/soap/tests/any.phpt b/ext/soap/tests/any.phpt index 93a0e6693a..93a0e6693a 100755..100644 --- a/ext/soap/tests/any.phpt +++ b/ext/soap/tests/any.phpt diff --git a/ext/soap/tests/bugs/bug32941.phpt b/ext/soap/tests/bugs/bug32941.phpt index d1e3fff85d..d1e3fff85d 100755..100644 --- a/ext/soap/tests/bugs/bug32941.phpt +++ b/ext/soap/tests/bugs/bug32941.phpt diff --git a/ext/soap/tests/bugs/bug34449.phpt b/ext/soap/tests/bugs/bug34449.phpt index f5766e29bc..f5766e29bc 100755..100644 --- a/ext/soap/tests/bugs/bug34449.phpt +++ b/ext/soap/tests/bugs/bug34449.phpt diff --git a/ext/soap/tests/bugs/bug34453.phpt b/ext/soap/tests/bugs/bug34453.phpt index 0f9543b715..0f9543b715 100755..100644 --- a/ext/soap/tests/bugs/bug34453.phpt +++ b/ext/soap/tests/bugs/bug34453.phpt diff --git a/ext/soap/tests/bugs/bug34643.phpt b/ext/soap/tests/bugs/bug34643.phpt index b99565129c..b99565129c 100755..100644 --- a/ext/soap/tests/bugs/bug34643.phpt +++ b/ext/soap/tests/bugs/bug34643.phpt diff --git a/ext/soap/tests/bugs/bug34657.phpt b/ext/soap/tests/bugs/bug34657.phpt index d974d02cc6..d974d02cc6 100755..100644 --- a/ext/soap/tests/bugs/bug34657.phpt +++ b/ext/soap/tests/bugs/bug34657.phpt diff --git a/ext/soap/tests/bugs/bug35142.phpt b/ext/soap/tests/bugs/bug35142.phpt index 94c1aa954b..94c1aa954b 100755..100644 --- a/ext/soap/tests/bugs/bug35142.phpt +++ b/ext/soap/tests/bugs/bug35142.phpt diff --git a/ext/soap/tests/bugs/bug35273.phpt b/ext/soap/tests/bugs/bug35273.phpt index e22ebd7dca..e22ebd7dca 100755..100644 --- a/ext/soap/tests/bugs/bug35273.phpt +++ b/ext/soap/tests/bugs/bug35273.phpt diff --git a/ext/soap/tests/bugs/bug36226-2.phpt b/ext/soap/tests/bugs/bug36226-2.phpt index e14832db4b..e14832db4b 100755..100644 --- a/ext/soap/tests/bugs/bug36226-2.phpt +++ b/ext/soap/tests/bugs/bug36226-2.phpt diff --git a/ext/soap/tests/bugs/bug36226.phpt b/ext/soap/tests/bugs/bug36226.phpt index 8c01c5b5d3..8c01c5b5d3 100755..100644 --- a/ext/soap/tests/bugs/bug36226.phpt +++ b/ext/soap/tests/bugs/bug36226.phpt diff --git a/ext/soap/tests/bugs/bug36575.phpt b/ext/soap/tests/bugs/bug36575.phpt index 9bf5415220..9bf5415220 100755..100644 --- a/ext/soap/tests/bugs/bug36575.phpt +++ b/ext/soap/tests/bugs/bug36575.phpt diff --git a/ext/soap/tests/bugs/bug36614.phpt b/ext/soap/tests/bugs/bug36614.phpt index ba6734812d..ba6734812d 100755..100644 --- a/ext/soap/tests/bugs/bug36614.phpt +++ b/ext/soap/tests/bugs/bug36614.phpt diff --git a/ext/soap/tests/bugs/bug36629.phpt b/ext/soap/tests/bugs/bug36629.phpt index 2096da26a6..2096da26a6 100755..100644 --- a/ext/soap/tests/bugs/bug36629.phpt +++ b/ext/soap/tests/bugs/bug36629.phpt diff --git a/ext/soap/tests/bugs/bug36908.phpt b/ext/soap/tests/bugs/bug36908.phpt index cd0ea8b2e5..cd0ea8b2e5 100755..100644 --- a/ext/soap/tests/bugs/bug36908.phpt +++ b/ext/soap/tests/bugs/bug36908.phpt diff --git a/ext/soap/tests/bugs/bug36999.phpt b/ext/soap/tests/bugs/bug36999.phpt index 9fbb032d8f..9fbb032d8f 100755..100644 --- a/ext/soap/tests/bugs/bug36999.phpt +++ b/ext/soap/tests/bugs/bug36999.phpt diff --git a/ext/soap/tests/bugs/bug37013.phpt b/ext/soap/tests/bugs/bug37013.phpt index 45f314293b..45f314293b 100755..100644 --- a/ext/soap/tests/bugs/bug37013.phpt +++ b/ext/soap/tests/bugs/bug37013.phpt diff --git a/ext/soap/tests/bugs/bug37083.phpt b/ext/soap/tests/bugs/bug37083.phpt index d915ec0440..d915ec0440 100755..100644 --- a/ext/soap/tests/bugs/bug37083.phpt +++ b/ext/soap/tests/bugs/bug37083.phpt diff --git a/ext/soap/tests/bugs/bug37278.phpt b/ext/soap/tests/bugs/bug37278.phpt index f3fd7c17b4..f3fd7c17b4 100755..100644 --- a/ext/soap/tests/bugs/bug37278.phpt +++ b/ext/soap/tests/bugs/bug37278.phpt diff --git a/ext/soap/tests/bugs/bug38004.phpt b/ext/soap/tests/bugs/bug38004.phpt index fea4f0379a..fea4f0379a 100755..100644 --- a/ext/soap/tests/bugs/bug38004.phpt +++ b/ext/soap/tests/bugs/bug38004.phpt diff --git a/ext/soap/tests/bugs/bug38005.phpt b/ext/soap/tests/bugs/bug38005.phpt index 6a4fb2580b..6a4fb2580b 100755..100644 --- a/ext/soap/tests/bugs/bug38005.phpt +++ b/ext/soap/tests/bugs/bug38005.phpt diff --git a/ext/soap/tests/bugs/bug38055.phpt b/ext/soap/tests/bugs/bug38055.phpt index 82b6c76f77..82b6c76f77 100755..100644 --- a/ext/soap/tests/bugs/bug38055.phpt +++ b/ext/soap/tests/bugs/bug38055.phpt diff --git a/ext/soap/tests/bugs/bug38067.phpt b/ext/soap/tests/bugs/bug38067.phpt index c9bf3c165c..c9bf3c165c 100755..100644 --- a/ext/soap/tests/bugs/bug38067.phpt +++ b/ext/soap/tests/bugs/bug38067.phpt diff --git a/ext/soap/tests/bugs/bug38536.phpt b/ext/soap/tests/bugs/bug38536.phpt index feea46e97e..feea46e97e 100755..100644 --- a/ext/soap/tests/bugs/bug38536.phpt +++ b/ext/soap/tests/bugs/bug38536.phpt diff --git a/ext/soap/tests/bugs/bug39121.phpt b/ext/soap/tests/bugs/bug39121.phpt index caa7f6cce9..caa7f6cce9 100755..100644 --- a/ext/soap/tests/bugs/bug39121.phpt +++ b/ext/soap/tests/bugs/bug39121.phpt diff --git a/ext/soap/tests/bugs/bug39815.phpt b/ext/soap/tests/bugs/bug39815.phpt index 1adc50a2de..1adc50a2de 100755..100644 --- a/ext/soap/tests/bugs/bug39815.phpt +++ b/ext/soap/tests/bugs/bug39815.phpt diff --git a/ext/soap/tests/bugs/bug39832.phpt b/ext/soap/tests/bugs/bug39832.phpt index 6abc2f0aff..6abc2f0aff 100755..100644 --- a/ext/soap/tests/bugs/bug39832.phpt +++ b/ext/soap/tests/bugs/bug39832.phpt diff --git a/ext/soap/tests/bugs/bug40609.phpt b/ext/soap/tests/bugs/bug40609.phpt index 198afc511e..198afc511e 100755..100644 --- a/ext/soap/tests/bugs/bug40609.phpt +++ b/ext/soap/tests/bugs/bug40609.phpt diff --git a/ext/soap/tests/bugs/bug41004.phpt b/ext/soap/tests/bugs/bug41004.phpt index 992c6b708d..992c6b708d 100755..100644 --- a/ext/soap/tests/bugs/bug41004.phpt +++ b/ext/soap/tests/bugs/bug41004.phpt diff --git a/ext/soap/tests/bugs/bug41097.phpt b/ext/soap/tests/bugs/bug41097.phpt index a9cfd14140..a9cfd14140 100755..100644 --- a/ext/soap/tests/bugs/bug41097.phpt +++ b/ext/soap/tests/bugs/bug41097.phpt diff --git a/ext/soap/tests/bugs/bug41337.phpt b/ext/soap/tests/bugs/bug41337.phpt index cd777d1dea..cd777d1dea 100755..100644 --- a/ext/soap/tests/bugs/bug41337.phpt +++ b/ext/soap/tests/bugs/bug41337.phpt diff --git a/ext/soap/tests/bugs/bug41337_2.phpt b/ext/soap/tests/bugs/bug41337_2.phpt index d594d2515d..d594d2515d 100755..100644 --- a/ext/soap/tests/bugs/bug41337_2.phpt +++ b/ext/soap/tests/bugs/bug41337_2.phpt diff --git a/ext/soap/tests/bugs/bug41566.phpt b/ext/soap/tests/bugs/bug41566.phpt index 03ecdde043..03ecdde043 100755..100644 --- a/ext/soap/tests/bugs/bug41566.phpt +++ b/ext/soap/tests/bugs/bug41566.phpt diff --git a/ext/soap/tests/bugs/bug42086.phpt b/ext/soap/tests/bugs/bug42086.phpt index 6edc06f879..6edc06f879 100755..100644 --- a/ext/soap/tests/bugs/bug42086.phpt +++ b/ext/soap/tests/bugs/bug42086.phpt diff --git a/ext/soap/tests/bugs/bug42151.phpt b/ext/soap/tests/bugs/bug42151.phpt index ee53e6d525..ee53e6d525 100755..100644 --- a/ext/soap/tests/bugs/bug42151.phpt +++ b/ext/soap/tests/bugs/bug42151.phpt diff --git a/ext/soap/tests/bugs/bug42183.phpt b/ext/soap/tests/bugs/bug42183.phpt index d34311f26c..d34311f26c 100755..100644 --- a/ext/soap/tests/bugs/bug42183.phpt +++ b/ext/soap/tests/bugs/bug42183.phpt diff --git a/ext/soap/tests/bugs/bug42214.phpt b/ext/soap/tests/bugs/bug42214.phpt index a31f16dcb4..a31f16dcb4 100755..100644 --- a/ext/soap/tests/bugs/bug42214.phpt +++ b/ext/soap/tests/bugs/bug42214.phpt diff --git a/ext/soap/tests/bugs/bug42326.phpt b/ext/soap/tests/bugs/bug42326.phpt index 2e6c7c3501..2e6c7c3501 100755..100644 --- a/ext/soap/tests/bugs/bug42326.phpt +++ b/ext/soap/tests/bugs/bug42326.phpt diff --git a/ext/soap/tests/bugs/bug42359.phpt b/ext/soap/tests/bugs/bug42359.phpt index 94738fff34..94738fff34 100755..100644 --- a/ext/soap/tests/bugs/bug42359.phpt +++ b/ext/soap/tests/bugs/bug42359.phpt diff --git a/ext/soap/tests/bugs/bug42488.phpt b/ext/soap/tests/bugs/bug42488.phpt index 4069c9f6be..4069c9f6be 100755..100644 --- a/ext/soap/tests/bugs/bug42488.phpt +++ b/ext/soap/tests/bugs/bug42488.phpt diff --git a/ext/soap/tests/bugs/bug42692.phpt b/ext/soap/tests/bugs/bug42692.phpt index 1436f881e5..1436f881e5 100755..100644 --- a/ext/soap/tests/bugs/bug42692.phpt +++ b/ext/soap/tests/bugs/bug42692.phpt diff --git a/ext/soap/tests/bugs/bug50997.phpt b/ext/soap/tests/bugs/bug50997.phpt new file mode 100644 index 0000000000..0508aaccdc --- /dev/null +++ b/ext/soap/tests/bugs/bug50997.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #50997 (SOAP Error when trying to submit 2nd Element of a choice) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- +<?php +$soapClient = new SoapClient(__DIR__ . '/bug50997.wsdl', array('trace' => 1, 'exceptions'=>0)); +$params = array('code'=>'foo'); +$soapClient->newOperation($params); +echo $soapClient->__getLastRequest(); +?> +--EXPECT-- +<?xml version="1.0" encoding="UTF-8"?> +<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/service2/"><SOAP-ENV:Body><ns1:NewOperation><code>foo</code></ns1:NewOperation></SOAP-ENV:Body></SOAP-ENV:Envelope> diff --git a/ext/soap/tests/bugs/bug50997.wsdl b/ext/soap/tests/bugs/bug50997.wsdl new file mode 100644 index 0000000000..16c6d36752 --- /dev/null +++ b/ext/soap/tests/bugs/bug50997.wsdl @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/service2/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="service2" targetNamespace="http://www.example.org/service2/"> + <wsdl:types> + <xsd:schema targetNamespace="http://www.example.org/service2/"> + <xsd:element name="NewOperation"> + <xsd:complexType> + <xsd:choice> + <xsd:sequence> + <xsd:element name="firstName" type="xsd:string"> </xsd:element> + <xsd:element name="surName" type="xsd:string"/> + </xsd:sequence> + <xsd:element name="code" type="xsd:string"/> + </xsd:choice> + </xsd:complexType> + </xsd:element> + <xsd:element name="NewOperationResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="out" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="NewOperationRequest"> + <wsdl:part element="tns:NewOperation" name="parameters"/> + </wsdl:message> + <wsdl:message name="NewOperationResponse"> + <wsdl:part element="tns:NewOperationResponse" name="parameters"/> + </wsdl:message> + <wsdl:portType name="service2"> + <wsdl:operation name="NewOperation"> + <wsdl:input message="tns:NewOperationRequest"/> + <wsdl:output message="tns:NewOperationResponse"/> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="service2SOAP" type="tns:service2"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="NewOperation"> + <soap:operation soapAction="http://www.example.org/service2/NewOperation"/> + <wsdl:input> + <soap:body use="literal"/> + </wsdl:input> + <wsdl:output> + <soap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="service2"> + <wsdl:port binding="tns:service2SOAP" name="service2SOAP"> + <soap:address location="test://"/> + </wsdl:port> + </wsdl:service> + </wsdl:definitions> diff --git a/ext/soap/tests/classmap003.phpt b/ext/soap/tests/classmap003.phpt index 4d0118fef4..4d0118fef4 100755..100644 --- a/ext/soap/tests/classmap003.phpt +++ b/ext/soap/tests/classmap003.phpt diff --git a/ext/soap/tests/classmap004.phpt b/ext/soap/tests/classmap004.phpt index e8bf58a4f9..e8bf58a4f9 100755..100644 --- a/ext/soap/tests/classmap004.phpt +++ b/ext/soap/tests/classmap004.phpt diff --git a/ext/soap/tests/schema/schema082.phpt b/ext/soap/tests/schema/schema082.phpt index 34c4c76c25..34c4c76c25 100755..100644 --- a/ext/soap/tests/schema/schema082.phpt +++ b/ext/soap/tests/schema/schema082.phpt diff --git a/ext/soap/tests/schema/schema083.phpt b/ext/soap/tests/schema/schema083.phpt index 854c4f9ff6..854c4f9ff6 100755..100644 --- a/ext/soap/tests/schema/schema083.phpt +++ b/ext/soap/tests/schema/schema083.phpt diff --git a/ext/soap/tests/schema/schema084.phpt b/ext/soap/tests/schema/schema084.phpt index 94a9551faf..94a9551faf 100755..100644 --- a/ext/soap/tests/schema/schema084.phpt +++ b/ext/soap/tests/schema/schema084.phpt diff --git a/ext/soap/tests/schema/schema085.phpt b/ext/soap/tests/schema/schema085.phpt index 9a93ac7235..9a93ac7235 100755..100644 --- a/ext/soap/tests/schema/schema085.phpt +++ b/ext/soap/tests/schema/schema085.phpt diff --git a/ext/soap/tests/server022.phpt b/ext/soap/tests/server022.phpt index ff79a1518f..ff79a1518f 100755..100644 --- a/ext/soap/tests/server022.phpt +++ b/ext/soap/tests/server022.phpt diff --git a/ext/soap/tests/server023.phpt b/ext/soap/tests/server023.phpt index 5614599f3a..5614599f3a 100755..100644 --- a/ext/soap/tests/server023.phpt +++ b/ext/soap/tests/server023.phpt diff --git a/ext/soap/tests/server024.phpt b/ext/soap/tests/server024.phpt index 7db30621d3..7db30621d3 100755..100644 --- a/ext/soap/tests/server024.phpt +++ b/ext/soap/tests/server024.phpt diff --git a/ext/soap/tests/server025.phpt b/ext/soap/tests/server025.phpt index ed56750a0b..ed56750a0b 100755..100644 --- a/ext/soap/tests/server025.phpt +++ b/ext/soap/tests/server025.phpt diff --git a/ext/soap/tests/server026.phpt b/ext/soap/tests/server026.phpt index 720ade86c1..720ade86c1 100755..100644 --- a/ext/soap/tests/server026.phpt +++ b/ext/soap/tests/server026.phpt diff --git a/ext/soap/tests/server027.phpt b/ext/soap/tests/server027.phpt index 9fee4a6087..9fee4a6087 100755..100644 --- a/ext/soap/tests/server027.phpt +++ b/ext/soap/tests/server027.phpt diff --git a/ext/soap/tests/server028.phpt b/ext/soap/tests/server028.phpt index 4bea8ebd78..4bea8ebd78 100755..100644 --- a/ext/soap/tests/server028.phpt +++ b/ext/soap/tests/server028.phpt diff --git a/ext/soap/tests/setheaders.phpt b/ext/soap/tests/setheaders.phpt index cb90d372d1..cb90d372d1 100755..100644 --- a/ext/soap/tests/setheaders.phpt +++ b/ext/soap/tests/setheaders.phpt diff --git a/ext/soap/tests/typemap001.phpt b/ext/soap/tests/typemap001.phpt index b5ed31da85..b5ed31da85 100755..100644 --- a/ext/soap/tests/typemap001.phpt +++ b/ext/soap/tests/typemap001.phpt diff --git a/ext/soap/tests/typemap002.phpt b/ext/soap/tests/typemap002.phpt index ceb00f1a19..ceb00f1a19 100755..100644 --- a/ext/soap/tests/typemap002.phpt +++ b/ext/soap/tests/typemap002.phpt diff --git a/ext/soap/tests/typemap003.phpt b/ext/soap/tests/typemap003.phpt index 63bb76cbcf..63bb76cbcf 100755..100644 --- a/ext/soap/tests/typemap003.phpt +++ b/ext/soap/tests/typemap003.phpt diff --git a/ext/soap/tests/typemap004.phpt b/ext/soap/tests/typemap004.phpt index 4fe15f7f9f..4fe15f7f9f 100755..100644 --- a/ext/soap/tests/typemap004.phpt +++ b/ext/soap/tests/typemap004.phpt diff --git a/ext/soap/tests/typemap005.phpt b/ext/soap/tests/typemap005.phpt index 369d026b5a..369d026b5a 100755..100644 --- a/ext/soap/tests/typemap005.phpt +++ b/ext/soap/tests/typemap005.phpt diff --git a/ext/soap/tests/typemap006.phpt b/ext/soap/tests/typemap006.phpt index 7ecf410ad8..7ecf410ad8 100755..100644 --- a/ext/soap/tests/typemap006.phpt +++ b/ext/soap/tests/typemap006.phpt diff --git a/ext/soap/tests/typemap007.phpt b/ext/soap/tests/typemap007.phpt index b3451f1dae..b3451f1dae 100755..100644 --- a/ext/soap/tests/typemap007.phpt +++ b/ext/soap/tests/typemap007.phpt diff --git a/ext/soap/tests/typemap008.phpt b/ext/soap/tests/typemap008.phpt index 192f6dc0d2..192f6dc0d2 100755..100644 --- a/ext/soap/tests/typemap008.phpt +++ b/ext/soap/tests/typemap008.phpt diff --git a/ext/soap/tests/typemap009.phpt b/ext/soap/tests/typemap009.phpt index ec5c38da2b..ec5c38da2b 100755..100644 --- a/ext/soap/tests/typemap009.phpt +++ b/ext/soap/tests/typemap009.phpt diff --git a/ext/soap/tests/typemap010.phpt b/ext/soap/tests/typemap010.phpt index 4eba6345cb..4eba6345cb 100755..100644 --- a/ext/soap/tests/typemap010.phpt +++ b/ext/soap/tests/typemap010.phpt diff --git a/ext/soap/tests/typemap011.phpt b/ext/soap/tests/typemap011.phpt index 1e2addceec..1e2addceec 100755..100644 --- a/ext/soap/tests/typemap011.phpt +++ b/ext/soap/tests/typemap011.phpt diff --git a/ext/soap/tests/typemap012.phpt b/ext/soap/tests/typemap012.phpt index 847957a982..847957a982 100755..100644 --- a/ext/soap/tests/typemap012.phpt +++ b/ext/soap/tests/typemap012.phpt diff --git a/ext/soap/tests/typemap013.phpt b/ext/soap/tests/typemap013.phpt index d873eb4d18..d873eb4d18 100755..100644 --- a/ext/soap/tests/typemap013.phpt +++ b/ext/soap/tests/typemap013.phpt |
