Zend Framework  1.12
Public Member Functions | Protected Attributes | List of all members
Zend_Soap_Wsdl Class Reference

Public Member Functions

 __construct ($name, $uri, $strategy=true)
 Constructor.
 
 setUri ($uri)
 Set a new uri for this WSDL.
 
 setComplexTypeStrategy ($strategy)
 Set a strategy for complex type detection and handling.
 
 getComplexTypeStrategy ()
 Get the current complex type strategy.
 
 addMessage ($name, $parts)
 Add a message element to the WSDL.
 
 addPortType ($name)
 Add a portType element to the WSDL.
 
 addPortOperation ($portType, $name, $input=false, $output=false, $fault=false)
 Add an operation element to a portType element.
 
 addBinding ($name, $portType)
 Add a binding element to WSDL.
 
 addBindingOperation ($binding, $name, $input=false, $output=false, $fault=false)
 Add an operation to a binding element.
 
 addSoapBinding ($binding, $style= 'document', $transport= 'http://schemas.xmlsoap.org/soap/http')
 Add a SOAP binding element to a Binding element.
 
 addSoapOperation ($binding, $soap_action)
 Add a SOAP operation to an operation element.
 
 addService ($name, $port_name, $binding, $location)
 Add a service element to the WSDL.
 
 addDocumentation ($input_node, $documentation)
 Add a documentation element to any element in the WSDL.
 
 addTypes ($types)
 Add WSDL Types element.
 
 addType ($type)
 Add a complex type name that is part of this WSDL and can be used in signatures.
 
 getTypes ()
 Return an array of all currently included complex types.
 
 getSchema ()
 Return the Schema node of the WSDL.
 
 toXML ()
 Return the WSDL as XML.
 
 toDomDocument ()
 Return DOM Document.
 
 dump ($filename=false)
 Echo the WSDL as XML.
 
 getType ($type)
 Returns an XSD Type for the given PHP type.
 
 addSchemaTypeSection ()
 This function makes sure a complex types section and schema additions are set.
 
 addComplexType ($type)
 Add a types data type definition.
 
 addElement ($element)
 Add an xsd:element represented as an array to the schema.
 

Protected Attributes

 $_strategy = null
 Strategy for detection of complex types.
 

Constructor & Destructor Documentation

__construct (   $name,
  $uri,
  $strategy = true 
)

Constructor.

Parameters
string$nameName of the Web Service being Described
string$uriURI where the WSDL will be available
boolean | string | Zend_Soap_Wsdl_Strategy_Interface$strategy
Todo:
change DomDocument object creation from cparsing to construxting using API It also should authomatically escape $name and $uri values if necessary

Member Function Documentation

addBinding (   $name,
  $portType 
)

Add a binding element to WSDL.

Parameters
string$nameName of the Binding
string$typename of the portType to bind
Returns
object The new binding's XML_Tree_Node for use with addBindingOperation and addDocumentation
addBindingOperation (   $binding,
  $name,
  $input = false,
  $output = false,
  $fault = false 
)

Add an operation to a binding element.

Parameters
object$bindingA binding XML_Tree_Node returned by addBinding
array$inputAn array of attributes for the input element, allowed keys are: 'use', 'namespace', 'encodingStyle'. More Information
array$outputAn array of attributes for the output element, allowed keys are: 'use', 'namespace', 'encodingStyle'. More Information
array$faultAn array of attributes for the fault element, allowed keys are: 'name', 'use', 'namespace', 'encodingStyle'. More Information
Returns
object The new Operation's XML_Tree_Node for use with addSoapOperation and addDocumentation

Note. Do we really need name attribute to be also set at wsdl:fault node??? W3C standard doesn't mention it (http://www.w3.org/TR/wsdl#_soap:fault) But some real world WSDLs use it, so it may be required for compatibility reasons.

addComplexType (   $type)

Add a types data type definition.

Parameters
string$typeName of the class to be specified
Returns
string XSD Type for the given PHP type
addDocumentation (   $input_node,
  $documentation 
)

Add a documentation element to any element in the WSDL.

Note that the WSDL specification uses 'document', but the WSDL schema uses 'documentation' instead. The WS-I Basic Profile 1.1 recommends using 'documentation'.

Parameters
object$input_nodeAn XML_Tree_Node returned by another method to add the documentation to
string$documentationHuman readable documentation for the node
Returns
DOMElement The documentation element
addElement (   $element)

