LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Web Service (WSDL) Complex data using Labwindows/CVI 8.1 and the SOAP Toolkit 3.0

Solved!
Go to solution

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);

            }

0 Kudos
Message 1 of 7
(5,777 Views)
Instead of using the Soap toolkit, a simpler approach would be to build a .NET client for the web service and call this .NET assembly from CVI using the CVI .NET Controller created wrappers. See samples\dotnet\webservice for an example.
0 Kudos
Message 2 of 7
(5,754 Views)

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?

With warm regards,

David D.
0 Kudos
Message 3 of 7
(5,742 Views)
Solution
Accepted by rich hilt

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...

0 Kudos
Message 4 of 7
(5,711 Views)

Hi 

How to build a .net client assembly?labwindows or labview or visual studio?

 

thanks a lot

WD

0 Kudos
Message 5 of 7
(4,274 Views)

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. 

JD B.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 7
(4,258 Views)

Thanks a lot, JD.

 

WD

0 Kudos
Message 7 of 7
(4,246 Views)