Array Of Arrays - Cape Generated WSDL with .NET

R

Ravi Singh (UCSD)

Hello all,

I have a CAPE generated WSDL that is an array of arrays. Let me
elaborate I have a struct of
public class Properties()
{
}
Now I have a PropertyList that is an array of Properties.
And then I have a PropertyListList that is an array of PropertyList.

When .NET uses this, it bastardizes the WSDL, and says its an array of
arrays and skips the notion of PropertyList, in the generated code.
When I send back something that is a PropertyList it fails.
The error message that it gives is
"There is an error in XML document"

I can successfully call the function, I can see the parameters go
through, but when on the UNIX side I return the PropertyList is what
causes the whole thing to die.

I would be grateful for any suggestions and pointers in some direction.
Thanks

-Ravi Singh.
 
D

Dan Rogers

Do you have a schema that can describe the XML you wish to achieve on the
wire?

--------------------
 
R

Ravi Singh (UCSD)

Below is the code generated

//
// This source code was auto-generated by Microsoft.VSDesigner, Version
1.1.4322.2032.
//
namespace MyTestApplication.MultiArray {
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;


/// <remarks/>
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="MultiArray",
Namespace="http://localhost/1.0/MultiArray.wsdl")]
[System.Xml.Serialization.SoapIncludeAttribute(typeof(Property))]
public class MultiArray :
System.Web.Services.Protocols.SoapHttpClientProtocol {

/// <remarks/>
public MultiArray() {
this.Url =
"http://bryce.safe-med.com:1999/safemed/MultiArray";
}

/// <remarks/>

[System.Web.Services.Protocols.SoapRpcMethodAttribute("getProperties",
RequestNamespace="http://localhost/1.0/MultiArray/binding",
ResponseNamespace="http://localhost/1.0/MultiArray/binding")]
[return:
System.Xml.Serialization.SoapElementAttribute("properties")]
public PropertyList[] getProperties(Property[] request) {
object[] results = this.Invoke("getProperties", new
object[] {
request});
return ((PropertyList[])(results[0]));
}

/// <remarks/>
public System.IAsyncResult BegingetProperties(Property[]
request, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("getProperties", new object[] {
request}, callback, asyncState);
}

/// <remarks/>
public PropertyList[] EndgetProperties(System.IAsyncResult
asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((PropertyList[])(results[0]));
}

/// <remarks/>

[System.Web.Services.Protocols.SoapRpcMethodAttribute("getList",
RequestNamespace="http://localhost/1.0/MultiArray/binding",
ResponseNamespace="http://localhost/1.0/MultiArray/binding")]
[return:
System.Xml.Serialization.SoapElementAttribute("response")]
public PropertyList getList(PropertyList request) {
object[] results = this.Invoke("getList", new object[] {
request});
return ((PropertyList)(results[0]));
}

/// <remarks/>
public System.IAsyncResult BegingetList(PropertyList request,
System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("getList", new object[] {
request}, callback, asyncState);
}

/// <remarks/>
public PropertyList EndgetList(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((PropertyList)(results[0]));
}
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Property",
"http://localhost/1.0/MultiArray.sm")]
public class Property {

/// <remarks/>
public string key;

/// <remarks/>
public string value;
}
}




