Re: Re: Passing objects to soap server, complexType, classmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 21 Jun 2006 13:59:02 +1200, Morgan Pyne wrote:

> 
> I'm curious to see if your curiosity finds anything curious about this
> WSDL :-)
> 
First of all. Your WSDL is not even close to be a valid document.
1) If you must prefix elements then remember to be consistent! But why
bother?
2) Use the correct namespace prefix for elements - you use xsd,
but all elements in a WSDL belongs to the namespace
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; (wsdl)
3) the namespace http://schemas.xmlsoap.org/soap/encoding/ do not have a
definition for array, it is defined Array
4) The attribute arrayType belongs to wsdl

I have enclosed a valid version of your WSDL. Try to see it this does not
give better results.

PS. Next time make yourself a favor an parse your WSDL with a WSDL parser.
Eg. install mono and use the parser wsdl.

<?xml version="1.0"?>
<definitions name="TestSoapServer"
    targetNamespace="http://localhost/soap";
    xmlns="http://schemas.xmlsoap.org/wsdl/";
    xmlns:xsd="http://www.w3.org/2001/XMLSchema";
    xmlns:tns="http://localhost/soap";
    xmlns:soap-env="http://schemas.xmlsoap.org/wsdl/soap/";
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";>
   <types xmlns="http://schemas.xmlsoap.org/wsdl/";>
     <schema xmlns="http://www.w3.org/2001/XMLSchema";
	 targetNamespace="http://localhost/soap";>
       <complexType name="array">
         <complexContent>
           <restriction base="soapenc:Array">
             <attribute ref="soapenc:arrayType"
wsdl:arrayType="tns:mixed[]"/>
           </restriction>
         </complexContent>

       </complexType>
       <complexType name="mixed">
         <all>
           <element name="varString" type="xsd:string"/> <element
           name="varInt" type="xsd:int"/> <element name="varFloat"
           type="xsd:float"/> <element name="varArray" 
type="tns:array"/>
         </all>
       </complexType>

       <complexType name="VnCurrency">
         <all>
           <element name="currency_id" type="xsd:string"/> <element
           name="currency_symbol_html" type="xsd:string"/> <element
           name="currency_name" type="xsd:string"/> <element
           name="collVnBookings" type="tns:array"/> <element
           name="collVnCashTransactions" type="tns:array"/> <element
           name="collVnCcTransactions" type="tns:array"/> <element
           name="collVnRates" type="tns:array"/>

           <element name="alreadyInSave" type="xsd:boolean"/> <element
           name="alreadyInValidation" type="xsd:boolean"/> <element
           name="validationFailures" type="tns:array"/> <element
           name="modifiedColumns" type="tns:array"/>
         </all>
       </complexType>
     </schema>
   </types>
   <message name="passMeAnObjectInput">

     <part name="obj" type="tns:VnCurrency"/>
   </message>
   <message name="passMeAnObjectOutput">
     <part name="return" type="xsd:string"/>
   </message>
   <portType name="TestSoapServerPort">
     <operation name="passMeAnObject">
       <input message="tns:passMeAnObjectInput"/> <output
       message="tns:passMeAnObjectOutput"/>

     </operation>
   </portType>
   <binding name="TestSoapServerBinding"
   type="tns:TestSoapServerPort">
     <soap-env:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
     <operation name="passMeAnObject">
	 <soap-env:operation soapAction="http://localhost/soap#passMeAnObject"/>
       <input>
	   <soap-env:body namespace="http://localhost/soap";
use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
       </input>
       <output>

	   <soap-env:body namespace="http://localhost/soap";
use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
       </output>
     </operation>
   </binding>
   <service name="TestSoapServerService">
     <port name="TestSoapServerPort" binding="tns:TestSoapServerBinding">
       <soap-env:address location="http://localhost/soap"/>
     </port>
   </service>

</definitions>

