By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,302 Members | 1,788 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,302 IT Pros & Developers. It's quick & easy.

Problem of calling WebService in Java.

P: n/a
I hava developed a client in C# that is connected to a 3-party XML Web
Services developed in Java based on the AXIS 1.1. Most methods call are
successful except for one method named "findObjects" and return a complex
type "FieldSearchResult". The error message as following :
"Cannot assign object of type System.String to an object of type
System.String[]. There is an error in XML document (23, 97)."
By the way,I hava written a client in Java and everything is working.
I don’t know how to resolve the problem, can anyone help me?
Thanks!

WSDL,auto-generated proxy class and Web Services Response Message are as
following:

(1) The corresponding WSDL as following:
///////////////////////////////////////////////////////////////////////////////
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions ......>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<simpleType name="passByRef">
<restriction base="xsd:string">
<enumeration value="URL_REF"/>
</restriction>
</simpleType>
<simpleType name="passByValue">
<restriction base="xsd:string">
<enumeration value="VALUE"/>
</restriction>
</simpleType>
<simpleType name="ComparisonOperator">
<restriction base="xsd:string">
<enumeration value="has"/>
<enumeration value="eq"/>
<enumeration value="lt"/>
<enumeration value="le"/>
<enumeration value="gt"/>
<enumeration value="ge"/>
</restriction>
</simpleType>
<complexType name="Condition">
<sequence>
<element name="property" nillable="true" type="xsd:string"/>
<element name="operator" nillable="true" type="tns1:ComparisonOperator"/>
<element name="value" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="DatastreamDef">
<sequence>
<element name="ID" nillable="true" type="xsd:string"/>
<element name="label" nillable="true" type="xsd:string"/>
<element name="MIMEType" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ListSession">
<sequence>
<element name="token" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="cursor" nillable="true"
type="xsd:nonNegativeInteger"/>
<element maxOccurs="1" minOccurs="0" name="completeListSize"
nillable="true" type="xsd:nonNegativeInteger"/>
<element maxOccurs="1" minOccurs="0" name="expirationDate"
nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ObjectFields">
<sequence>
<element maxOccurs="1" minOccurs="0" name="pid" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="label" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="fType" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="cModel" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="state" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="ownerId" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="cDate" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="mDate" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="dcmDate" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="bDef" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="bMech" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="title" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="creator"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="subject"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="description"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="publisher"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="contributor"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="date" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="type" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="format"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="identifier"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="source"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="language"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="relation"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="coverage"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="rights"
nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfObjectFields">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:ObjectFields[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="FieldSearchResult">
<sequence>
<element maxOccurs="1" minOccurs="0" name="listSession" nillable="true"
type="tns1:ListSession"/>
<element name="resultList" nillable="true"
type="tns1:ArrayOfObjectFields"/>
</sequence>
</complexType>
<simpleType name="defaultInputType">
<restriction base="xsd:string">
<enumeration value="fedora:defaultInputType"/>
</restriction>
</simpleType>
<simpleType name="userInputType">
<restriction base="xsd:string">
<enumeration value="fedora:userInputType"/>
</restriction>
</simpleType>
<complexType name="ArrayOfCondition">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:Condition[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="FieldSearchQuery">
<sequence>
<element name="conditions" nillable="true" type="tns1:ArrayOfCondition"/>
<element name="terms" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ObjectProfile">
<sequence>
<element name="pid" nillable="true" type="xsd:string"/>
<element name="objLabel" nillable="true" type="xsd:string"/>
<element name="objContentModel" nillable="true" type="xsd:string"/>
<element name="objType" nillable="true" type="xsd:string"/>
<element name="objCreateDate" nillable="true" type="xsd:string"/>
<element name="objLastModDate" nillable="true" type="xsd:string"/>
<element name="objDissIndexViewURL" nillable="true" type="xsd:string"/>
<element name="objItemIndexViewURL" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfString">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
</restriction>
</complexContent>
</complexType>
<simpleType name="datastreamInputType">
<restriction base="xsd:string">
<enumeration value="fedora:datastreamInputType"/>
</restriction>
</simpleType>
<complexType name="MethodParmDef">
<sequence>
<element name="parmName" nillable="true" type="xsd:string"/>
<element name="parmType" nillable="true" type="xsd:string"/>
<element name="parmDefaultValue" nillable="true" type="xsd:string"/>
<element name="parmDomainValues" nillable="true"
type="tns1:ArrayOfString"/>
<element name="parmRequired" type="xsd:boolean"/>
<element name="parmLabel" nillable="true" type="xsd:string"/>
<element name="parmPassBy" nillable="true" type="xsd:string"/>
<element name="PASS_BY_REF" nillable="true" type="tns1:passByRef"/>
<element name="PASS_BY_VALUE" nillable="true" type="tns1:passByValue"/>
<element name="DATASTREAM_INPUT" nillable="true"
type="tns1:datastreamInputType"/>
<element name="USER_INPUT" nillable="true" type="tns1:userInputType"/>
<element name="DEFAULT_INPUT" nillable="true"
type="tns1:defaultInputType"/>
</sequence>
</complexType>
<complexType name="ArrayOfMethodParmDef">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:MethodParmDef[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ObjectMethodsDef">
<sequence>
<element name="PID" nillable="true" type="xsd:string"/>
<element name="bDefPID" nillable="true" type="xsd:string"/>
<element name="methodName" nillable="true" type="xsd:string"/>
<element name="methodParmDefs" nillable="true"
type="tns1:ArrayOfMethodParmDef"/>
<element name="asOfDate" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="Property">
<sequence>
<element name="name" nillable="true" type="xsd:string"/>
<element name="value" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfProperty">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:Property[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="MIMETypedStream">
<sequence>
<element name="MIMEType" nillable="true" type="xsd:string"/>
<element name="stream" type="xsd:base64Binary"/>
<element name="header" nillable="true" type="tns1:ArrayOfProperty"/>
</sequence>
</complexType>
<complexType name="RepositoryInfo">
<sequence>
<element name="repositoryName" nillable="true" type="xsd:string"/>
<element name="repositoryVersion" nillable="true" type="xsd:string"/>
<element name="repositoryBaseURL" nillable="true" type="xsd:string"/>
<element name="repositoryPIDNamespace" nillable="true" type="xsd:string"/>
<element name="defaultExportFormat" nillable="true" type="xsd:string"/>
<element name="OAINamespace" nillable="true" type="xsd:string"/>
<element name="adminEmailList" nillable="true" type="tns1:ArrayOfString"/>
<element name="samplePID" nillable="true" type="xsd:string"/>
<element name="sampleOAIIdentifier" nillable="true" type="xsd:string"/>
<element name="sampleSearchURL" nillable="true" type="xsd:string"/>
<element name="sampleAccessURL" nillable="true" type="xsd:string"/>
<element name="sampleOAIURL" nillable="true" type="xsd:string"/>
<element name="retainPIDs" nillable="true" type="tns1:ArrayOfString"/>
</sequence>
</complexType>
<complexType name="ArrayOfObjectMethodsDef">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="tns1:ObjectMethodsDef[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ArrayOfDatastreamDef">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns:DatastreamDef[]"/>
</restriction>
</complexContent>
</complexType>
</Schema>
</wsdl:types>
<wsdl:message name="getDatastreamDisseminationResponse">
<wsdl:part name="response" type="tns1:MIMETypedStream"/>
</wsdl:message>
<wsdl:message name="findObjectsRequest">
<wsdl:part name="resultFields" type="tns1:ArrayOfString"/>
<wsdl:part name="maxResults" type="xsd:nonNegativeInteger"/>
<wsdl:part name="query" type="tns1:FieldSearchQuery"/>
</wsdl:message>
<wsdl:message name="getObjectProfileResponse">
<wsdl:part name="response" type="tns1:ObjectProfile"/>
</wsdl:message>
<wsdl:message name="listDatastreamsResponse">
<wsdl:part name="response" type="tns1:ArrayOfDatastreamDef"/>
</wsdl:message>
<wsdl:message name="getObjectHistoryResponse">
<wsdl:part name="response" type="tns1:ArrayOfString"/>
</wsdl:message>
<wsdl:message name="resumeFindObjectsResponse">
<wsdl:part name="response" type="tns1:FieldSearchResult"/>
</wsdl:message>
<wsdl:message name="listDatastreamsRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getObjectHistoryRequest">
<wsdl:part name="pid" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getDisseminationResponse">
<wsdl:part name="response" type="tns1:MIMETypedStream"/>
</wsdl:message>
<wsdl:message name="describeRepositoryResponse">
<wsdl:part name="response" type="tns1:RepositoryInfo"/>
</wsdl:message>
<wsdl:message name="listMethodsRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getDatastreamDisseminationRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="dsID" type="xsd:string"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="resumeFindObjectsRequest">
<wsdl:part name="sessionToken" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="listMethodsResponse">
<wsdl:part name="response" type="tns1:ArrayOfObjectMethodsDef"/>
</wsdl:message>
<wsdl:message name="describeRepositoryRequest">
</wsdl:message>
<wsdl:message name="getDisseminationRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="bDefPid" type="xsd:string"/>
<wsdl:part name="methodName" type="xsd:string"/>
<wsdl:part name="parameters" type="tns1:ArrayOfProperty"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="findObjectsResponse">
<wsdl:part name="response" type="tns1:FieldSearchResult"/>
</wsdl:message>
<wsdl:message name="getObjectProfileRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="Fedora-API-A">
<wsdl:operation name="describeRepository">
<wsdl:input message="impl:describeRepositoryRequest"
name="describeRepositoryRequest"/>
<wsdl:output message="impl:describeRepositoryResponse"
name="describeRepositoryResponse"/>
</wsdl:operation>
<wsdl:operation name="getObjectProfile" parameterOrder="pid asOfDateTime">
<wsdl:input message="impl:getObjectProfileRequest"
name="getObjectProfileRequest"/>
<wsdl:output message="impl:getObjectProfileResponse"
name="getObjectProfileResponse"/>
</wsdl:operation>
<wsdl:operation name="listMethods" parameterOrder="pid asOfDateTime">
<wsdl:input message="impl:listMethodsRequest"
name="listMethodsRequest"/>
<wsdl:output message="impl:listMethodsResponse"
name="listMethodsResponse"/>
</wsdl:operation>
<wsdl:operation name="listDatastreams" parameterOrder="pid asOfDateTime">
<wsdl:input message="impl:listDatastreamsRequest"
name="listDatastreamsRequest"/>
<wsdl:output message="impl:listDatastreamsResponse"
name="listDatastreamsResponse"/>
</wsdl:operation>
<wsdl:operation name="getDatastreamDissemination" parameterOrder="pid
dsID asOfDateTime">
<wsdl:input message="impl:getDatastreamDisseminationRequest"
name="getDatastreamDisseminationRequest"/>
<wsdl:output message="impl:getDatastreamDisseminationResponse"
name="getDatastreamDisseminationResponse"/>
</wsdl:operation>
<wsdl:operation name="getDissemination" parameterOrder="pid bDefPid
methodName parameters asOfDateTime">
<wsdl:input message="impl:getDisseminationRequest"
name="getDisseminationRequest"/>
<wsdl:output message="impl:getDisseminationResponse"
name="getDisseminationResponse"/>
</wsdl:operation>
<wsdl:operation name="findObjects" parameterOrder="resultFields
maxResults query">
<wsdl:input message="impl:findObjectsRequest"
name="findObjectsRequest"/>
<wsdl:output message="impl:findObjectsResponse"
name="findObjectsResponse"/>
</wsdl:operation>
<wsdl:operation name="resumeFindObjects" parameterOrder="sessionToken">
<wsdl:input message="impl:resumeFindObjectsRequest"
name="resumeFindObjectsRequest"/>
<wsdl:output message="impl:resumeFindObjectsResponse"
name="resumeFindObjectsResponse"/>
</wsdl:operation>
<wsdl:operation name="getObjectHistory" parameterOrder="pid">
<wsdl:input message="impl:getObjectHistoryRequest"
name="getObjectHistoryRequest"/>
<wsdl:output message="impl:getObjectHistoryResponse"
name="getObjectHistoryResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="access/soapSoapBinding" type="impl:Fedora-API-A">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="describeRepository">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#describeRepository"/>
<wsdl:input name="describeRepositoryRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="describeRepositoryResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getObjectProfile">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#getObjectProfile"/>
<wsdl:input name="getObjectProfileRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="getObjectProfileResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="listMethods">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#listMethods"/>
<wsdl:input name="listMethodsRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="listMethodsResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="listDatastreams">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#listDatastreams"/>
<wsdl:input name="listDatastreamsRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="listDatastreamsResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getDatastreamDissemination">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#getDatastreamDissemination"/>
<wsdl:input name="getDatastreamDisseminationRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="getDatastreamDisseminationResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getDissemination">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#getDissemination"/>
<wsdl:input name="getDisseminationRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="getDisseminationResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="findObjects">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#findObjects"/>
<wsdl:input name="findObjectsRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="findObjectsResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="resumeFindObjects">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#resumeFindObjects"/>
<wsdl:input name="resumeFindObjectsRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="resumeFindObjectsResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getObjectHistory">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#getObjectHistory"/>
<wsdl:input name="getObjectHistoryRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="getObjectHistoryResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Fedora-API-A-Service">
<wsdl:port binding="impl:access/soapSoapBinding" name="access/soap">
<wsdlsoap:address location="http://localhost:8080/fedora/access/soap"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

(2) And the corresponding classes generated by wsdl.exe in C# are as
following:
///////////////////////////////////////////////////////////////////////////////
namespace FedoraDAL.FedoraAPIA {
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;
using System.Collections;

/// <remarks/>
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]

[System.Web.Services.WebServiceBindingAttribute(Nam e="access/soapSoapBinding", Namespace="http://www.fedora.info/definitions/1/0/api/")]
[System.Xml.Serialization.SoapIncludeAttribute(type of(ObjectFields))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(Condition))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(Property))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(DatastreamDef))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(MethodParmDef))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(ObjectMethodsDef))]
public class FedoraAPIAService :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {
/// <remarks/>
public FedoraAPIAService() {
this.Url = "http://localhost:8080/fedora/access/soap";
}
……
/// <remarks/>
[System.Web.Services.Protocols.SoapRpcMethodttribut e("http://www.fedora.info/definitions/1/0/api/#findObjects",
RequestNamespace="http://www.fedora.info/definitions/1/0/api/",
ResponseNamespace="http://www.fedora.info/definitions/1/0/api/")]°
[return: System.Xml.Serialization.SoapElementAttribute("res ponse")]
public FieldSearchResult findObjects(string[] resultFields,
[System.Xml.Serialization.SoapElementAttribute(Data Type="nonNegativeInteger")] string maxResults, FieldSearchQuery query) {
object[] results = this.Invoke("findObjects", new object[] {
resultFields,
maxResults,
query});
return ((FieldSearchResult)(results[0]));
}

……
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Object Fields",
"http://www.fedora.info/definitions/1/0/types/")]
public class ObjectFields {
/// <remarks/>
public string pid;

/// <remarks/>
public string label;

/// <remarks/>
public string fType;

/// <remarks/>
public string cModel;

/// <remarks/>
public string state;

/// <remarks/>
public string ownerId;

/// <remarks/>
public string cDate;

/// <remarks/>
public string mDate;

/// <remarks/>
public string dcmDate;

/// <remarks/>
public string[] bDef;

/// <remarks/>
public string[] bMech;

/// <remarks/>
public string[] title;

/// <remarks/>
public string[] creator;

/// <remarks/>
public string[] subject;

/// <remarks/>
public string[] description;

/// <remarks/>
public string[] publisher;

/// <remarks/>
public string[] contributor;

/// <remarks/>
public string[] date;

/// <remarks/>
public string[] type;

/// <remarks/>
public string[] format;

/// <remarks/>
public string[] identifier;

/// <remarks/>
public string[] source;

/// <remarks/>
public string[] language;

/// <remarks/>
public string[] relation;

/// <remarks/>
public string[] coverage;

/// <remarks/>
public string[] rights;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("ListSe ssion",
"http://www.fedora.info/definitions/1/0/types/")]
public class ListSession {

/// <remarks/>
public string token;

/// <remarks/>

[System.Xml.Serialization.SoapElementAttribute(Data Type="nonNegativeInteger")]
public string cursor;

/// <remarks/>

[System.Xml.Serialization.SoapElementAttribute(Data Type="nonNegativeInteger")]
public string completeListSize;

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

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("FieldS earchResult",
"http://www.fedora.info/definitions/1/0/types/")]
public class FieldSearchResult {

/// <remarks/>
public ListSession listSession;

/// <remarks/>
public ObjectFields[] resultList;
}
}