--------------------------------------------------------------------AND
here is the
WSDL----------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://localhost/1.0/MultiArray.sm"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://localhost/1.0/MultiArray.wsdl"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://localhost/1.0/MultiArray.wsdl"
name="MultiArray" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Ravi Singh. Copyright
2004</wsdl:documentation>
<wsdl:types>
<s:schema xmlns:SM="http://localhost/1.0/MultiArray.sm"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://localhost/1.0/MultiArray.sm">
<xsd:complexType name="Property">
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="key"
type="xsd:string" />
<xsd:element minOccurs="1" maxOccurs="1" name="value"
type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="PropertyList">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded"
name="item" type="SM:property" />
</xsd:sequence>
<xsd:attribute wsdl:arrayType="SM:property[]"
ref="soapenc:arrayType" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Properties">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded"
name="item" type="SM:propertyList" />
</xsd:sequence>
<xsd:attribute wsdl:arrayType="SM:propertyList[]"
ref="soapenc:arrayType" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</s:schema>
</wsdl:types>
<wsdl:message name="PropertyListRequest">
<wsdl:part name="request" type="s0:propertyList" />
</wsdl:message>
<wsdl:message name="MultiArrayFault">
<wsdl:part name="why" type="s:string" />
</wsdl:message>
<wsdl:message name="PropertiesResponse">
<wsdl:part name="properties" type="s0:properties" />
</wsdl:message>
<wsdl:message name="PropertyListResponse">
<wsdl:part name="response" type="s0:propertyList" />
</wsdl:message>
<wsdl:portType name="MultiArray">
<wsdl:eek:peration name="getProperties">
<wsdl:input message="tns:propertyListRequest" />
<wsdl:eek:utput message="tns:propertiesResponse" />
<wsdl:fault name="fault1" message="tns:MultiArrayFault" />
</wsdl:eek:peration>
<wsdl:eek:peration name="getList">
<wsdl:input message="tns:propertyListRequest" />
<wsdl:eek:utput message="tns:propertyListResponse" />
<wsdl:fault name="fault1" message="tns:MultiArrayFault" />
</wsdl:eek:peration>
</wsdl:portType>
<wsdl:binding name="MultiArray" type="tns:MultiArray">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc" />
<wsdl:eek:peration name="getProperties">
<soap:eek:peration soapAction="getProperties" />
<wsdl:input>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:eek:utput>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:eek:utput>
<wsdl:fault name="fault1">
<soap:fault use="literal" namespace="" encodingStyle="" />
</wsdl:fault>
</wsdl:eek:peration>
<wsdl:eek:peration name="getList">
<soap:eek:peration soapAction="getList" />
<wsdl:input>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:eek:utput>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:eek:utput>
<wsdl:fault name="fault1">
<soap:fault use="literal" namespace="" encodingStyle="" />
</wsdl:fault>
</wsdl:eek:peration>
</wsdl:binding>
<wsdl:service name="MultiArray">
<wsdl:port name="MultiArrayPort" binding="tns:MultiArray">
<soap:address location="http://localhost:1999/safemed/MultiArray"
/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I really do appreciate your help on this matter.


Thanks

-Ravi.
 
R

Ravi Singh (UCSD)

Hello

Below is the WSDL and the generated .NET code.

As you can see the notion of propertylist in the WSDL, but the
generated code does not have any notion of the property list.


Thanks

-Ravi Singh


<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://localhost/1.0/MultiArray.sm"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://localhost/1.0/MultiArray.wsdl"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://localhost/1.0/MultiArray.wsdl"
name="MultiArray" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Ravi Singh, Copyright
2004</wsdl:documentation>
<wsdl:types>
<s:schema xmlns:SM="http://localhost/1.0/MultiArray.sm"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://localhost/1.0/MultiArray.sm">
<xsd:complexType name="Property">
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="key"
type="xsd:string" />
<xsd:element minOccurs="1" maxOccurs="1" name="value"
type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="PropertyList">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded"
name="item" type="SM:property" />
</xsd:sequence>
<xsd:attribute wsdl:arrayType="SM:property[]"
ref="soapenc:arrayType" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Properties">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded"
name="item" type="SM:propertyList" />
</xsd:sequence>
<xsd:attribute wsdl:arrayType="SM:propertyList[]"
ref="soapenc:arrayType" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</s:schema>
</wsdl:types>
<wsdl:message name="PropertyListRequest">
<wsdl:part name="request" type="s0:propertyList" />
</wsdl:message>
<wsdl:message name="MultiArrayFault">
<wsdl:part name="why" type="s:string" />
</wsdl:message>
<wsdl:message name="PropertiesResponse">
<wsdl:part name="properties" type="s0:properties" />
</wsdl:message>
<wsdl:message name="PropertyListResponse">
<wsdl:part name="response" type="s0:propertyList" />
</wsdl:message>
<wsdl:portType name="MultiArray">
<wsdl:eek:peration name="getProperties">
<wsdl:input message="tns:propertyListRequest" />
<wsdl:eek:utput message="tns:propertiesResponse" />
<wsdl:fault name="fault1" message="tns:MultiArrayFault" />
</wsdl:eek:peration>
<wsdl:eek:peration name="getList">
<wsdl:input message="tns:propertyListRequest" />
<wsdl:eek:utput message="tns:propertyListResponse" />
<wsdl:fault name="fault1" message="tns:MultiArrayFault" />
</wsdl:eek:peration>
</wsdl:portType>
<wsdl:binding name="MultiArray" type="tns:MultiArray">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc" />
<wsdl:eek:peration name="getProperties">
<soap:eek:peration soapAction="getProperties" />
<wsdl:input>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:eek:utput>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:eek:utput>
<wsdl:fault name="fault1">
<soap:fault use="literal" namespace="" encodingStyle="" />
</wsdl:fault>
</wsdl:eek:peration>
<wsdl:eek:peration name="getList">
<soap:eek:peration soapAction="getList" />
<wsdl:input>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:eek:utput>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:eek:utput>
<wsdl:fault name="fault1">
<soap:fault use="literal" namespace="" encodingStyle="" />
</wsdl:fault>
</wsdl:eek:peration>
</wsdl:binding>
<wsdl:service name="MultiArray">
<wsdl:port name="MultiArrayPort" binding="tns:MultiArray">
<soap:address
location="http://bryce.safe-med.com:1999/safemed/MultiArray" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>