Add an xsd:element represented as an array to the schema.

Array keys represent attribute names and values their respective value. The 'sequence', 'all' and 'choice' keys must have an array of elements as their value, to add them to a nested complexType.

Example: array( 'name' => 'MyElement', 'sequence' => array( array('name' => 'myString', 'type' => 'string'), array('name' => 'myInteger', 'type' => 'int') ) ); Resulting XML: <xsd:element name="MyElement"><xsd:complexType><xsd:sequence> <xsd:element name="myString" type="string"/> <xsd:element name="myInteger" type="int"/> </xsd:sequence></xsd:complexType></xsd:element>

Parameters
array$elementan xsd:element represented as an array
Returns
string xsd:element for the given element array
addMessage (   $name,
  $parts 
)

Add a message element to the WSDL.

Parameters
string$nameName for the message
array$partsAn array of parts The array is constructed like: 'name of part' => 'part xml schema data type' or 'name of part' => array('type' => 'part xml schema type') or 'name of part' => array('element' => 'part xml element name')
Returns
object The new message's XML_Tree_Node for use in addDocumentation
addPortOperation (   $portType,
  $name,
  $input = false,
  $output = false,
  $fault = false 
)

Add an operation element to a portType element.

Parameters
object$portTypea portType XML_Tree_Node, from addPortType
string$nameOperation name
string$inputInput Message
string$outputOutput Message
string$faultFault Message
Returns
object The new operation's XML_Tree_Node for use in addDocumentation
addPortType (   $name)

Add a portType element to the WSDL.

Parameters
string$nameportType element's name
Returns
object The new portType's XML_Tree_Node for use in addPortOperation and addDocumentation
addSchemaTypeSection ( )

This function makes sure a complex types section and schema additions are set.

Returns
Zend_Soap_Wsdl
addService (   $name,
  $port_name,
  $binding,
  $location 
)

Add a service element to the WSDL.

Parameters
string$nameService Name
string$port_nameName of the port for the service
string$bindingBinding for the port
string$locationSOAP Address for the service
Returns
object The new service's XML_Tree_Node for use with addDocumentation
addSoapBinding (   $binding,
  $style = 'document',
  $transport = 'http://schemas.xmlsoap.org/soap/http' 
)

Add a SOAP binding element to a Binding element.

Parameters
object$bindingA binding XML_Tree_Node returned by addBinding
string$stylebinding style, possible values are "rpc" (the default) and "document"
string$transportTransport method (defaults to HTTP)
Returns
boolean
addSoapOperation (   $binding,
  $soap_action 
)

Add a SOAP operation to an operation element.

Parameters
object$operationAn operation XML_Tree_Node returned by addBindingOperation
string$soap_actionSOAP Action
Returns
boolean
addType (   $type)

Add a complex type name that is part of this WSDL and can be used in signatures.

Parameters
string$type
Returns
Zend_Soap_Wsdl
addTypes (   $types)

Add WSDL Types element.

Parameters
object$typesA DomDocument|DomNode|DomElement|DomDocumentFragment with all the XML Schema types defined in it
dump (   $filename = false)

Echo the WSDL as XML.

Returns
boolean
getComplexTypeStrategy ( )

Get the current complex type strategy.

Returns
Zend_Soap_Wsdl_Strategy_Interface
getSchema ( )

Return the Schema node of the WSDL.

Returns
DOMElement
getType (   $type)

Returns an XSD Type for the given PHP type.

Parameters
string$typePHP Type to get the XSD type for
Returns
string
getTypes ( )

Return an array of all currently included complex types.

Returns
array
setComplexTypeStrategy (   $strategy)

Set a strategy for complex type detection and handling.

Todo:
Boolean is for backwards compability with extractComplexType object var. Remove it in later versions.
Parameters
boolean | string | Zend_Soap_Wsdl_Strategy_Interface$strategy
Returns
Zend_Soap_Wsdl
setUri (   $uri)

Set a new uri for this WSDL.

Parameters
string | Zend_Uri_Http$uri
Returns
Zend_Server_Wsdl
toDomDocument ( )

Return DOM Document.

Returns
object DomDocum ent
toXML ( )

Return the WSDL as XML.

Returns
string WSDL as XML

Member Data Documentation

$_strategy = null
protected

Strategy for detection of complex types.