(3) And I have trapped the response message from the XML Web Services as
following:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
<?xml version="1.0" encoding="UTF-8"?>.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">.
<soapenv:Body>.
<ns1:findObjectsResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://www.fedora.info/definitions/1/0/api/">.
<response href="#id0"/>.
</ns1:findObjectsResponse>.
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:FieldSearchResult"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://www.fedora.info/definitions/1/0/types/">.
<listSession xsi:type="ns2:ListSession" xsi:nil="true"/>.
<resultList xsi:type="soapenc:Array" soapenc:array
Type="ns2:ObjectFields[1]">.
<item href="#id1"/>.
</resultList>.
</multiRef>.
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:ObjectFields"
xmlns:ns3="http://www.fedora.info/definitions/1/0/types/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">.
<pid xsi:type="xsd:string">demo:1</pid>.
<label xsi:type="xsd:string" xsi:nil="true"/>.
<fType xsi:type="xsd:string" xsi:nil="true"/>.
<cModel xsi:type="xsd:string" xsi:nil="true"/>.
<state xsi:type="xsd:string" xsi:nil="true"/>.
<ownerId xsi:type="xsd:string" xsi:nil="true"/>.
<cDate xsi:type="xsd:string">2004-12-10T00:21:52.000Z</cDate>.
<mDate xsi:type="xsd:string" xsi:nil="true"/>.
<dcmDate xsi:type="xsd:string" xsi:nil="true"/>.
<title xsi:type="xsd:string">Behavior Definition Object for UVA Simple
Image Contract</title>.
</multiRef>.
</soapenv:Body>.
</soapenv:Envelope>.