-----------------------------------------------------------------------------------------------------------------


Here is the gnereated .NET Code


-----------------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Runtime Version: 1.1.4322.2032
//
// Changes to this file may cause incorrect behavior and will be
lost if
// the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------

//
// This source code was auto-generated by Microsoft.VSDesigner, Version
1.1.4322.2032.
//
namespace MyTestApplication.MultiArray {
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;


/// <remarks/>
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="MultiArray",
Namespace="http://localhost/1.0/MultiArray.wsdl")]
[System.Xml.Serialization.SoapIncludeAttribute(typeof(Property))]
public class MultiArray :
System.Web.Services.Protocols.SoapHttpClientProtocol {

/// <remarks/>
public MultiArray() {
this.Url =
"http://bryce.safe-med.com:1999/safemed/MultiArray";
}

/// <remarks/>

[System.Web.Services.Protocols.SoapRpcMethodAttribute("getProperties",
RequestNamespace="http://localhost/1.0/MultiArray/binding",
ResponseNamespace="http://localhost/1.0/MultiArray/binding")]
[return:
System.Xml.Serialization.SoapElementAttribute("properties")]
public Property[][] getProperties(Property[] request) {
object[] results = this.Invoke("getProperties", new
object[] {
request});
return ((Property[][])(results[0]));
}

/// <remarks/>
public System.IAsyncResult BegingetProperties(Property[]
request, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("getProperties", new object[] {
request}, callback, asyncState);
}

/// <remarks/>
public Property[][] EndgetProperties(System.IAsyncResult
asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((Property[][])(results[0]));
}

/// <remarks/>

[System.Web.Services.Protocols.SoapRpcMethodAttribute("getList",
RequestNamespace="http://localhost/1.0/MultiArray/binding",
ResponseNamespace="http://localhost/1.0/MultiArray/binding")]
[return:
System.Xml.Serialization.SoapElementAttribute("response")]
public Property[] getList(Property[] request) {
object[] results = this.Invoke("getList", new object[] {
request});
return ((Property[])(results[0]));
}

/// <remarks/>
public System.IAsyncResult BegingetList(Property[] request,
System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("getList", new object[] {
request}, callback, asyncState);
}

/// <remarks/>
public Property[] EndgetList(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((Property[])(results[0]));
}
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Property",
"http://localhost/1.0/MultiArray.sm")]
public class Property {

/// <remarks/>
public string key;

/// <remarks/>
public string value;
}
}
-----------------------------------------------------------------
 
R

Ravi Singh (UCSD)

Hello


Below is the WSDL and the generated .NET code.


As you can see the notion of propertylist in the WSDL, but the
generated code does not have any notion of the property list.


Thanks


-Ravi Singh



<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://localhost/1.0/MultiArray.sm"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://localhost/1.0/MultiArray.wsdl"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"targetNamespace="http://localhost/1.0/MultiArray.wsdl"
name="MultiArray" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Ravi Singh, Copyright
2004</wsdl:documentation>
<wsdl:types>
<s:schema xmlns:SM="http://localhost/1.0/MultiArray.sm"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"targetNamespace="http://localhost/1.0/MultiArray.sm">
<xsd:complexType name="Property">
<xsd:sequence>

<xsd:element minOccurs="1" maxOccurs="1" name="key"
type="xsd:string" />

