Jump to content

mmlr38

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mmlr38's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am having problems passing complex data types from a SOAP server constructed using the built-in PHP5 SOAP extension to a SOAP client using nusoap.php or PEAR::SOAP. This is what the WSDL file looks like: <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://www.example.com/services/EorthoContent" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://www.example.com/services/EorthoContent" xmlns:intf="http://www.example.com/services/EorthoContent" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <wsdl:types> <schema targetNamespace="http://www.example.com/services/EorthoContent" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="ArrayOfArrayOf_xsd_string"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[][]"/> </restriction> </complexContent> </complexType> <complexType name="ArrayOf_xsd_string"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/> </restriction> </complexContent> </complexType> </schema> </wsdl:types> .... and the rest of the functions The complex type that isn't getting processed correctly is the "ArrayOfArrayOf_xsd_string" or xsd:string[][] Here's an example of what the data should look like when I do a var_dump() on the returned data from a function call: array(6) { [0]=> array(3) { [0]=> string(32) "775ab1f814d5190fb55685dbe1c6f7bd" [1]=> string(11) "Kyphoplasty" [2]=> string(115) "http://www.example.com/Booklet?ClinicID=6beb792d81342ab4b7b7bed7d91a7d79&TopicID=775ab1f814d5190fb55685dbe1c6f7bd" } [1]=> array(3) { [0]=> string(32) "4cdc554cbf052d95d0c6218dca340a98" [1]=> string(21) "Scheuermann's Disease" [2]=> string(115) "http://www.example.com/Booklet?ClinicID=6beb792d81342ab4b7b7bed7d91a7d79&TopicID=4cdc554cbf052d95d0c6218dca340a98" } [2]=> array(3) { [0]=> string(32) "012d86ee608acac7457ac979ae7d550d" [1]=> string(28) "Spinal Compression Fractures" [2]=> string(115) "http://www.example.com/Booklet?ClinicID=6beb792d81342ab4b7b7bed7d91a7d79&TopicID=012d86ee608acac7457ac979ae7d550d" } [3]=> array(3) { [0]=> string(32) "e2017d1a959a7159fc3514414c705aa3" [1]=> string(24) "Thoracic Disc Herniation" [2]=> string(115) "http://www.example.com/Booklet?ClinicID=6beb792d81342ab4b7b7bed7d91a7d79&TopicID=e2017d1a959a7159fc3514414c705aa3" } [4]=> array(3) { [0]=> string(32) "4c75b421ca09b5cb875c90e13c68d969" [1]=> string(22) "Thoracic Spine Anatomy" [2]=> string(115) "http://www.example.com/Booklet?ClinicID=6beb792d81342ab4b7b7bed7d91a7d79&TopicID=4c75b421ca09b5cb875c90e13c68d969" } [5]=> array(3) { [0]=> string(32) "cd057911c3a4cd05b8a79cd5d8e3a05a" [1]=> string(14) "Vertebroplasty" [2]=> string(115) "http://www.example.com/Booklet?ClinicID=6beb792d81342ab4b7b7bed7d91a7d79&TopicID=cd057911c3a4cd05b8a79cd5d8e3a05a" } } But here's what I am getting: array(1) { ["item"]=> array( { [0]=> string(32) "775ab1f814d5190fb55685dbe1c6f7bd" [1]=> string(11) "Kyphoplasty" [2]=> string(115) "http://www.example.com/Booklet?ClinicID=6beb792d81342ab4b7b7bed7d91a7d79&TopicID=775ab1f814d5190fb55685dbe1c6f7bd" [3]=> array(3) { [0]=> string(32) "4cdc554cbf052d95d0c6218dca340a98" [1]=> string(21) "Scheuermann's Disease" [2]=> string(115) "http://www.example.com/Booklet?ClinicID=6beb792d81342ab4b7b7bed7d91a7d79&TopicID=4cdc554cbf052d95d0c6218dca340a98" } [4]=> array(3) { [0]=> string(32) "012d86ee608acac7457ac979ae7d550d" [1]=> string(28) "Spinal Compression Fractures" [2]=> string(115) "http://www.example.com/Booklet?ClinicID=6beb792d81342ab4b7b7bed7d91a7d79&TopicID=012d86ee608acac7457ac979ae7d550d" } [5]=> array(3) { [0]=> string(32) "e2017d1a959a7159fc3514414c705aa3" [1]=> string(24) "Thoracic Disc Herniation" [2]=> string(115) "http://www.example.com/Booklet?ClinicID=6beb792d81342ab4b7b7bed7d91a7d79&TopicID=e2017d1a959a7159fc3514414c705aa3" } [6]=> array(3) { [0]=> string(32) "4c75b421ca09b5cb875c90e13c68d969" [1]=> string(22) "Thoracic Spine Anatomy" [2]=> string(115) "http://www.example.com/Booklet?ClinicID=6beb792d81342ab4b7b7bed7d91a7d79&TopicID=4c75b421ca09b5cb875c90e13c68d969" } [7]=> array(3) { [0]=> string(32) "cd057911c3a4cd05b8a79cd5d8e3a05a" [1]=> string(14) "Vertebroplasty" [2]=> string(115) "http://www.example.com/Booklet?ClinicID=6beb792d81342ab4b7b7bed7d91a7d79&TopicID=cd057911c3a4cd05b8a79cd5d8e3a05a" } } } Any idea why it changes the structure putting that "item" as the first element in the array and then putting everything else in the array inside it? I am just returning an array with a structure like so" $ret[0][0] = "some string here"; $ret[0][1] = "some string here"; $ret[1][0] = "some string here"; $ret[1][1] = "some string here"; ... return $ret; I have tried creating a SoapVar like this: $ret_final = new SoapVar($ret, SOAP_ENC_OBJECT, "ArrayOfArray_xsd_string", "http://www.example.com/services/EorthoContent"); return $ret_final; But I still get the same incorrect data structure. Suggestions?
  2. Hello, I have been working on a SOAP server that returns some complex data types. Here is how I have defined the data types: require 'nusoap/nusoap.php'; $server = new soap_server(); $NAMESPACE = 'http://eorthopod.com/services/EorthoContent'; $server->configureWSDL('EorthoContent', $NAMESPACE); $server->wsdl->schemaTargetNamespace = $NAMESPACE; // Begin complex type definitions $server->wsdl->addComplexType( 'ArrayOf_xsd_string', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array( array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType'=>'xsd:string[]')) ); // ---- ArrayOf_xsd_string[] (ArrayOfArrayOf_xsd_string) ------------------------------- $server->wsdl->addComplexType( 'ArrayOfArrayOf_xsd_string', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array( array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:ArrayOf_xsd_string[]') ), 'tns:ArrayOf_xsd_string' ); Now, the complex types seem to be received fine when called by a PHP based SOAP client (nusoap or built-in SOAP in php5), but when trying to interpret the complex types in ASP.NET, I get the following error: [invalidOperationException: The specified type was not recognized: name='ArrayOf_xsd_string', namespace='http://eorthopod.com/services/EorthoContent', at <return xmlns=''>.] System.Xml.Serialization.XmlSerializationReader.GetPrimitiveType(XmlQualifiedName typeName, Boolean throwOnUnknown) +695111 System.Xml.Serialization.XmlSerializationReader.ReadArray(String typeName, String typeNs) +459 System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String name, String ns, Boolean elementCanBeType, String& fixupReference) +371 System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String name, String ns, String& fixupReference) +14 Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderEorthoContentService.Read3_getProvidersResponse() +478 Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer5.Deserialize(XmlSerializationReader reader) +40 System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) +161 [invalidOperationException: There is an error in XML document (1, 489).] System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) +637 System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) +32 System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1143 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204 EorthoContentService.getProviders(String clinicGUID) +47 patient_edu.BindProviders() +118 patient_edu.Page_Load(Object sender, EventArgs e) +30 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061 Here is what the WSDL file looks like: <?xml version="1.0" encoding="ISO-8859-1"?> <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://eorthopod.com/services/EorthoContent" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://eorthopod.com/services/EorthoContent"> <types><xsd:schema targetNamespace="http://eorthopod.com/services/EorthoContent" > <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" /> <xsd:complexType name="ArrayOf_xsd_string"> <xsd:complexContent> <xsd:restriction base="SOAP-ENC:Array"> <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="ArrayOfArrayOf_xsd_string"> <xsd:complexContent> <xsd:restriction base="SOAP-ENC:Array"> <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:ArrayOf_xsd_string[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> </xsd:schema> </types> ...and then the function stuff starts. Can anyone help me figure out why ASP.NET can't recognize the complex type ArrayOf_xsd_string? Any help would be much appreciated. Thanks, Matt
  3. I have written a SOAP server in php5 using the built in SOAP extension as described here: http://php.net/soap The server works fine when called by a SOAP client that is also constructed using the built in SOAP extension in php5. However, when called using nusoap, the complex types (multi-dimensional arrays of strings) seem to get garbled. The WSDL file is here: http://www.eorthopod.com/services/EorthoContent?wsdl You can see good output here: http://www.mixmap.com/matt_test.php You can see the garbled output here: http://4roc.pyrontechnologies.com/patient_ed/matt_test.php I think it has something to do with properly declaring the complex types ArrayOfArrayOf_xsd_string and ArrayOf_xsd_string within the SOAP server code. I found some information about declaring complex types in the SOAP server here: http://www.lyingonthecovers.net/?p=42 But that information is just for nusoap.php, not for the built in php5 SOAP extension. Can anyone help get me pointed in the right direction? Please let me know if you need more information or some code snippets. Thanks, Matt
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.