Nov 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi m8,

The primary problem is "not designed for interoperability" (but
there's no way to change that anymore ;-) ).

The first part of the "findObjectsRequest" message seems to be a
String[]. Is that reflected in the generated proxy on the .Net side?

This is the place i identified as a possible "String to String[]" cast
exception.

Hope this helps,

Marvin Smit
side remarks:
The Axis WebService uses the RPC/Encoded standard. This will NOT work
well with future version of WebServices (rpc/enc = deprecated, use
doc/lit instead)

On Sun, 10 Apr 2005 06:19:01 -0700, "yqlu"
<yq**@discussions.microsoft.com> wrote:
I hava developed a client in C# that is connected to a 3-party XML Web
Services developed in Java based on the AXIS 1.1. Most methods call are
successful except for one method named "findObjects" and return a complex
type "FieldSearchResult". The error message as following :
"Cannot assign object of type System.String to an object of type
System.String[]. There is an error in XML document (23, 97)."
By the way,I hava written a client in Java and everything is working.
I dont know how to resolve the problem, can anyone help me?
Thanks!

WSDL?auto-generated proxy class and Web Services Response Message are as
following:

(1) The corresponding WSDL as following:
///////////////////////////////////////////////////////////////////////////////
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions ......>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<simpleType name="passByRef">
<restriction base="xsd:string">
<enumeration value="URL_REF"/>
</restriction>
</simpleType>
<simpleType name="passByValue">
<restriction base="xsd:string">
<enumeration value="VALUE"/>
</restriction>
</simpleType>
<simpleType name="ComparisonOperator">
<restriction base="xsd:string">
<enumeration value="has"/>
<enumeration value="eq"/>
<enumeration value="lt"/>
<enumeration value="le"/>
<enumeration value="gt"/>
<enumeration value="ge"/>
</restriction>
</simpleType>
<complexType name="Condition">
<sequence>
<element name="property" nillable="true" type="xsd:string"/>
<element name="operator" nillable="true" type="tns1:ComparisonOperator"/>
<element name="value" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="DatastreamDef">
<sequence>
<element name="ID" nillable="true" type="xsd:string"/>
<element name="label" nillable="true" type="xsd:string"/>
<element name="MIMEType" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ListSession">
<sequence>
<element name="token" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="cursor" nillable="true"
type="xsd:nonNegativeInteger"/>
<element maxOccurs="1" minOccurs="0" name="completeListSize"
nillable="true" type="xsd:nonNegativeInteger"/>
<element maxOccurs="1" minOccurs="0" name="expirationDate"
nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ObjectFields">
<sequence>
<element maxOccurs="1" minOccurs="0" name="pid" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="label" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="fType" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="cModel" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="state" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="ownerId" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="cDate" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="mDate" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="dcmDate" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="bDef" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="bMech" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="title" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="creator"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="subject"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="description"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="publisher"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="contributor"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="date" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="type" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="format"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="identifier"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="source"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="language"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="relation"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="coverage"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="rights"
nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfObjectFields">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:ObjectFields[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="FieldSearchResult">
<sequence>
<element maxOccurs="1" minOccurs="0" name="listSession" nillable="true"
type="tns1:ListSession"/>
<element name="resultList" nillable="true"
type="tns1:ArrayOfObjectFields"/>
</sequence>
</complexType>
<simpleType name="defaultInputType">
<restriction base="xsd:string">
<enumeration value="fedora:defaultInputType"/>
</restriction>
</simpleType>
<simpleType name="userInputType">
<restriction base="xsd:string">
<enumeration value="fedora:userInputType"/>
</restriction>
</simpleType>
<complexType name="ArrayOfCondition">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:Condition[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="FieldSearchQuery">
<sequence>
<element name="conditions" nillable="true" type="tns1:ArrayOfCondition"/>
<element name="terms" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ObjectProfile">
<sequence>
<element name="pid" nillable="true" type="xsd:string"/>
<element name="objLabel" nillable="true" type="xsd:string"/>
<element name="objContentModel" nillable="true" type="xsd:string"/>
<element name="objType" nillable="true" type="xsd:string"/>
<element name="objCreateDate" nillable="true" type="xsd:string"/>
<element name="objLastModDate" nillable="true" type="xsd:string"/>
<element name="objDissIndexViewURL" nillable="true" type="xsd:string"/>
<element name="objItemIndexViewURL" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfString">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
</restriction>
</complexContent>
</complexType>
<simpleType name="datastreamInputType">
<restriction base="xsd:string">
<enumeration value="fedora:datastreamInputType"/>
</restriction>
</simpleType>
<complexType name="MethodParmDef">
<sequence>
<element name="parmName" nillable="true" type="xsd:string"/>
<element name="parmType" nillable="true" type="xsd:string"/>
<element name="parmDefaultValue" nillable="true" type="xsd:string"/>
<element name="parmDomainValues" nillable="true"
type="tns1:ArrayOfString"/>
<element name="parmRequired" type="xsd:boolean"/>
<element name="parmLabel" nillable="true" type="xsd:string"/>
<element name="parmPassBy" nillable="true" type="xsd:string"/>
<element name="PASS_BY_REF" nillable="true" type="tns1:passByRef"/>
<element name="PASS_BY_VALUE" nillable="true" type="tns1:passByValue"/>
<element name="DATASTREAM_INPUT" nillable="true"
type="tns1:datastreamInputType"/>
<element name="USER_INPUT" nillable="true" type="tns1:userInputType"/>
<element name="DEFAULT_INPUT" nillable="true"
type="tns1:defaultInputType"/>
</sequence>
</complexType>
<complexType name="ArrayOfMethodParmDef">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:MethodParmDef[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ObjectMethodsDef">
<sequence>
<element name="PID" nillable="true" type="xsd:string"/>
<element name="bDefPID" nillable="true" type="xsd:string"/>
<element name="methodName" nillable="true" type="xsd:string"/>
<element name="methodParmDefs" nillable="true"
type="tns1:ArrayOfMethodParmDef"/>
<element name="asOfDate" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="Property">
<sequence>
<element name="name" nillable="true" type="xsd:string"/>
<element name="value" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfProperty">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:Property[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="MIMETypedStream">
<sequence>
<element name="MIMEType" nillable="true" type="xsd:string"/>
<element name="stream" type="xsd:base64Binary"/>
<element name="header" nillable="true" type="tns1:ArrayOfProperty"/>
</sequence>
</complexType>
<complexType name="RepositoryInfo">
<sequence>
<element name="repositoryName" nillable="true" type="xsd:string"/>
<element name="repositoryVersion" nillable="true" type="xsd:string"/>
<element name="repositoryBaseURL" nillable="true" type="xsd:string"/>
<element name="repositoryPIDNamespace" nillable="true" type="xsd:string"/>
<element name="defaultExportFormat" nillable="true" type="xsd:string"/>
<element name="OAINamespace" nillable="true" type="xsd:string"/>
<element name="adminEmailList" nillable="true" type="tns1:ArrayOfString"/>
<element name="samplePID" nillable="true" type="xsd:string"/>
<element name="sampleOAIIdentifier" nillable="true" type="xsd:string"/>
<element name="sampleSearchURL" nillable="true" type="xsd:string"/>
<element name="sampleAccessURL" nillable="true" type="xsd:string"/>
<element name="sampleOAIURL" nillable="true" type="xsd:string"/>
<element name="retainPIDs" nillable="true" type="tns1:ArrayOfString"/>
</sequence>
</complexType>
<complexType name="ArrayOfObjectMethodsDef">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="tns1:ObjectMethodsDef[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ArrayOfDatastreamDef">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns:DatastreamDef[]"/>
</restriction>
</complexContent>
</complexType>
</Schema>
</wsdl:types>
<wsdl:message name="getDatastreamDisseminationResponse">
<wsdl:part name="response" type="tns1:MIMETypedStream"/>
</wsdl:message>
<wsdl:message name="findObjectsRequest">
<wsdl:part name="resultFields" type="tns1:ArrayOfString"/>
<wsdl:part name="maxResults" type="xsd:nonNegativeInteger"/>
<wsdl:part name="query" type="tns1:FieldSearchQuery"/>
</wsdl:message>
<wsdl:message name="getObjectProfileResponse">
<wsdl:part name="response" type="tns1:ObjectProfile"/>
</wsdl:message>
<wsdl:message name="listDatastreamsResponse">
<wsdl:part name="response" type="tns1:ArrayOfDatastreamDef"/>
</wsdl:message>
<wsdl:message name="getObjectHistoryResponse">
<wsdl:part name="response" type="tns1:ArrayOfString"/>
</wsdl:message>
<wsdl:message name="resumeFindObjectsResponse">
<wsdl:part name="response" type="tns1:FieldSearchResult"/>
</wsdl:message>
<wsdl:message name="listDatastreamsRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getObjectHistoryRequest">
<wsdl:part name="pid" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getDisseminationResponse">
<wsdl:part name="response" type="tns1:MIMETypedStream"/>
</wsdl:message>
<wsdl:message name="describeRepositoryResponse">
<wsdl:part name="response" type="tns1:RepositoryInfo"/>
</wsdl:message>
<wsdl:message name="listMethodsRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getDatastreamDisseminationRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="dsID" type="xsd:string"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="resumeFindObjectsRequest">
<wsdl:part name="sessionToken" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="listMethodsResponse">
<wsdl:part name="response" type="tns1:ArrayOfObjectMethodsDef"/>
</wsdl:message>
<wsdl:message name="describeRepositoryRequest">
</wsdl:message>
<wsdl:message name="getDisseminationRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="bDefPid" type="xsd:string"/>
<wsdl:part name="methodName" type="xsd:string"/>
<wsdl:part name="parameters" type="tns1:ArrayOfProperty"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="findObjectsResponse">
<wsdl:part name="response" type="tns1:FieldSearchResult"/>
</wsdl:message>
<wsdl:message name="getObjectProfileRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="Fedora-API-A">
<wsdl:operation name="describeRepository">
<wsdl:input message="impl:describeRepositoryRequest"
name="describeRepositoryRequest"/>
<wsdl:output message="impl:describeRepositoryResponse"
name="describeRepositoryResponse"/>
</wsdl:operation>
<wsdl:operation name="getObjectProfile" parameterOrder="pid asOfDateTime">
<wsdl:input message="impl:getObjectProfileRequest"
name="getObjectProfileRequest"/>
<wsdl:output message="impl:getObjectProfileResponse"
name="getObjectProfileResponse"/>
</wsdl:operation>
<wsdl:operation name="listMethods" parameterOrder="pid asOfDateTime">
<wsdl:input message="impl:listMethodsRequest"
name="listMethodsRequest"/>
<wsdl:output message="impl:listMethodsResponse"
name="listMethodsResponse"/>
</wsdl:operation>
<wsdl:operation name="listDatastreams" parameterOrder="pid asOfDateTime">
<wsdl:input message="impl:listDatastreamsRequest"
name="listDatastreamsRequest"/>
<wsdl:output message="impl:listDatastreamsResponse"
name="listDatastreamsResponse"/>
</wsdl:operation>
<wsdl:operation name="getDatastreamDissemination" parameterOrder="pid
dsID asOfDateTime">
<wsdl:input message="impl:getDatastreamDisseminationRequest"
name="getDatastreamDisseminationRequest"/>
<wsdl:output message="impl:getDatastreamDisseminationResponse"
name="getDatastreamDisseminationResponse"/>
</wsdl:operation>
<wsdl:operation name="getDissemination" parameterOrder="pid bDefPid
methodName parameters asOfDateTime">
<wsdl:input message="impl:getDisseminationRequest"
name="getDisseminationRequest"/>
<wsdl:output message="impl:getDisseminationResponse"
name="getDisseminationResponse"/>
</wsdl:operation>
<wsdl:operation name="findObjects" parameterOrder="resultFields
maxResults query">
<wsdl:input message="impl:findObjectsRequest"
name="findObjectsRequest"/>
<wsdl:output message="impl:findObjectsResponse"
name="findObjectsResponse"/>
</wsdl:operation>
<wsdl:operation name="resumeFindObjects" parameterOrder="sessionToken">
<wsdl:input message="impl:resumeFindObjectsRequest"
name="resumeFindObjectsRequest"/>
<wsdl:output message="impl:resumeFindObjectsResponse"
name="resumeFindObjectsResponse"/>
</wsdl:operation>
<wsdl:operation name="getObjectHistory" parameterOrder="pid">
<wsdl:input message="impl:getObjectHistoryRequest"
name="getObjectHistoryRequest"/>
<wsdl:output message="impl:getObjectHistoryResponse"
name="getObjectHistoryResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="access/soapSoapBinding" type="impl:Fedora-API-A">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="describeRepository">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#describeRepository"/>
<wsdl:input name="describeRepositoryRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="describeRepositoryResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getObjectProfile">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#getObjectProfile"/>
<wsdl:input name="getObjectProfileRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="getObjectProfileResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="listMethods">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#listMethods"/>
<wsdl:input name="listMethodsRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="listMethodsResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="listDatastreams">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#listDatastreams"/>
<wsdl:input name="listDatastreamsRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="listDatastreamsResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getDatastreamDissemination">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#getDatastreamDissemination"/>
<wsdl:input name="getDatastreamDisseminationRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="getDatastreamDisseminationResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getDissemination">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#getDissemination"/>
<wsdl:input name="getDisseminationRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="getDisseminationResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="findObjects">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#findObjects"/>
<wsdl:input name="findObjectsRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="findObjectsResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="resumeFindObjects">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#resumeFindObjects"/>
<wsdl:input name="resumeFindObjectsRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="resumeFindObjectsResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getObjectHistory">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#getObjectHistory"/>
<wsdl:input name="getObjectHistoryRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="getObjectHistoryResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Fedora-API-A-Service">
<wsdl:port binding="impl:access/soapSoapBinding" name="access/soap">
<wsdlsoap:address location="http://localhost:8080/fedora/access/soap"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

(2) And the corresponding classes generated by wsdl.exe in C# are as
following:
///////////////////////////////////////////////////////////////////////////////
namespace FedoraDAL.FedoraAPIA {
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;
using System.Collections;

/// <remarks/>
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]

[System.Web.Services.WebServiceBindingAttribute(Nam e="access/soapSoapBinding", Namespace="http://www.fedora.info/definitions/1/0/api/")]
[System.Xml.Serialization.SoapIncludeAttribute(type of(ObjectFields))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(Condition))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(Property))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(DatastreamDef))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(MethodParmDef))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(ObjectMethodsDef))]
public class FedoraAPIAService :
System.Web.Services.Protocols.SoapHttpClientProto col {
/// <remarks/>
public FedoraAPIAService() {
this.Url = "http://localhost:8080/fedora/access/soap";
}

/// <remarks/>
[System.Web.Services.Protocols.SoapRpcMethodttribut e("http://www.fedora.info/definitions/1/0/api/#findObjects",
RequestNamespace="http://www.fedora.info/definitions/1/0/api/",
ResponseNamespace="http://www.fedora.info/definitions/1/0/api/")]
[return: System.Xml.Serialization.SoapElementAttribute("res ponse")]
public FieldSearchResult findObjects(string[] resultFields,
[System.Xml.Serialization.SoapElementAttribute(Data Type="nonNegativeInteger")] string maxResults, FieldSearchQuery query) {
object[] results = this.Invoke("findObjects", new object[] {
resultFields,
maxResults,
query});
return ((FieldSearchResult)(results[0]));
}


}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Object Fields",
"http://www.fedora.info/definitions/1/0/types/")]
public class ObjectFields {
/// <remarks/>
public string pid;

/// <remarks/>
public string label;

/// <remarks/>
public string fType;

/// <remarks/>
public string cModel;

/// <remarks/>
public string state;

/// <remarks/>
public string ownerId;

/// <remarks/>
public string cDate;

/// <remarks/>
public string mDate;

/// <remarks/>
public string dcmDate;

/// <remarks/>
public string[] bDef;

/// <remarks/>
public string[] bMech;

/// <remarks/>
public string[] title;

/// <remarks/>
public string[] creator;

/// <remarks/>
public string[] subject;

/// <remarks/>
public string[] description;

/// <remarks/>
public string[] publisher;

/// <remarks/>
public string[] contributor;

/// <remarks/>
public string[] date;

/// <remarks/>
public string[] type;

/// <remarks/>
public string[] format;

/// <remarks/>
public string[] identifier;

/// <remarks/>
public string[] source;

/// <remarks/>
public string[] language;

/// <remarks/>
public string[] relation;

/// <remarks/>
public string[] coverage;

/// <remarks/>
public string[] rights;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("ListSe ssion",
"http://www.fedora.info/definitions/1/0/types/")]
public class ListSession {

/// <remarks/>
public string token;

/// <remarks/>

[System.Xml.Serialization.SoapElementAttribute(Data Type="nonNegativeInteger")]
public string cursor;

/// <remarks/>

[System.Xml.Serialization.SoapElementAttribute(Data Type="nonNegativeInteger")]
public string completeListSize;

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

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("FieldS earchResult",
"http://www.fedora.info/definitions/1/0/types/")]
public class FieldSearchResult {

/// <remarks/>
public ListSession listSession;

/// <remarks/>
public ObjectFields[] resultList;
}
}