<xsd:element minOccurs="1" maxOccurs="1" name="value"
type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="PropertyList">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded"
name="item" type="SM:property" />
</xsd:sequence>

<xsd:attribute wsdl:arrayType="SM:property[]"
ref="soapenc:arrayType" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Properties">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded"
name="item" type="SM:propertyList" />
</xsd:sequence>

<xsd:attribute wsdl:arrayType="SM:propertyList[]"
ref="soapenc:arrayType" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</s:schema>
</wsdl:types>
<wsdl:message name="PropertyListRequest">

<wsdl:part name="request" type="s0:propertyList" />
</wsdl:message>
<wsdl:message name="MultiArrayFault">

<wsdl:part name="why" type="s:string" />
</wsdl:message>
<wsdl:message name="PropertiesResponse">

<wsdl:part name="properties" type="s0:properties" />
</wsdl:message>
<wsdl:message name="PropertyListResponse">

<wsdl:part name="response" type="s0:propertyList" />
</wsdl:message>
<wsdl:portType name="MultiArray">
<wsdl:eek:peration name="getProperties">
<wsdl:input message="tns:propertyListRequest" />
<wsdl:eek:utput message="tns:propertiesResponse" />

<wsdl:fault name="fault1" message="tns:MultiArrayFault" />
</wsdl:eek:peration>
<wsdl:eek:peration name="getList">
<wsdl:input message="tns:propertyListRequest" />
<wsdl:eek:utput message="tns:propertyListResponse" />

<wsdl:fault name="fault1" message="tns:MultiArrayFault" />
</wsdl:eek:peration>
</wsdl:portType>

<wsdl:binding name="MultiArray" type="tns:MultiArray">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc" />
<wsdl:eek:peration name="getProperties">
<soap:eek:peration soapAction="getProperties" />
<wsdl:input>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:eek:utput>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:eek:utput>
<wsdl:fault name="fault1">

<soap:fault use="literal" namespace="" encodingStyle="" />
</wsdl:fault>
</wsdl:eek:peration>
<wsdl:eek:peration name="getList">
<soap:eek:peration soapAction="getList" />
<wsdl:input>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:eek:utput>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:eek:utput>
<wsdl:fault name="fault1">

<soap:fault use="literal" namespace="" encodingStyle="" />
</wsdl:fault>
</wsdl:eek:peration>
</wsdl:binding>
<wsdl:service name="MultiArray">

<wsdl:port name="MultiArrayPort" binding="tns:MultiArray">
<soap:address
location="http://localhosy/sm/MultiArray" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>


-----------------------------------------------------------------------------------------------------------------
Here is the gnereated .NET Code



-----------------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Runtime Version: 1.1.4322.2032
//
// Changes to this file may cause incorrect behavior and will be
lost if
// the code is regenerated.
// </autogenerated>

//------------------------------------------------------------------------------
//
// This source code was auto-generated by Microsoft.VSDesigner, Version
1.1.4322.2032.
//
namespace MyTestApplication.MultiArray {
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;


/// <remarks/>
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="MultiArray",
Namespace="http://localhost/1.0/MultiArray.wsdl")]
[System.Xml.Serialization.SoapIncludeAttribute(typeof(Property))]
public class MultiArray :
System.Web.Services.Protocols.SoapHttpClientProtocol {


/// <remarks/>
public MultiArray() {
this.Url =
"http://localhost/sm/MultiArray";



}


/// <remarks/>

[System.Web.Services.Protocols.SoapRpcMethodAttribute("getProperties",
RequestNamespace="http://localhost/1.0/MultiArray/binding",ResponseNamespace="http://localhost/1.0/MultiArray/binding")]
[return:
System.Xml.Serialization.SoapElementAttribute("properties")]


public Property[][] getProperties(Property[] request) {
object[] results = this.Invoke("getProperties", new
object[] {
request});

return ((Property[][])(results[0]));

}


/// <remarks/>
public System.IAsyncResult BegingetProperties(Property[]
request, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("getProperties", new object[] {
request}, callback, asyncState);


}


/// <remarks/>

public Property[][] EndgetProperties(System.IAsyncResult
asyncResult) {

object[] results = this.EndInvoke(asyncResult);
return ((Property[][])(results[0]));

}


/// <remarks/>

[System.Web.Services.Protocols.SoapRpcMethodAttribute("getList",
RequestNamespace="http://localhost/1.0/MultiArray/binding",ResponseNamespace="http://localhost/1.0/MultiArray/binding")]
[return:
System.Xml.Serialization.SoapElementAttribute("response")]


public Property[] getList(Property[] request) {
object[] results = this.Invoke("getList", new object[] {
request});

return ((Property[])(results[0]));

}


/// <remarks/>
public System.IAsyncResult BegingetList(Property[] request,
System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("getList", new object[] {
request}, callback, asyncState);


}


/// <remarks/>
public Property[] EndgetList(System.IAsyncResult asyncResult) {

object[] results = this.EndInvoke(asyncResult);
return ((Property[])(results[0]));

}
}


