/**
  * @group ZF-5944
  */
 public function testOnlyPublicPropertiesAreDiscoveredByStrategy()
 {
     $this->strategy->addComplexType("Zend_Soap_Wsdl_DefaultComplexTypeTest_PublicPrivateProtected");
     $xml = $this->wsdl->toXML();
     $this->assertNotContains(Zend_Soap_Wsdl_DefaultComplexTypeTest_PublicPrivateProtected::PROTECTED_VAR_NAME, $xml);
     $this->assertNotContains(Zend_Soap_Wsdl_DefaultComplexTypeTest_PublicPrivateProtected::PRIVATE_VAR_NAME, $xml);
 }
 /**
  * @group ZF-5944
  */
 public function testOnlyPublicPropertiesAreDiscoveredByStrategy()
 {
     $this->strategy->addComplexType('\\ZendTest\\Soap\\Wsdl\\PublicPrivateProtected');
     $xml = $this->wsdl->toXML();
     $this->assertNotContains(PublicPrivateProtected::PROTECTED_VAR_NAME, $xml);
     $this->assertNotContains(PublicPrivateProtected::PRIVATE_VAR_NAME, $xml);
 }
Пример #3
0
 /**
  * Handle the Request
  *
  * @param string $request A non-standard request - Not Used
  */
 public function handle($request = false)
 {
     if (!headers_sent()) {
         header('Content-Type: text/xml');
     }
     $this->_wsdl->dump();
 }
Пример #4
0
 /**
  * Returns an XSD Type for the given PHP type
  *
  * @param string $type PHP Type to get the XSD type for
  * @return string
  */
 public function getType($type)
 {
     if (!$this->_wsdl instanceof Zend_Soap_Wsdl) {
         /** @todo Exception throwing may be more correct */
         // WSDL is not defined yet, so we can't recognize type in context of current service
         return '';
     } else {
         return $this->_wsdl->getType($type);
     }
 }
Пример #5
0
 function testAddComplexType()
 {
     $wsdl = new Zend_Soap_Wsdl('MyService', 'http://localhost/MyService.php');
     
     $wsdl->addComplexType('Zend_Soap_Wsdl_Test');
     
     $this->assertEquals($wsdl->toXml(), 
                         '<?xml version="1.0"?>' . PHP_EOL .
                         '<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" '
                            . 'xmlns:tns="http://localhost/MyService.php" '
                            . 'xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" '
                            . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
                            . 'xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" '
                            . 'name="MyService" targetNamespace="http://localhost/MyService.php">'
                            . '<types>'
                            .   '<xsd:schema targetNamespace="">'
                            .     '<xsd:complexType name="Zend_Soap_Wsdl_Test">'
                            .       '<xsd:all>'
                            .         '<xsd:element name="var1" type="xsd:int"/>'
                            .         '<xsd:element name="var2" type="xsd:string"/>'
                            .       '</xsd:all>'
                            .     '</xsd:complexType>'
                            .   '</xsd:schema>'
                            . '</types>'
                       . '</definitions>' . PHP_EOL);
 }
Пример #6
0
 /**
  * @group ZF-5736
  */
 public function testHtmlAmpersandInUrlInSetUriIsEncodedCorrectly()
 {
     $wsdl = new Zend_Soap_Wsdl("MyService", "http://example.com");
     $wsdl->setUri(self::URI_WITH_EXPANDED_AMP);
     $this->assertContains(self::URI_WITH_EXPANDED_AMP, $wsdl->toXML());
 }
Пример #7
0
 /**
  * Add a W3C defined type.
  *
  * This is based upon the built-in datatypes as defined at
  * {@link http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#built-in-datatypes Built-in datatypes}.
  * Not all the types are supported, specifically:
  * 1. anySimpleType
  * 2. ENTITIES
  * 3. ENTITY
  * 4. ID
  * 5. IDREF
  * 6. IDREFS
  * 7. language
  * 8. Name
  * 9. NCName
  * 10. negativeInteger
  * 11. NMTOKEN
  * 12. NMTOKENS
  * 13. nonNegativeInteger
  * 14. nonPositiveInteger
  * 15. NOTATION
  * 16. positiveInteger
  * 17. QName
  * 18. unsignedByte
  * 19. unsignedInt
  * 20. unsignedLong
  * 21. unsignedShort
  *
  * Additionally, new built-in datatypes, as defined at
  * {@link http://www.w3.org/TR/xmlschema11-2/datatypes.html#built-in-datatypes Built-in Datatypes and Their Definitions}
  * are not supported. These include:
  * 1. anyAtomicType
  * 2. dayTimeDuration
  * 3. dayTimeStamp - This type can to be supported via the dateTime type with the optional timezone element always being populated.
  * 4. precisionDecimal
  * 5. yearMonthDuration
  *
  * @param  string $type Name of the type to be specified
  *
  * @return string XSD Type for the given PHP type
  *
  * @uses Zend_Soap_Wsdl::getType() to handle all unknown types.
  */
 public function getType($type)
 {
     return isset(self::$XSDTypeMap[strtolower($type)]) ? self::$XSDTypeMap[strtolower($type)] : parent::getType($type);
 }