(3) And I have trapped the response message from the XML Web Services as
following:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
<?xml version="1.0" encoding="UTF-8"?>.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">.
<soapenv:Body>.
<ns1:findObjectsResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://www.fedora.info/definitions/1/0/api/">.
<response href="#id0"/>.
</ns1:findObjectsResponse>.
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:FieldSearchResult"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://www.fedora.info/definitions/1/0/types/">.
<listSession xsi:type="ns2:ListSession" xsi:nil="true"/>.
<resultList xsi:type="soapenc:Array" soapenc:array
Type="ns2:ObjectFields[1]">.
<item href="#id1"/>.
</resultList>.
</multiRef>.
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:ObjectFields"
xmlns:ns3="http://www.fedora.info/definitions/1/0/types/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">.
<pid xsi:type="xsd:string">demo:1</pid>.
<label xsi:type="xsd:string" xsi:nil="true"/>.
<fType xsi:type="xsd:string" xsi:nil="true"/>.
<cModel xsi:type="xsd:string" xsi:nil="true"/>.
<state xsi:type="xsd:string" xsi:nil="true"/>.
<ownerId xsi:type="xsd:string" xsi:nil="true"/>.
<cDate xsi:type="xsd:string">2004-12-10T00:21:52.000Z</cDate>.
<mDate xsi:type="xsd:string" xsi:nil="true"/>.
<dcmDate xsi:type="xsd:string" xsi:nil="true"/>.
<title xsi:type="xsd:string">Behavior Definition Object for UVA Simple
Image Contract</title>.
</multiRef>.
</soapenv:Body>.
</soapenv:Envelope>.


