Problems consuming a webservice in Excel2003

M

Marian Aldenhövel

Hi,

I am not a MS-Office expert but have been tasked with trying something
new to me. If there is a better place to ask this question, please feel
free to point me to it.

I have built a Webservice in Delphi 2007. It works fine with a client
built in D2007 and with a generic webbased client. Now I would like to
consume it using Excel 2003. The final goal is to fill a statistics
spreadsheet with a set of indicators calculated from inside a separate
system.

I have installed the Web Services Toolkit and followed the quick
walkthrough in:

http://weblogs.asp.net/erobillard/archive/2005/07/22/420289.aspx

And managed to import my WSDL and got the automatically created code.
The WSDL is at:

http://www.marian-aldenhoevel.de/tmp/ICMSService.wsdl

I can now call some of the services, but the one I'm actually after
RunQueries() I can't. I am calling like this:
Public Sub RunQuery()

Dim ICMS As clsws_ICMSServiceservice
Set ICMS = New clsws_ICMSServiceservice

Dim Queries(0)
Set Queries(0) = New struct_TQuery
Queries(0).Name = "QUERY_DEMO"

Dim QueryResult As struct_TQueryResult

QueriesResult = ICMS.wsm_RunQueries(Queries)

Application.ActiveSheet.Range("A2").Value =
UBound(QueryResult.Records) - LBound(QueryResult.Records) + 1

The message is (sorry, it's a german version):
Laufzeitfehler '-2147221504 (80040000)'

SoapMapper:Die Arraydimensionen stimmen nicht mit der
Definition überein.

"Array dimensions do not match"

The SOAP-message being sent is:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAPSDK4:RunQueries xmlns:SOAPSDK4="urn:CMSServiceInterface-ICMSService">
<aQueries xmlns:SOAPSDK5="urn:CMSServiceInterface"
SOAPSDK3:arrayType="SOAPSDK5:TQuery[1]" SOAPSDK3:eek:ffset="[0]"
SOAPSDK2:type="SOAPSDK3:Array">
<SOAPSDK5:TQuery href="#id1"/>
</aQueries>
</SOAPSDK4:RunQueries>
<SOAPSDK6:TQuery xmlns:SOAPSDK6="urn:CMSServiceInterface" id="id1"
SOAPSDK3:root="0" SOAPSDK2:type="SOAPSDK6:TQuery">
<Name>QUERY_DEMO</Name>
<Params/>
</SOAPSDK6:TQuery>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

And the response:

<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:NS2="urn:CMSServiceInterface">
<NS1:RunQueriesResponse xmlns:NS1="urn:CMSServiceInterface-ICMSService">
<return xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="NS2:TQueryResult[1]">
<item href="#1"/>
</return>
</NS1:RunQueriesResponse>
<NS2:TQueryResult id="1" xsi:type="NS2:TQueryResult">
<Query href="#2"/>
<FieldDefs xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="NS2:TQueryResultFieldDef[7]">
<item href="#3"/>
<item href="#4"/>
<item href="#5"/>
<item href="#6"/>
<item href="#7"/>
<item href="#8"/>
<item href="#9"/>
</FieldDefs>
<Records xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[6,7]">
<item>2</item>
<item>Claimant</item>
<item>F</item>
<item>16777215</item>
<item/>
<item>T</item>
<item>2</item>
<item>3</item>
<item>Defendant</item>
<item>F</item>
<item>16777215</item>
<item/>
<item>T</item>
<item>3</item>
<item>4</item>
<item>Applicant</item>
<item>T</item>
<item>16777215</item>
<item/>
<item>F</item>
<item>2</item>
<item>5</item>
<item>Plaintiff</item>
<item>T</item>
<item>16777215</item>
<item/>
<item>F</item>
<item>2</item>
<item>6</item>
<item>Respondent</item>
<item>T</item>
<item>16777215</item>
<item/>
<item>F</item>
<item>3</item>
<item>14896</item>
<item>Judge</item>
<item>F</item>
<item>16777215</item>
<item/>
<item>F</item>
<item>4</item>
</Records>
</NS2:TQueryResult>
<NS2:Query id="2" xsi:type="NS2:TQuery">
<Name xsi:type="xsd:string">QUERY_DEMO</Name>
<Params xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="NS2:TQueryParam[0]"/>
</NS2:Query>
<NS2:TQueryResultFieldDef id="3" xsi:type="NS2:TQueryResultFieldDef">
<FieldIndex xsi:type="xsd:int">1</FieldIndex>
<Name xsi:type="xsd:string">RECID</Name>
</NS2:TQueryResultFieldDef>
<NS2:TQueryResultFieldDef id="4" xsi:type="NS2:TQueryResultFieldDef">
<FieldIndex xsi:type="xsd:int">2</FieldIndex>
<Name xsi:type="xsd:string">DESCRIPTION</Name>
</NS2:TQueryResultFieldDef>
<NS2:TQueryResultFieldDef id="5" xsi:type="NS2:TQueryResultFieldDef">
<FieldIndex xsi:type="xsd:int">3</FieldIndex>
<Name xsi:type="xsd:string">NOTACTIVE</Name>
</NS2:TQueryResultFieldDef>
<NS2:TQueryResultFieldDef id="6" xsi:type="NS2:TQueryResultFieldDef">
<FieldIndex xsi:type="xsd:int">4</FieldIndex>
<Name xsi:type="xsd:string">COLOR</Name>
</NS2:TQueryResultFieldDef>
<NS2:TQueryResultFieldDef id="7" xsi:type="NS2:TQueryResultFieldDef">
<FieldIndex xsi:type="xsd:int">5</FieldIndex>
<Name xsi:type="xsd:string">ICON</Name>
</NS2:TQueryResultFieldDef>
<NS2:TQueryResultFieldDef id="8" xsi:type="NS2:TQueryResultFieldDef">
<FieldIndex xsi:type="xsd:int">6</FieldIndex>
<Name xsi:type="xsd:string">SYSTEM</Name>
</NS2:TQueryResultFieldDef>
<NS2:TQueryResultFieldDef id="9" xsi:type="NS2:TQueryResultFieldDef">
<FieldIndex xsi:type="xsd:int">7</FieldIndex>
<Name xsi:type="xsd:string">BASE_PARTY_TYPE</Name>
</NS2:TQueryResultFieldDef>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Ciao, MM
 

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

Top