| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2007-05-10 15:34 UTC] michael dot caplan at henryschein dot com
 Description:
------------
My WSDL generated does not validate (ran against the oXygen editor and Mindreef SOAPscope).  The bindings elements appears to be adding bogus child elements (operation contains a child of operation & binding contains a child of binding).
The following diff fixed these issues:
Index: Z:/michael/labnet_online/api/lib/SCA/Bindings/soap/ServiceDescriptionGenerator.php
===================================================================
--- Z:/michael/labnet_online/api/lib/SCA/Bindings/soap/ServiceDescriptionGenerator.php	(revision 195)
+++ Z:/michael/labnet_online/api/lib/SCA/Bindings/soap/ServiceDescriptionGenerator.php	(working copy)
@@ -120,18 +120,10 @@
             $binding                     = $wsdl->createDataObject('binding');
             $binding->name                 = "{$class_name}Binding";
             $binding->type                 = "{$wsdl->targetNamespace}#{$class_name}PortType";
-            $soap_binding                 = $xmldas->createDataObject(self::SOAP_NAMESPACE, 'tBinding');
-            $soap_binding->style         = 'document';
-            $soap_binding->transport     = 'http://schemas.xmlsoap.org/soap/http';
-            $binding->binding             = $soap_binding;
             foreach ($service_desc->operations as $op_name => $params) {
                 $binding_operation             = $binding->createDataObject('operation');
                 $binding_operation->name     = $op_name;
 
-                $soap_operation             = $xmldas->createDataObject(self::SOAP_NAMESPACE, 'tOperation');
-                $soap_operation->soapAction = "";
-                $binding_operation->operation    = $soap_operation;
-
                 $bo_input                     = $binding_operation->createDataObject('input');
                 $soap_body                     = $xmldas->createDataObject(self::SOAP_NAMESPACE, 'tBody');
                 $bo_input->body             = $soap_body;
Expected result:
----------------
  <binding name="Labnet_API_LabnetOnline_001_ImplementationBinding" type="tns2:Labnet_API_LabnetOnline_001_ImplementationPortType">
    <operation name="getRestorations">
      <input>
        <tns3:body xsi:type="tns3:tBody" use="literal"/>
      </input>
      <output>
        <tns3:body xsi:type="tns3:tBody" use="literal"/>
      </output>
    </operation>
  </binding>
Actual result:
--------------
<binding name="Labnet_API_LabnetOnline_001_ImplementationBinding" type="tns2:Labnet_API_LabnetOnline_001_ImplementationPortType">
    <operation name="getRestorations">
      <input>
        <tns3:body xsi:type="tns3:tBody" use="literal"/>
      </input>
      <output>
        <tns3:body xsi:type="tns3:tBody" use="literal"/>
      </output>
      <tns3:operation xsi:type="tns3:tOperation" soapAction=""/>
    </operation>
<tns3:binding xsi:type="tns3:tBinding" transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
  </binding>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 05:00:01 2025 UTC | 
I just tried loading some SCA-generated WSDL using XERXES and got some useful messages: Error: URI=file:///C:/Documents%20and%20Settings/Administrator/workspace/XML/Greeting.wsdl Line=48: cvc-complex-type.2.4.a: Invalid content was found starting with element 'tns3:operation'. One of '{"http://schemas.xmlsoap.org/wsdl/":fault}' is expected. Error: URI=file:///C:/Documents%20and%20Settings/Administrator/workspace/XML/Greeting.wsdl Line=50: cvc-complex-type.2.4.a: Invalid content was found starting with element 'tns3:binding'. One of '{"http://schemas.xmlsoap.org/wsdl/":operation}' is expected. It dawned on me that this is to do with the order of the elements in the WSDL. Because tOperation and so on inherit from tExtensibleDocumented, it is allowable for them to have elements from other namespaces e.g. from the soap namespace as we do, but the order is wrong. We are generating: <binding name="GreetingBinding" type="tns2:GreetingPortType"> <operation name="greet"> <input> <tns3:body xsi:type="tns3:tBody" use="literal"/> </input> <output> <tns3:body xsi:type="tns3:tBody" use="literal"/> </output> <tns3:operation xsi:type="tns3:tOperation" soapAction=""/> </operation> <tns3:binding xsi:type="tns3:tBinding" transport="http://schemas.xmlsoap.org/soap/http" style="document"/> </binding> which fails. The XML passes though if the elements from the soap namespace come first: <binding name="GreetingBinding" type="tns2:GreetingPortType"> <tns3:binding xsi:type="tns3:tBinding" transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <operation name="greet"> <tns3:operation xsi:type="tns3:tOperation" soapAction=""/> <input> <tns3:body xsi:type="tns3:tBody" use="literal"/> </input> <output> <tns3:body xsi:type="tns3:tBody" use="literal"/> </output> </operation> </binding> OK, that's the source of the problem. Now how we are going to fix it I don't know, as this is the order in which it comes out from SDO. Pass to Tuscany I suppose.