/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Property",
"http://localhost/1.0/MultiArray.sm")]
public class Property {

/// <remarks/>
public string key;


/// <remarks/>
public string value;


}
}
 
D

Dan Rogers

Hi Ravi,

The WSDL you are showing is set up to use SOAP section 5 encoding. This
will make the array of array a little bit odd on the wire. You may wish to
change your implementation to being document literal - as this is the best
practice.

As for the generated code, it should work against a service that implements
that WSDL. In the generated proxy (the code generated from
add-web-reference), you'll probably have to pass the array of arrays as a
parm - which means you build them yourself. I know this is hardly
convenient.

Once you switch your implementation to document literal, you might want to
regenerate the class implementations and replace the generated code on the
client side with something that gives a programming model a little closer
to what the XML and schema define. There is no requirement that
programming models have to match - so if you want to see something like an
array list of key and value pairs, you may even want to change the shema
for your service to do something like this:

<PropertyList>
<Property>
<key/>
<value/>
</Property>
</PropertyList>

As coded here it seems to be describing this:

<Properties>
<PropertyList>
<Item>
<key/>
<value/>
</Item>
<Item>
...
</Item>
</PropertyList>
<PropertyList>
...
</PropertyList>
...
</Properties>

Are you sure you wanted a multidimensional array of arrays? if so, the
auto-generated proxy code will be somewhat convoluted as you have seen.
SOAP Encoding makes it even more convoluted, which is why for interop,
document literal form is recommended.

I hope this helps

Dan Rogers
Microsoft Corporation

--------------------
From: "Ravi Singh (UCSD)" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
Subject: Re: Array Of Arrays - Cape Generated WSDL with .NET
Date: 21 Dec 2004 14:28:30 -0800
Organization: http://groups.google.com
Lines: 232
Message-ID: <[email protected]>
References: <[email protected]>
<[email protected]>
NNTP-Posting-Host: 207.158.8.111
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1103668115 1270 127.0.0.1 (21 Dec 2004 22:28:35 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Tue, 21 Dec 2004 22:28:35 +0000 (UTC)
In-Reply-To: <[email protected]>
User-Agent: G2/0.2
Complaints-To: (e-mail address removed)
Injection-Info: f14g2000cwb.googlegroups.com; posting-host=207.158.8.111;
posting-account=EUJs7Q0AAACyTsH6KpSCUAH9IXc46sAi
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!new
sfeed1.ip.tiscali.net!news.glorb.com!postnews.google.com!f14g2000cwb.googleg
roups.com!not-for-mail
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.aspnet.webservices:27341
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

Below is the code generated

//
// This source code was auto-generated by Microsoft.VSDesigner, Version
1.1.4322.2032.
//
namespace MyTestApplication.MultiArray {
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;


/// <remarks/>
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="MultiArray",
Namespace="http://localhost/1.0/MultiArray.wsdl")]
[System.Xml.Serialization.SoapIncludeAttribute(typeof(Property))]
public class MultiArray :
System.Web.Services.Protocols.SoapHttpClientProtocol {

/// <remarks/>
public MultiArray() {
this.Url =
"http://bryce.safe-med.com:1999/safemed/MultiArray";
}

/// <remarks/>

[System.Web.Services.Protocols.SoapRpcMethodAttribute("getProperties",
RequestNamespace="http://localhost/1.0/MultiArray/binding",
ResponseNamespace="http://localhost/1.0/MultiArray/binding")]
[return:
System.Xml.Serialization.SoapElementAttribute("properties")]
public PropertyList[] getProperties(Property[] request) {
object[] results = this.Invoke("getProperties", new
object[] {
request});
return ((PropertyList[])(results[0]));
}

/// <remarks/>
public System.IAsyncResult BegingetProperties(Property[]
request, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("getProperties", new object[] {
request}, callback, asyncState);
}

/// <remarks/>
public PropertyList[] EndgetProperties(System.IAsyncResult
asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((PropertyList[])(results[0]));
}

/// <remarks/>

[System.Web.Services.Protocols.SoapRpcMethodAttribute("getList",
RequestNamespace="http://localhost/1.0/MultiArray/binding",
ResponseNamespace="http://localhost/1.0/MultiArray/binding")]
[return:
System.Xml.Serialization.SoapElementAttribute("response")]
public PropertyList getList(PropertyList request) {
object[] results = this.Invoke("getList", new object[] {
request});
return ((PropertyList)(results[0]));
}

/// <remarks/>
public System.IAsyncResult BegingetList(PropertyList request,
System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("getList", new object[] {
request}, callback, asyncState);
}

/// <remarks/>
public PropertyList EndgetList(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((PropertyList)(results[0]));
}
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Property",
"http://localhost/1.0/MultiArray.sm")]
public class Property {

/// <remarks/>
public string key;

/// <remarks/>
public string value;
}
}




