Aye - it might be that the types for the KlickBOperator reference; i.e.
the datatype is wrong; does the WSDL give a warning when fed through a
dtd validator about misplaced structures ?
Dw
On Tue, 10 Jul 2001, Christian Weyer wrote:
> Oliver,
> did you try to build a dummy VB project as the SOAP server, generate the WSDL from
> this COM object and compare it with your WSDL?
> This might help out for some further steps.
>
> Regards,
> Christian
>
>
> Oliver Rettig wrote:
>
> > Hallo,
> >
> > I�ve written a soap-server with apache-soap and a want to invoke it via
> > a ms-high-level-soap-client.
> > Invocation of methods String dummy(String string) works fine but
> > invocation of String[] dummy1(String[] stringArray) produces an error:
> > Type conversion failure for element arg0.
> >
> > Please help. I don�t know what to.
> >
> > best regards
> >
> > Oliver
> >
> > Here�s wsdl:
> >
> > <?xml version="1.0" encoding='UTF-8'?>
> >
> > <definitions name='urn:KlickBlick'
> > targetNamespace='urn:KlickBlickOperator'
> > xmlns:tns='urn:xml-klickblick'
> > xmlns:xsd='http://www.w3.org/2001/XMLSchema'
> > xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
> > xmlns='http://schemas.xmlsoap.org/wsdl/'>
> >
> > <types>
> > <xsd:schema targetNamespace='urn:xml-klickblick'
> >
> > xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
> > xmlns:wsdl='http:/schemas.xmlsoap.org/wsdl/soap/'
> > elementFormDefault='qualified'>
> > <xsd:complexType name='ArrayOfstring'>
> > <xsd:complexContent>
> > <xsd:restriction base='SOAP-ENC:Array'>
> > <xsd:attribute ref="SOAP-ENC:arrayType"
> > wsdl:arrayType='xsd:string[]'/>
> > </xsd:restriction>
> > </xsd:complexContent>
> > </xsd:complexType>
> > </xsd:schema>
> > </types>
> >
> > <!-- message declns -->
> > <message name='stringResponse'>
> > <part name='Result' type='xsd:string'/>
> > </message>
> > <message name='stringArrayRequest'>
> > <part name='arg0' type='tns:ArrayOfstring'/>
> > </message>
> > <message name='stringArrayResponse'>
> > <part name='arg0' type='tns:ArrayOfstring'/>
> > </message>
> >
> > <!-- port type declns -->
> > <portType name='KlickBlickPortType'>
> > <operation name='dummy1'>
> > <input message='stringArrayRequest'/>
> > <output message='stringArrayResponse'/>
> > </operation>
> > <operation name='dummy2'>
> > <input message='stringArrayRequest'/>
> > <output message='stringResponse'/>
> > </operation>
> > </portType>
> > <!-- binding declns -->
> > <binding name='KlickBlickSOAPBinding' type='KlickBlickPortType'>
> > <soap:binding style='rpc'
> > transport="http://schemas.xmlsoap.org/soap/http"/>
> > <operation name='dummy1'>
> > <soap:operation soapAction=''/>
> > <input>
> > <soap:body use='encoded'
> > namespace='urn:KlickBlickOperator'
> >
> > encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
> > </input>
> > <output>
> > <soap:body use='encoded'
> > namespace='urn:KlickBlickOperator'
> >
> > encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
> > </output>
> > </operation>
> > <operation name='dummy2'>
> > <soap:operation soapAction=''/>
> > <input>
> > <soap:body use='encoded'
> > namespace='urn:KlickBlickOperator'
> >
> > encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
> > </input>
> > <output>
> > <soap:body use='encoded'
> > namespace='urn:KlickBlickOperator'
> >
> > encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
> > </output>
> > </operation>
> > </binding>
> >
> > <!-- service decln -->
> > <service name='KlickBlickService'>
> > <port name='KlickBlickPortType' binding='KlickBlickSOAPBinding'>
> > <soap:address
> > location='http://server1.klickblick.de:8080/soap/servlet/rpcrouter'/>
> > </port>
> > </service>
> >
> > </definitions>
> >
> > Here�s the deployment-descriptor:
> >
> > <isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
> > id="urn:KlickBlickOperator">
> > <isd:provider type="java"
> > scope="Application"
> > methods="dummy1 dummy2">
> > <isd:java class="KlickBlick.Soap.KlickBlickSoapService"
> > static="false"/>
> > </isd:provider>
> >
> > <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
> >
> > <isd:mappings>
> > <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:tns="urn:xml-klickblick" qname="tns:ArrayOfstring"
> >
> > java2XMLClassName="org.apache.soap.encoding.soapenc.ArraySerializer"
> >
> > xml2JavaClassName="org.apache.soap.encoding.soapenc.ArraySerializer"/>
> > </isd:mappings>
> >
> > </isd:service>
> >
> > ms-client-Code:
> >
> > void CCalcCliRpcCppDlg::Execute_dummyarray()
> > {
> > OLECHAR *pMethodName = L"dummy1";
> >
> > if(Connect())
> > {
> > HRESULT hr;
> > DISPID dispid;
> > DISPPARAMS parms;
> > VARIANT pRef[1];
> > VARIANT pArg[1];
> > VARIANT result;
> > VARIANT vb;
> > EXCEPINFO ExceptInfo;
> > SAFEARRAY * pSA1;
> > SAFEARRAYBOUND sabound[1];
> > LONG index;
> > BSTR data1 = 0;
> > BSTR data2 = 0;
> > VARTYPE vtype = VT_BSTR;
> >
> > hr = m_pSoapClient->GetIDsOfNames(IID_NULL,
> > &pMethodName, 1,
> > LOCALE_SYSTEM_DEFAULT, &dispid);
> > if(FAILED(hr))
> > {
> > DisplayHResult(_T("Cannot get dispatch id of
> > dummy
> > (array) method."),
> > hr);
> > return;
> > }
> >
> > sabound[0].lLbound = 0;
> > sabound[0].cElements = 2;
> >
> > parms.cArgs = 1;
> > parms.cNamedArgs = 0;
> > parms.rgdispidNamedArgs = 0;
> > parms.rgvarg = pRef;
> >
> > ::VariantInit(&vb);
> > ::VariantInit(&pArg[0]);
> > ::VariantInit(&pRef[0]);
> >
> > pSA1 = SafeArrayCreate(vtype,1,sabound);
> >
> > index = 0;
> >
> > data1 = ::SysAllocString(L"ABCD");
> > data2 = ::SysAllocString(L"AA");
> >
> > hr = SafeArrayPutElement(pSA1,&index,data1);
> > index ++;
> > hr = SafeArrayPutElement(pSA1,&index,data2);
> >
> > V_ARRAY(&pArg[0]) = pSA1;
> > V_VT(&pArg[0]) = VT_ARRAY | vtype;
> >
> > V_VT(&pRef[0]) = V_VT(&pArg[0]) | VT_BYREF;
> > V_ARRAYREF(&pRef[0]) = &pArg[0].parray;
> >
> > ::VariantInit(&result);
> >
> > hr = m_pSoapClient->Invoke(dispid, IID_NULL,
> > LOCALE_SYSTEM_DEFAULT,
> > DISPATCH_METHOD, &parms, &result, &ExceptInfo, NULL);
> > if(FAILED(hr))
> > {
> > DisplayFault(_T("Invoke of dummy (array) method
> > failed."));
> > }
> > else
> > {
> > VariantChangeType(&result, &result, 0, VT_BSTR);
> >
> > m_ResultCtl.SetWindowText(CString(result.bstrVal));
> > }
> >
> > VariantClear(&result);
> >
> > if(pSA1 != NULL)
> > hr = SafeArrayDestroy(pSA1);
> > }
> > }
>
> --
> ___________________________________________________
> eYesoft We see your visions.
> ���������������������������������������������������
> Christian Weyer http://www.eyesoft.de
>
> [EMAIL PROTECTED] Bernhard-Krieg-Str. 4
> Tel.: +49-9393-993161 97845 Neustadt/Main
> ___________________________________________________
> bUilding sMart iNternet aRchitectures
> ���������������������������������������������������
>
>