$ diff -Napur test.wsdl.orig test.wsdl
--- test.wsdl.orig      2006-06-21 11:39:55.000000000 +0200
+++ test.wsdl   2006-06-21 11:35:10.000000000 +0200
@@ -1,22 +1,24 @@
 <?xml version="1.0"?>
-<definitions xmlns="http://schemas.xmlsoap.org/wsdl/";
-xmlns:xsd="http://www.w3.org/2001/XMLSchema";
-xmlns:tns="http://localhost/soap";
-xmlns:soap-env="http://schemas.xmlsoap.org/wsdl/soap/";
-xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
-xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
-targetNamespace="http://localhost/soap";>
-   <types>
-     <xsd:schema>
-       <xsd:complexType name="array">
-         <xsd:complexContent>
-           <xsd:restriction base="soapenc:array">
-             <xsd:attribute ref="soapenc:arrayType"
-arrayType="tns:mixed[]"/>
-           </xsd:restriction>
-         </xsd:complexContent>
+<definitions name="TestSoapServer"
+    targetNamespace="http://localhost/soap";
+    xmlns="http://schemas.xmlsoap.org/wsdl/";
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+    xmlns:tns="http://localhost/soap";
+    xmlns:soap-env="http://schemas.xmlsoap.org/wsdl/soap/";
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
+    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";>
+   <types xmlns="http://schemas.xmlsoap.org/wsdl/";>
+     <schema xmlns="http://www.w3.org/2001/XMLSchema";
+        targetNamespace="http://localhost/soap";>
+       <complexType name="array">
+         <complexContent>
+           <restriction base="soapenc:Array">
+             <attribute ref="soapenc:arrayType"
+wsdl:arrayType="tns:mixed[]"/>
+           </restriction>
+         </complexContent>

-       </xsd:complexType>
+       </complexType>
        <complexType name="mixed">
          <all>
            <element name="varString" type="xsd:string"/> <element
@@ -42,7 +44,7 @@ type="tns:array"/>
            name="modifiedColumns" type="tns:array"/>
          </all>
        </complexType>
-     </xsd:schema>
+     </schema>
    </types>
    <message name="passMeAnObjectInput">

@@ -51,7 +53,7 @@ type="tns:array"/>
    <message name="passMeAnObjectOutput">
      <part name="return" type="xsd:string"/>
    </message>
-   <portType name="TestSoapServerPortType">
+   <portType name="TestSoapServerPort">
      <operation name="passMeAnObject">
        <input message="tns:passMeAnObjectInput"/> <output
        message="tns:passMeAnObjectOutput"/>
@@ -59,29 +61,26 @@ type="tns:array"/>
      </operation>
    </portType>
    <binding name="TestSoapServerBinding"
-   type="tns:TestSoapServerPortType">
-     <soap-env:binding xmlns="http://schemas.xmlsoap.org/wsdl/soap/";
-style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
-     <operation xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";
-name="passMeAnObject">
-       <input xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
-         <soap-env:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/";
+   type="tns:TestSoapServerPort">
+     <soap-env:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+     <operation name="passMeAnObject">
+        <soap-env:operation soapAction="http://localhost/soap#passMeAnObject"/>+       <input>
+          <soap-env:body namespace="http://localhost/soap";
 use="encoded"
 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </input>
-       <output xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";>
+       <output>

-         <soap-env:body xmlns="http://schemas.xmlsoap.org/wsdl/soap/";
+          <soap-env:body namespace="http://localhost/soap";
 use="encoded"
 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </output>
      </operation>
    </binding>
    <service name="TestSoapServerService">
-     <port xmlns:default="http://schemas.xmlsoap.org/wsdl/soap/";
-name="TestSoapServerPort" binding="tns:TestSoapServerBinding">
-       <soap-env:address xmlns="http://schemas.xmlsoap.org/wsdl/soap/";
-location="http://localhost/soap"/>
+     <port name="TestSoapServerPort" binding="tns:TestSoapServerBinding">
+       <soap-env:address location="http://localhost/soap"/>
      </port>
    </service>


-- 
Hilsen/Regards
Michael Rasmussen
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux