ID: 47119 Updated by: [email protected] Reported By: simon at connexon dot com -Status: Open +Status: Feedback Bug Type: SOAP related Operating System: Windows XP PHP Version: 5.2.8 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Previous Comments: ------------------------------------------------------------------------ [2009-01-15 22:23:05] simon at connexon dot com Description: ------------ A bug was already opened on this but has been set to "No feedback" and the person who opened the bug doesn't seem to be wanting to reopen it. This bug addresses a problem in the XML parser part of the soapclient and soapserver constructors. I've been using this for a few years now and it's always been working fine, but this time I was using a pre-made .wsdl with a ton of .xsd files for a project and the soap was always returning me this precise error "Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: unresolved element 'ref' attribute." This needs to be fixed. package can be downloaded at http://www.nena.org/xml_schemas/NENAFiles/CurrentNENA/CurrentNENA.zip The crash occurs somewhere in this part: (if i remove this from the .xsd file then it works fine + the original file doesn't display any errors in a normal XML application) <xsd:complexType name="targetProviderType"> <xsd:annotation> <xsd:documentation>A provider of either service or information. The target provider type only specifies that a provider be identified by host address or NENA identifier. This type should be used by requesting hosts when identifying the target host for the request. This type is used to identify the VPC in the ESR request and the ESCT messages where the full details for the VPC are not known. </xsd:documentation> </xsd:annotation> <xsd:complexContent> <xsd:restriction base="xsd:anyType"> <xsd:sequence> <xsd:element ref="organizationName" minOccurs="0"/> <xsd:choice> <xsd:sequence> <xsd:element name="hostname" type="hostNameType"/> <xsd:element ref="nenaId" minOccurs="0"/> </xsd:sequence> <xsd:element ref="nenaId"/> </xsd:choice> <xsd:element ref="contact" minOccurs="0"/> <xsd:element ref="certUri" minOccurs="0"/> </xsd:sequence> </xsd:restriction> </xsd:complexContent> </xsd:complexType> Reproduce code: --------------- soap client code: $args = array ( 'trace' => 1, 'exceptions' => 1, 'location' => 'http://localhost/proj/server.php' ); $clientSOAP = new SoapClient('CurrentNENA/I2/v7/v7.wsdl', $args); $params= array ( "validateAddress" => array( "MessageID" => "Blob", "CustomerID" => "1992", "StreetAddress" => array( "HouseNum" => "200", "HouseNumSuffix" => "200", "PrefixDirectional" => "200", "StreetName" => "200", "StreetSuffix" => "200", "PostDirectional" => "200", "MSAGCommunity" => "200", "StateProvince" => "200", "PostalCode" => "200", "Country" => "200" ) )); $myres = $clientSOAP->__soapCall("validateAddress", $params); soap server code: $serveurSOAP = new SoapServer('CurrentNENA/I2/v7/v7.wsdl'); $serveurSOAP->addFunction(array("validateAddress")); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $serveurSOAP->handle(); } else { echo 'Please use the POST method.'; } function validateAddress($params) { return array("MessageID" => "Blob", "ReturnCode" => "200", "Valid" => "Valid"); } Expected result: ---------------- should give a normal xml response RESPONSE: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:nena:xml:ns:es:v7"><SOAP-ENV:Body><ns1:ValidateAddressOut><ns1:MessageID>Blob</ns1:MessageID><ns1:ReturnCode>200</ns1:ReturnCode><ns1:Valid>Valid</ns1:Valid></ns1:ValidateAddressOut></SOAP-ENV:Body></SOAP-ENV:Envelope> Actual result: -------------- Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: unresolved element 'ref' attribute. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47119&edit=1
