Click here to Skip to main content
16,015,097 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralToolbar in ActiveX Control Pin
Anand for every one21-Feb-05 18:35
Anand for every one21-Feb-05 18:35 
GeneralRe: Toolbar in ActiveX Control Pin
jahfer21-Feb-05 19:29
jahfer21-Feb-05 19:29 
GeneralRe: Toolbar in ActiveX Control Pin
Sheng Jiang 蒋晟22-Feb-05 13:31
Sheng Jiang 蒋晟22-Feb-05 13:31 
GeneralRe: Toolbar in ActiveX Control Pin
Anand for every one7-Mar-05 19:07
Anand for every one7-Mar-05 19:07 
GeneralRe: Toolbar in ActiveX Control Pin
Sheng Jiang 蒋晟10-Mar-05 13:34
Sheng Jiang 蒋晟10-Mar-05 13:34 
Questionhow to create an icon for dll file? Pin
includeh1021-Feb-05 17:46
includeh1021-Feb-05 17:46 
AnswerRe: how to create an icon for dll file? Pin
Blake Miller22-Feb-05 4:56
Blake Miller22-Feb-05 4:56 
GeneralInkvoke web service from C++ through SoapClient Pin
Member 80845921-Feb-05 15:23
Member 80845921-Feb-05 15:23 
I have a problem.
1. I wrote a simple .NET(C#) service that expose: void test(string fsrpath)
2. Wrote a win32 dll that invoke that web method. Use SoapClient (MSSOAP3.0) to invoke that web method but it doesn't work. I always got "Client:Incorrect number of parameters supplied for SOAP request HRESULT=0x80070057: The parameter is incorrect." I give the code as (**below**)
3. Wrote a win32 dll that invoke that web method. Use Http Request (MSSOAP3.0) to invoke that web method but it doesn't work. The server can't see the parammeter fsrpath. althought Client can call to that web method. I give the code as (***below***)
Does any experts have another Idea to call to that web method.
I really would like to have the example code to handle complex types such as structure in C++

Please please help me..... help me

Thanks a lot all experts.
(**below**)
#import "C:\Program Files\Common Files\MSSoap\Binaries\mssoap30.dll" \
exclude("IStream", "IErrorInfo", "ISequentialStream", "_LARGE_INTEGER", \
"_ULARGE_INTEGER", "tagSTATSTG", "_FILETIME")
using namespace MSSOAPLib30;

#import "c:\winnt\system32\msxml4.dll" named_guids
using namespace MSXML2;

void test()
{
CoInitialize(NULL);
HRESULT hr;
ISoapClientPtr m_pSoapClient;

hr = m_pSoapClient.CreateInstance(__uuidof(SoapClient30));

try
{
hr = m_pSoapClient->MSSoapInit2(
_variant_t(_T("http://localhost:8080/ICM/CMVersioning/CMVersioningService.asmx?WSDL")),
_variant_t(_T("")),
_T("CMVersioningService"),
_T("CMVersioningServiceSoap"),
_T("http://www.starviewtechnology.com/cm/services/CMVersioningService"));
}
catch (_com_error ce)
{
CString szLogMsg;
szLogMsg.Format("%s", (char *)ce.Description());
}

DISPID dispid;
DISPPARAMS dispparams;
VARIANTARG params[1];
VARIANT result;
EXCEPINFO ExceptInfo;

OLECHAR *pMethodName = L"test";
// Get dispatch ID corrisponding to method name.
hr = m_pSoapClient->GetIDsOfNames(IID_NULL,
&pMethodName,
1,
LOCALE_SYSTEM_DEFAULT,
&dispid);
if(FAILED(hr))
{
return NULL;
}

VariantInit(¶ms[0]);
params[0].vt = VT_BSTR;
params[0].bstrVal = L"ZZZZZZZZZZZ";

// Initialize DISPPARAMS structure.
dispparams.cArgs = 1;
dispparams.cNamedArgs = 0;
dispparams.rgdispidNamedArgs = NULL;
dispparams.rgvarg = params;

// Prepare result variant.
VariantInit(&result);

// Invoke the specified method.
hr = m_pSoapClient->Invoke(dispid,
IID_NULL,
LOCALE_SYSTEM_DEFAULT,
DISPATCH_METHOD,
&dispparams,
&result,
&ExceptInfo,
NULL);
if(FAILED(hr))
{
return NULL; // always got error
}
}

(***below***)
#import "C:\Program Files\Common Files\MSSoap\Binaries\mssoap30.dll" \
exclude("IStream", "IErrorInfo", "ISequentialStream", "_LARGE_INTEGER", \
"_ULARGE_INTEGER", "tagSTATSTG", "_FILETIME")
using namespace MSSOAPLib30;
void test()
{
CoInitialize(NULL);

ISoapSerializerPtr Serializer = NULL;
ISoapReaderPtr Reader = NULL;
ISoapConnectorPtr Connector = NULL;

try
{
// Connect to the service.
HRESULT hr = Connector.CreateInstance(__uuidof(HttpConnector30));

if (FAILED(hr))
{
goto exit_func;
}
else
{
// Set end point information to connector
Connector->Property["EndPointURL"] = _T("http://localhost:8080/ICM/CMVersioning/CMVersioningService.asmx");

Connector->Property["SoapAction"] = _T("http://tempuri.org/CheckIn");
Connector->Connect();

// Begin the message.
Connector->BeginMessage();

// Create the SoapSerializer object.
hr = Serializer.CreateInstance(__uuidof(SoapSerializer30));

if (FAILED(hr))
{
goto exit_func;
}
else
{
// Connect the serializer object to the input stream of the connector object.
Serializer->Init(_variant_t((IUnknown*)Connector->InputStream));

Serializer->StartEnvelope("soap","NONE", "utf-8");


Serializer->StartBody(_T("NONE"));

Serializer->StartElement(_T("CheckIn"),
_T(""),
_T("NONE"),
_T(""));
_bstr_t bstr(
_T("<test xmlns="\"http://tempuri.org/\""> ")
_T("<fsrpath>string ")
_T(""));
Serializer->WriteXml(bstr);

Serializer->EndElement();
Serializer->EndBody();

Serializer->EndEnvelope();

try
{
Connector->EndMessage();
}
catch (_com_error ce)
{
goto exit_func;
}
catch (...)
{
goto exit_func;
}

// Read the response.
hr = Reader.CreateInstance(__uuidof(SoapReader30));

if (FAILED(hr))
{
goto exit_func;
}
else
{
// Connect the reader to the output stream of the connector object.
if (Connector->OutputStream!=NULL)
{
try
{
// Maybe there is no respond
// so that this line will have exception
BOOL blRes = Reader->Load(_variant_t((IUnknown*)Connector->OutputStream), "CheckIn");

IXMLDOMDocument *spResponseXMLDOM = NULL;
spResponseXMLDOM = Reader->Dom;


BSTR bstr;
spResponseXMLDOM->get_xml(&bstr);
AfxMessageBox(CString(bstr));
}
catch (...)
{
}
}
}
}
}
}
catch (...)
{

}

}
Generalreading and outputting data from a binary file... Pin
Moochie521-Feb-05 14:36
Moochie521-Feb-05 14:36 
GeneralRe: reading and outputting data from a binary file... Pin
S. Senthil Kumar21-Feb-05 15:25
S. Senthil Kumar21-Feb-05 15:25 
GeneralRe: reading and outputting data from a binary file... Pin
Moochie521-Feb-05 17:47
Moochie521-Feb-05 17:47 
GeneralRe: reading and outputting data from a binary file... Pin
S. Senthil Kumar21-Feb-05 17:58
S. Senthil Kumar21-Feb-05 17:58 
GeneralRe: reading and outputting data from a binary file... Pin
Cedric Moonen21-Feb-05 20:13
Cedric Moonen21-Feb-05 20:13 
Generalprocesses Pin
mpapeo21-Feb-05 14:06
mpapeo21-Feb-05 14:06 
GeneralRe: processes Pin
Aamir Butt22-Feb-05 0:17
Aamir Butt22-Feb-05 0:17 
GeneralRe: processes Pin
mpapeo28-Feb-05 16:31
mpapeo28-Feb-05 16:31 
GeneralDialog Bars in Dialog Based applications Pin
Will115721-Feb-05 12:49
sussWill115721-Feb-05 12:49 
GeneralRe: Dialog Bars in Dialog Based applications Pin
Will115721-Feb-05 13:13
sussWill115721-Feb-05 13:13 
GeneralRe: Dialog Bars in Dialog Based applications Pin
JohnCz21-Feb-05 13:50
JohnCz21-Feb-05 13:50 
GeneralRe: Dialog Bars in Dialog Based applications Pin
Mohammad Tarik22-Feb-05 1:23
Mohammad Tarik22-Feb-05 1:23 
GeneralProblem With Dll Injection Pin
gamitech21-Feb-05 10:37
gamitech21-Feb-05 10:37 
Generalstart when cd is in Pin
jonavon blakly21-Feb-05 7:40
jonavon blakly21-Feb-05 7:40 
GeneralRe: start when cd is in Pin
Ravi Bhavnani21-Feb-05 7:44
professionalRavi Bhavnani21-Feb-05 7:44 
GeneralSafe Exit Pin
DanYELL21-Feb-05 6:36
DanYELL21-Feb-05 6:36 
GeneralRe: Safe Exit Pin
Michael Dunn21-Feb-05 6:53
sitebuilderMichael Dunn21-Feb-05 6:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.