10-23-2008 09:05 AM
I'm trying to make a call to a web method with
Labwindows/CVI 8.1 and the SOAP Toolkit 3.0 instrument library that returns a
complex data type. I have tried to use ISoapTypeMapper interface to serialize
and deserialize complex data type. But I'm always receiving the error message
"Interface not supported" whenever I make the mapper call.
If anybody has a solution for this, please let me know as this has become a
show stopper for me. An good code example of how to properly handle complex data in
Labwindows/CVI 8.1 (SOAP 3.0 fp) would be appreciated. The weather web service
is just being using for development/debugging of web service client development
in Labwindows in preparation for future real world development. See attachemnt for WSDL XML and response.
This is the code that I’m using, the error occurs at the call to MSSOAPLib30_ISoapTypeMapperInit
CA_InitActiveXThreadStyleForCurrentThread (0, COINIT_APARTMENTTHREADED);
/* Create a SOAP client object */
__caErrChk (MSSOAPLib30_NewISoapClient (NULL, 1, LOCALE_NEUTRAL, 0, &hClient));
/* Initialize the SOAP client object with the web service */
__caErrChk (MSSOAPLib30_ISoapClientMSSoapInit (hClient, NULL,
"http://ws.cdyne.com/WeatherWS/Weather.asmx?wsdl", "", "", ""));
//-----Interface Not Supported is here-------// // If I take this call out the code executes, but the data is complex soI get what appears as garbage //
__caErrChk (MSSOAPLib30_ISoapTypeMapperInit
(hClient, &errorInfo,
Par_Factory,
Par_Schema,
Par_WSML_Node,
-1));
/* Find the DISPID for the web-service function name */
__caErrChk (CA_GetInterfaceFromObjHandle (hClient, &IID_IDispatch, 1, &pDisp, NULL));
__caErrChk (pDisp->lpVtbl->GetIDsOfNames (pDisp, &IID_NULL, &functionName, 1, 0, &functionId));
pDisp->lpVtbl->Release (pDisp);
pDisp = NULL;
while (1) {
puts("Enter your ZIP: ");
gets(ZIP);
if (ZIP[0] == '\0')
break;
/* Call the web-service function */
__caErrChk (CA_MethodInvokeEx (hClient, &errorInfo, &IID_IDispatch, functionId,
CAVT_VARIANT, &result, sizeof (paramTypes) / sizeof (paramTypes[0]),
paramTypes, ZIP, ""));
printf ("Weather: %s\n", result);
}
Solved! Go to Solution.
10-24-2008 11:24 AM
10-24-2008 01:27 PM
Hello Rich,
Just from briefly looking at the parameters you are using "-1" for "MSSOAPLib30Type_enXSDType Par_xsd_Type" when all the options I see when I scroll through the control are types that start with "enXS".
Maybe this is the issue?
10-29-2008 12:21 PM
Success I built a .NET client assembly for the service generated a DLL and used the .NET Controller Wrapper as suggested and was able to successfully access the wed servce features.
Thanks...
02-25-2016 09:24 AM
Hi
How to build a .net client assembly?labwindows or labview or visual studio?
thanks a lot
WD
02-26-2016 09:00 AM
Hi WD,
I found a community example that steps through using .NET Assemblies in LabVIEW: https://decibel.ni.com/content/docs/DOC-5921
In the future I recommend creating a new forum post as this one is 8 years old and will not get much attention from the community.
02-26-2016 09:49 PM
Thanks a lot, JD.
WD