Use Visual Studio. NET to call WebService, and the program example (unmanaged) is MFC. As for how to add web references, we will not go into details here. The following is the call sample code:
# Include "WebService. H "// Add a WebService proxy class reference </P> <p> void cmfcservicedlg: onbnclickedok () <br/>{< br/> coinitialize (null ); // because the generated code is based on ATL, You need to initialize com </P> <p> // proxy object <br/> authenticationservice: cauthenticationservice * CAS = new authenticationservice:: cauthenticationservice (); </P> <p> // you can call seturl to dynamically set the Web service address <br/> // cas-> seturl ("http: // localhost: 8080/authenticationservice? WSDL "); </P> <p> hresult hR = s_ OK; </P> <p> // ccombstr belongs to the smart type, you can manage the memory allocation by yourself <br/> ccombstr ret; <br/> ccombstr in1 = "1"; <br/> ccombstr in2 = "1 "; <br/> ccombstr in3 = "1"; <br/> ccombstr in4 = "1"; <br/> ccombstr in5 = "1 "; </P> <p> hR = cas-> authenticate (in1, in2, In3, in4, in5, & RET); // note, the returned value is in the pointer format </P> <p> If (failed (HR) <br/>{< br/> MessageBox ("Call failed! "); <Br/>}< br/> else <br/>{< br/> MessageBox (" Call successful! "); <Br/>}< br/> Delete CAS; <br/> couninitialize (); </P> <p>}