Jump to content

Complex data types not recognized by ASP.NET SOAP clients


mmlr38

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.