--------------------------------------------------------------------AND
here is the
WSDL----------------------------------------------------------------------- -----

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://localhost/1.0/MultiArray.sm"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://localhost/1.0/MultiArray.wsdl"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://localhost/1.0/MultiArray.wsdl"
name="MultiArray" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Ravi Singh. Copyright
2004</wsdl:documentation>
<wsdl:types>
<s:schema xmlns:SM="http://localhost/1.0/MultiArray.sm"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://localhost/1.0/MultiArray.sm">
<xsd:complexType name="Property">
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="key"
type="xsd:string" />
<xsd:element minOccurs="1" maxOccurs="1" name="value"
type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="PropertyList">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded"
name="item" type="SM:property" />
</xsd:sequence>
<xsd:attribute wsdl:arrayType="SM:property[]"
ref="soapenc:arrayType" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Properties">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded"
name="item" type="SM:propertyList" />
</xsd:sequence>
<xsd:attribute wsdl:arrayType="SM:propertyList[]"
ref="soapenc:arrayType" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</s:schema>
</wsdl:types>
<wsdl:message name="PropertyListRequest">
<wsdl:part name="request" type="s0:propertyList" />
</wsdl:message>
<wsdl:message name="MultiArrayFault">
<wsdl:part name="why" type="s:string" />
</wsdl:message>
<wsdl:message name="PropertiesResponse">
<wsdl:part name="properties" type="s0:properties" />
</wsdl:message>
<wsdl:message name="PropertyListResponse">
<wsdl:part name="response" type="s0:propertyList" />
</wsdl:message>
<wsdl:portType name="MultiArray">
<wsdl:eek:peration name="getProperties">
<wsdl:input message="tns:propertyListRequest" />
<wsdl:eek:utput message="tns:propertiesResponse" />
<wsdl:fault name="fault1" message="tns:MultiArrayFault" />
</wsdl:eek:peration>
<wsdl:eek:peration name="getList">
<wsdl:input message="tns:propertyListRequest" />
<wsdl:eek:utput message="tns:propertyListResponse" />
<wsdl:fault name="fault1" message="tns:MultiArrayFault" />
</wsdl:eek:peration>
</wsdl:portType>
<wsdl:binding name="MultiArray" type="tns:MultiArray">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc" />
<wsdl:eek:peration name="getProperties">
<soap:eek:peration soapAction="getProperties" />
<wsdl:input>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:eek:utput>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:eek:utput>
<wsdl:fault name="fault1">
<soap:fault use="literal" namespace="" encodingStyle="" />
</wsdl:fault>
</wsdl:eek:peration>
<wsdl:eek:peration name="getList">
<soap:eek:peration soapAction="getList" />
<wsdl:input>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:eek:utput>
<soap:body use="encoded"
namespace="http://localhost/1.0/MultiArray/binding"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:eek:utput>
<wsdl:fault name="fault1">
<soap:fault use="literal" namespace="" encodingStyle="" />
</wsdl:fault>
</wsdl:eek:peration>
</wsdl:binding>
<wsdl:service name="MultiArray">
<wsdl:port name="MultiArrayPort" binding="tns:MultiArray">
<soap:address location="http://localhost:1999/safemed/MultiArray"
/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I really do appreciate your help on this matter.