Nov 23 '05 #2

P: n/a
Hi m8,

The primary problem is "not designed for interoperability" (but
there's no way to change that anymore ;-) ).

The first part of the "findObjectsRequest" message seems to be a
String[]. Is that reflected in the generated proxy on the .Net side?

This is the place i identified as a possible "String to String[]" cast
exception.

Hope this helps,

Marvin Smit
side remarks:
The Axis WebService uses the RPC/Encoded standard. This will NOT work
well with future version of WebServices (rpc/enc = deprecated, use
doc/lit instead)

On Sun, 10 Apr 2005 06:19:01 -0700, "yqlu"
<yq**@discussions.microsoft.com> wrote:
I hava developed a client in C# that is connected to a 3-party XML Web
Services developed in Java based on the AXIS 1.1. Most methods call are
successful except for one method named "findObjects" and return a complex
type "FieldSearchResult". The error message as following :
"Cannot assign object of type System.String to an object of type
System.String[]. There is an error in XML document (23, 97)."
By the way,I hava written a client in Java and everything is working.
I dont know how to resolve the problem, can anyone help me?
Thanks!

WSDL?auto-generated proxy class and Web Services Response Message are as
following:

(1) The corresponding WSDL as following:
///////////////////////////////////////////////////////////////////////////////
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions ......>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<simpleType name="passByRef">
<restriction base="xsd:string">
<enumeration value="URL_REF"/>
</restriction>
</simpleType>
<simpleType name="passByValue">
<restriction base="xsd:string">
<enumeration value="VALUE"/>
</restriction>
</simpleType>
<simpleType name="ComparisonOperator">
<restriction base="xsd:string">
<enumeration value="has"/>
<enumeration value="eq"/>
<enumeration value="lt"/>
<enumeration value="le"/>
<enumeration value="gt"/>
<enumeration value="ge"/>
</restriction>
</simpleType>
<complexType name="Condition">
<sequence>
<element name="property" nillable="true" type="xsd:string"/>
<element name="operator" nillable="true" type="tns1:ComparisonOperator"/>
<element name="value" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="DatastreamDef">
<sequence>
<element name="ID" nillable="true" type="xsd:string"/>
<element name="label" nillable="true" type="xsd:string"/>
<element name="MIMEType" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ListSession">
<sequence>
<element name="token" nillable="true" type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="cursor" nillable="true"
type="xsd:nonNegativeInteger"/>
<element maxOccurs="1" minOccurs="0" name="completeListSize"
nillable="true" type="xsd:nonNegativeInteger"/>
<element maxOccurs="1" minOccurs="0" name="expirationDate"
nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ObjectFields">
<sequence>
<element maxOccurs="1" minOccurs="0" name="pid" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="label" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="fType" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="cModel" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="state" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="ownerId" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="cDate" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="mDate" nillable="true"
type="xsd:string"/>
<element maxOccurs="1" minOccurs="0" name="dcmDate" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="bDef" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="bMech" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="title" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="creator"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="subject"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="description"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="publisher"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="contributor"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="date" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="type" nillable="true"
type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="format"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="identifier"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="source"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="language"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="relation"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="coverage"
nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" minOccurs="0" name="rights"
nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfObjectFields">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:ObjectFields[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="FieldSearchResult">
<sequence>
<element maxOccurs="1" minOccurs="0" name="listSession" nillable="true"
type="tns1:ListSession"/>
<element name="resultList" nillable="true"
type="tns1:ArrayOfObjectFields"/>
</sequence>
</complexType>
<simpleType name="defaultInputType">
<restriction base="xsd:string">
<enumeration value="fedora:defaultInputType"/>
</restriction>
</simpleType>
<simpleType name="userInputType">
<restriction base="xsd:string">
<enumeration value="fedora:userInputType"/>
</restriction>
</simpleType>
<complexType name="ArrayOfCondition">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:Condition[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="FieldSearchQuery">
<sequence>
<element name="conditions" nillable="true" type="tns1:ArrayOfCondition"/>
<element name="terms" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ObjectProfile">
<sequence>
<element name="pid" nillable="true" type="xsd:string"/>
<element name="objLabel" nillable="true" type="xsd:string"/>
<element name="objContentModel" nillable="true" type="xsd:string"/>
<element name="objType" nillable="true" type="xsd:string"/>
<element name="objCreateDate" nillable="true" type="xsd:string"/>
<element name="objLastModDate" nillable="true" type="xsd:string"/>
<element name="objDissIndexViewURL" nillable="true" type="xsd:string"/>
<element name="objItemIndexViewURL" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfString">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
</restriction>
</complexContent>
</complexType>
<simpleType name="datastreamInputType">
<restriction base="xsd:string">
<enumeration value="fedora:datastreamInputType"/>
</restriction>
</simpleType>
<complexType name="MethodParmDef">
<sequence>
<element name="parmName" nillable="true" type="xsd:string"/>
<element name="parmType" nillable="true" type="xsd:string"/>
<element name="parmDefaultValue" nillable="true" type="xsd:string"/>
<element name="parmDomainValues" nillable="true"
type="tns1:ArrayOfString"/>
<element name="parmRequired" type="xsd:boolean"/>
<element name="parmLabel" nillable="true" type="xsd:string"/>
<element name="parmPassBy" nillable="true" type="xsd:string"/>
<element name="PASS_BY_REF" nillable="true" type="tns1:passByRef"/>
<element name="PASS_BY_VALUE" nillable="true" type="tns1:passByValue"/>
<element name="DATASTREAM_INPUT" nillable="true"
type="tns1:datastreamInputType"/>
<element name="USER_INPUT" nillable="true" type="tns1:userInputType"/>
<element name="DEFAULT_INPUT" nillable="true"
type="tns1:defaultInputType"/>
</sequence>
</complexType>
<complexType name="ArrayOfMethodParmDef">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:MethodParmDef[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ObjectMethodsDef">
<sequence>
<element name="PID" nillable="true" type="xsd:string"/>
<element name="bDefPID" nillable="true" type="xsd:string"/>
<element name="methodName" nillable="true" type="xsd:string"/>
<element name="methodParmDefs" nillable="true"
type="tns1:ArrayOfMethodParmDef"/>
<element name="asOfDate" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="Property">
<sequence>
<element name="name" nillable="true" type="xsd:string"/>
<element name="value" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfProperty">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:Property[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="MIMETypedStream">
<sequence>
<element name="MIMEType" nillable="true" type="xsd:string"/>
<element name="stream" type="xsd:base64Binary"/>
<element name="header" nillable="true" type="tns1:ArrayOfProperty"/>
</sequence>
</complexType>
<complexType name="RepositoryInfo">
<sequence>
<element name="repositoryName" nillable="true" type="xsd:string"/>
<element name="repositoryVersion" nillable="true" type="xsd:string"/>
<element name="repositoryBaseURL" nillable="true" type="xsd:string"/>
<element name="repositoryPIDNamespace" nillable="true" type="xsd:string"/>
<element name="defaultExportFormat" nillable="true" type="xsd:string"/>
<element name="OAINamespace" nillable="true" type="xsd:string"/>
<element name="adminEmailList" nillable="true" type="tns1:ArrayOfString"/>
<element name="samplePID" nillable="true" type="xsd:string"/>
<element name="sampleOAIIdentifier" nillable="true" type="xsd:string"/>
<element name="sampleSearchURL" nillable="true" type="xsd:string"/>
<element name="sampleAccessURL" nillable="true" type="xsd:string"/>
<element name="sampleOAIURL" nillable="true" type="xsd:string"/>
<element name="retainPIDs" nillable="true" type="tns1:ArrayOfString"/>
</sequence>
</complexType>
<complexType name="ArrayOfObjectMethodsDef">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="tns1:ObjectMethodsDef[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ArrayOfDatastreamDef">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="tns:DatastreamDef[]"/>
</restriction>
</complexContent>
</complexType>
</Schema>
</wsdl:types>
<wsdl:message name="getDatastreamDisseminationResponse">
<wsdl:part name="response" type="tns1:MIMETypedStream"/>
</wsdl:message>
<wsdl:message name="findObjectsRequest">
<wsdl:part name="resultFields" type="tns1:ArrayOfString"/>
<wsdl:part name="maxResults" type="xsd:nonNegativeInteger"/>
<wsdl:part name="query" type="tns1:FieldSearchQuery"/>
</wsdl:message>
<wsdl:message name="getObjectProfileResponse">
<wsdl:part name="response" type="tns1:ObjectProfile"/>
</wsdl:message>
<wsdl:message name="listDatastreamsResponse">
<wsdl:part name="response" type="tns1:ArrayOfDatastreamDef"/>
</wsdl:message>
<wsdl:message name="getObjectHistoryResponse">
<wsdl:part name="response" type="tns1:ArrayOfString"/>
</wsdl:message>
<wsdl:message name="resumeFindObjectsResponse">
<wsdl:part name="response" type="tns1:FieldSearchResult"/>
</wsdl:message>
<wsdl:message name="listDatastreamsRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getObjectHistoryRequest">
<wsdl:part name="pid" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getDisseminationResponse">
<wsdl:part name="response" type="tns1:MIMETypedStream"/>
</wsdl:message>
<wsdl:message name="describeRepositoryResponse">
<wsdl:part name="response" type="tns1:RepositoryInfo"/>
</wsdl:message>
<wsdl:message name="listMethodsRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getDatastreamDisseminationRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="dsID" type="xsd:string"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="resumeFindObjectsRequest">
<wsdl:part name="sessionToken" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="listMethodsResponse">
<wsdl:part name="response" type="tns1:ArrayOfObjectMethodsDef"/>
</wsdl:message>
<wsdl:message name="describeRepositoryRequest">
</wsdl:message>
<wsdl:message name="getDisseminationRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="bDefPid" type="xsd:string"/>
<wsdl:part name="methodName" type="xsd:string"/>
<wsdl:part name="parameters" type="tns1:ArrayOfProperty"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="findObjectsResponse">
<wsdl:part name="response" type="tns1:FieldSearchResult"/>
</wsdl:message>
<wsdl:message name="getObjectProfileRequest">
<wsdl:part name="pid" type="xsd:string"/>
<wsdl:part name="asOfDateTime" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="Fedora-API-A">
<wsdl:operation name="describeRepository">
<wsdl:input message="impl:describeRepositoryRequest"
name="describeRepositoryRequest"/>
<wsdl:output message="impl:describeRepositoryResponse"
name="describeRepositoryResponse"/>
</wsdl:operation>
<wsdl:operation name="getObjectProfile" parameterOrder="pid asOfDateTime">
<wsdl:input message="impl:getObjectProfileRequest"
name="getObjectProfileRequest"/>
<wsdl:output message="impl:getObjectProfileResponse"
name="getObjectProfileResponse"/>
</wsdl:operation>
<wsdl:operation name="listMethods" parameterOrder="pid asOfDateTime">
<wsdl:input message="impl:listMethodsRequest"
name="listMethodsRequest"/>
<wsdl:output message="impl:listMethodsResponse"
name="listMethodsResponse"/>
</wsdl:operation>
<wsdl:operation name="listDatastreams" parameterOrder="pid asOfDateTime">
<wsdl:input message="impl:listDatastreamsRequest"
name="listDatastreamsRequest"/>
<wsdl:output message="impl:listDatastreamsResponse"
name="listDatastreamsResponse"/>
</wsdl:operation>
<wsdl:operation name="getDatastreamDissemination" parameterOrder="pid
dsID asOfDateTime">
<wsdl:input message="impl:getDatastreamDisseminationRequest"
name="getDatastreamDisseminationRequest"/>
<wsdl:output message="impl:getDatastreamDisseminationResponse"
name="getDatastreamDisseminationResponse"/>
</wsdl:operation>
<wsdl:operation name="getDissemination" parameterOrder="pid bDefPid
methodName parameters asOfDateTime">
<wsdl:input message="impl:getDisseminationRequest"
name="getDisseminationRequest"/>
<wsdl:output message="impl:getDisseminationResponse"
name="getDisseminationResponse"/>
</wsdl:operation>
<wsdl:operation name="findObjects" parameterOrder="resultFields
maxResults query">
<wsdl:input message="impl:findObjectsRequest"
name="findObjectsRequest"/>
<wsdl:output message="impl:findObjectsResponse"
name="findObjectsResponse"/>
</wsdl:operation>
<wsdl:operation name="resumeFindObjects" parameterOrder="sessionToken">
<wsdl:input message="impl:resumeFindObjectsRequest"
name="resumeFindObjectsRequest"/>
<wsdl:output message="impl:resumeFindObjectsResponse"
name="resumeFindObjectsResponse"/>
</wsdl:operation>
<wsdl:operation name="getObjectHistory" parameterOrder="pid">
<wsdl:input message="impl:getObjectHistoryRequest"
name="getObjectHistoryRequest"/>
<wsdl:output message="impl:getObjectHistoryResponse"
name="getObjectHistoryResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="access/soapSoapBinding" type="impl:Fedora-API-A">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="describeRepository">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#describeRepository"/>
<wsdl:input name="describeRepositoryRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="describeRepositoryResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getObjectProfile">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#getObjectProfile"/>
<wsdl:input name="getObjectProfileRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="getObjectProfileResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="listMethods">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#listMethods"/>
<wsdl:input name="listMethodsRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="listMethodsResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="listDatastreams">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#listDatastreams"/>
<wsdl:input name="listDatastreamsRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="listDatastreamsResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getDatastreamDissemination">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#getDatastreamDissemination"/>
<wsdl:input name="getDatastreamDisseminationRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="getDatastreamDisseminationResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getDissemination">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#getDissemination"/>
<wsdl:input name="getDisseminationRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="getDisseminationResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="findObjects">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#findObjects"/>
<wsdl:input name="findObjectsRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="findObjectsResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="resumeFindObjects">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#resumeFindObjects"/>
<wsdl:input name="resumeFindObjectsRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="resumeFindObjectsResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getObjectHistory">
<wsdlsoap:operation
soapAction="http://www.fedora.info/definitions/1/0/api/#getObjectHistory"/>
<wsdl:input name="getObjectHistoryRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:input>
<wsdl:output name="getObjectHistoryResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.fedora.info/definitions/1/0/api/" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Fedora-API-A-Service">
<wsdl:port binding="impl:access/soapSoapBinding" name="access/soap">
<wsdlsoap:address location="http://localhost:8080/fedora/access/soap"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

(2) And the corresponding classes generated by wsdl.exe in C# are as
following:
///////////////////////////////////////////////////////////////////////////////
namespace FedoraDAL.FedoraAPIA {
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;
using System.Collections;

/// <remarks/>
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]

[System.Web.Services.WebServiceBindingAttribute(Nam e="access/soapSoapBinding", Namespace="http://www.fedora.info/definitions/1/0/api/")]
[System.Xml.Serialization.SoapIncludeAttribute(type of(ObjectFields))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(Condition))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(Property))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(DatastreamDef))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(MethodParmDef))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(ObjectMethodsDef))]
public class FedoraAPIAService :
System.Web.Services.Protocols.SoapHttpClientProto col {
/// <remarks/>
public FedoraAPIAService() {
this.Url = "http://localhost:8080/fedora/access/soap";
}

/// <remarks/>
[System.Web.Services.Protocols.SoapRpcMethodttribut e("http://www.fedora.info/definitions/1/0/api/#findObjects",
RequestNamespace="http://www.fedora.info/definitions/1/0/api/",
ResponseNamespace="http://www.fedora.info/definitions/1/0/api/")]
[return: System.Xml.Serialization.SoapElementAttribute("res ponse")]
public FieldSearchResult findObjects(string[] resultFields,
[System.Xml.Serialization.SoapElementAttribute(Data Type="nonNegativeInteger")] string maxResults, FieldSearchQuery query) {
object[] results = this.Invoke("findObjects", new object[] {
resultFields,
maxResults,
query});
return ((FieldSearchResult)(results[0]));
}


}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Object Fields",
"http://www.fedora.info/definitions/1/0/types/")]
public class ObjectFields {
/// <remarks/>
public string pid;

/// <remarks/>
public string label;

/// <remarks/>
public string fType;

/// <remarks/>
public string cModel;

/// <remarks/>
public string state;

/// <remarks/>
public string ownerId;

/// <remarks/>
public string cDate;

/// <remarks/>
public string mDate;

/// <remarks/>
public string dcmDate;

/// <remarks/>
public string[] bDef;

/// <remarks/>
public string[] bMech;

/// <remarks/>
public string[] title;

/// <remarks/>
public string[] creator;

/// <remarks/>
public string[] subject;

/// <remarks/>
public string[] description;

/// <remarks/>
public string[] publisher;

/// <remarks/>
public string[] contributor;

/// <remarks/>
public string[] date;

/// <remarks/>
public string[] type;

/// <remarks/>
public string[] format;

/// <remarks/>
public string[] identifier;

/// <remarks/>
public string[] source;

/// <remarks/>
public string[] language;

/// <remarks/>
public string[] relation;

/// <remarks/>
public string[] coverage;

/// <remarks/>
public string[] rights;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("ListSe ssion",
"http://www.fedora.info/definitions/1/0/types/")]
public class ListSession {

/// <remarks/>
public string token;

/// <remarks/>

[System.Xml.Serialization.SoapElementAttribute(Data Type="nonNegativeInteger")]
public string cursor;

/// <remarks/>

[System.Xml.Serialization.SoapElementAttribute(Data Type="nonNegativeInteger")]
public string completeListSize;

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

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("FieldS earchResult",
"http://www.fedora.info/definitions/1/0/types/")]
public class FieldSearchResult {

/// <remarks/>
public ListSession listSession;

/// <remarks/>
public ObjectFields[] resultList;
}
}

(3) And I have trapped the response message from the XML Web Services as
following:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
<?xml version="1.0" encoding="UTF-8"?>.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">.
<soapenv:Body>.
<ns1:findObjectsResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://www.fedora.info/definitions/1/0/api/">.
<response href="#id0"/>.
</ns1:findObjectsResponse>.
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:FieldSearchResult"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://www.fedora.info/definitions/1/0/types/">.
<listSession xsi:type="ns2:ListSession" xsi:nil="true"/>.
<resultList xsi:type="soapenc:Array" soapenc:array
Type="ns2:ObjectFields[1]">.
<item href="#id1"/>.
</resultList>.
</multiRef>.
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:ObjectFields"
xmlns:ns3="http://www.fedora.info/definitions/1/0/types/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">.
<pid xsi:type="xsd:string">demo:1</pid>.
<label xsi:type="xsd:string" xsi:nil="true"/>.
<fType xsi:type="xsd:string" xsi:nil="true"/>.
<cModel xsi:type="xsd:string" xsi:nil="true"/>.
<state xsi:type="xsd:string" xsi:nil="true"/>.
<ownerId xsi:type="xsd:string" xsi:nil="true"/>.
<cDate xsi:type="xsd:string">2004-12-10T00:21:52.000Z</cDate>.
<mDate xsi:type="xsd:string" xsi:nil="true"/>.
<dcmDate xsi:type="xsd:string" xsi:nil="true"/>.
<title xsi:type="xsd:string">Behavior Definition Object for UVA Simple
Image Contract</title>.
</multiRef>.
</soapenv:Body>.
</soapenv:Envelope>.


Nov 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.