Thanks

-Ravi.
 
R

Ravi Singh (UCSD)

Hello Dan

Thanks for replying.
I am generating the WSDL using Cape Clear then using it with RougeWave
where both document literals and encoded, work just fine.
In .NET when I use document literals, and (do the add the web
reference) it gives me this error.

"Custom tool warning: At least one import Operation is an unsupported
type and has been ignored."

So even though the WSDL is complete the proxy code generated is not.
First time I have seen this error and, searching for it is not very
helpful either.

In addition I thought changing the input parameter to literal and the
output to encoding might be the fix to the above problem. But no such
luck I have tried ever permutation and combination, the minute I use
document literal it spits that error.
 
R

Ravi Singh (UCSD)

Hello Dan

Thanks for replying.
I am generating the WSDL using Cape Clear then using it with RougeWave
where both document literals and encoded, work just fine.
In .NET when I use document literals, and (do the add the web
reference) it gives me this error.

"Custom tool warning: At least one import Operation is an unsupported
type and has been ignored."

So even though the WSDL is complete the proxy code generated is not.
First time I have seen this error and, searching for it is not very
helpful either.

In addition I thought changing the input parameter to literal and the
output to encoding might be the fix to the above problem. But no such
luck I have tried ever permutation and combination, the minute I use
document literal it spits that error.
Greatly appreciate any help you can give.

-Ravi Singh.
 
D

Dan Rogers

Hi Ravi,

If there is an improper import directive in either the WSDL or in the
schema in the types section, this can happen. What happens if you build
your service in .NET.

I don't recommend you waste any more time trying literal/encoded. Make the
server implementation (all inputs and outputs) document literal.

It sounds like you are starting with WSDL, created manually, and then using
tools to generate your service. I can't speak for these tools, but I've
learned to trust the error messages from ASP.net tooling -they're 99.9% of
the time giving you exactly the information you need to start to track down
a problem.

Regards

Dan Rogers
Microsoft Corporation
--------------------
 
R

Ravi Singh (UCSD)

Hello Dan

Thanks for your many valuable suggestions.

I am creating the WSDL from scratch using Cape Clear, and then using
Rouge Wave to generate the Web Service. That works fine, I have tried
the literal/encoded and document/literal and it works fine,
multidimensional arrays, soap encoded arrays e.t.c

For .NET I did change everything to document/literal and it still broke
giving me this error
Custom tool error: Unable to import Web Service/Schema. Unable to
import binding 'SMTest' from namespace Unable to import operation
'getList'. These members may not be derived.
I gather that rectangular arrays are CLS compliant where as jagged
arrays are not and yet this article

http://support.microsoft.com/default.aspx?scid=kb;en-us;316273

says that multidimensional arrays are not supported via Web Services
and recommends jagged arrays, which is what I have been trying to
implement.
Now Jagged arrays when I test within the .NET framework as that article
describes works fine.
I actually first implemented my own version of the above example
(jagged array) to generate a Web Service to see what the WSDL would
look like and then used that idea to do the coding on the UNIX side.
In the end the web service call was being made and even though a jagged
array was being sent back, on the Windows / .NET side it would
interpret it as a single dimensional array.

I believe a problem similar to mine is show cased in the below URL
http://www.dotnet247.com/247reference/msgs/19/95862.aspx

For now I am going to passively search for the solution, or until there
is support for multidimensional arrays in VS2k5? and pass only single
dimension arrays to the .NET side.
Once again, thank you kindly for your suggestions.

-Ravi Singh.
 
D

Dan Rogers

Hi Ravi,

If you could provide an approximate schema representation for what you are
calling a multidimensional array... that would help me put my head around
your issue. Since there really isn't a notion of arrays in schema - just
repeating elements, and I know we can support repeating elements that in
turn contain repeating elements, I'm sure that there is a document literal
form that is sufficient for you needs.

If you are just changing an interface that takes a multidimensional array
from rpc (encoded) to document literal, you aren't solving the problem.
Try making a schema representation that is not a model of a method
signature, but instead is a model of a data structure that would adequately
contain your data. From there, build a service. This is the best approach
for interoperability.

I hope this helps

Dan
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top