|
Neither one of these worked for me.
|
|
|
|
|
Simply add...
#import <msxml4.dll>
... to stdafx.h to overcome this one. That's what gives you the smart pointers like IXMLDOMDocumentPtr. You'll need to rebuild your solution after this, if Visual Studio doesn't do it for you.
-- modified at 1:36 Wednesday 5th September, 2007
Rob
|
|
|
|
|
hello
you like make friends in China and all over the world.,.so lets start
any one have client server key logger code idea..plz reply me afri.591011@yahoo.com
|
|
|
|
|
hi
any one have client server key logger code idea..plz reply me afri.591011@yahoo.com
|
|
|
|
|
Hi,
I'm try to connect to a web service located on the Sun Application Server 9.0.
The service initialization goes well, but when I try to invoke the metod, it returns an error.
Does anybody know if the SOAP Toolkit 3 is incompatible with the Sun Application Server 9?
Thx
Luca
|
|
|
|
|
I am using Soap Client and my code is as the following.my question is How can I get Error message from varResult
Thanks.
#pragma once
#include "SoapClientBase.h"
class AuthServiceClient : public SoapClientBase
{
public:
AuthServiceClient(void) : SoapClientBase()
{
Init("http://localhost/AuthService/AuthService.asmx?wsdl", "AuthService", "");
}
bool IsAuthorized(LPCTSTR username, LPCTSTR password)
{
_variant_t varParams[2] = { password, username };
_variant_t varResult;
m_hr = Invoke(L"IsAuthorized", varParams, 2, &varResult);
return VARIANT_TRUE == varResult.boolVal;
}
};
|
|
|
|
|
try to debug your program and see what's in the varResult.
|
|
|
|
|
How can I get vecotr of string from varResult when the code is:
_variant_t varParams[1] = {""};
_variant_t varResult;
HRESULT hr = SoapClient.Invoke(L"GetCategories", varParams, 0, &varResult);
Thanks in advance
arsm
|
|
|
|
|
I paste the code into a project, when the application call m_pSoapClient->MSSoapInit2(....) function, which call "raw_MSSoapInit2", alway get the "invalid parameter" error message, and the application crash.
How to solve it?
thanks!
|
|
|
|
|
I have the same problem. When I call the Invoke function with my web service function name, it returns with error and my app crashes.
Do you have any idea?
Best regards,
A. Riazi
|
|
|
|
|
Hello there
Reading on MSDN... It says the following
SOAP Toolkit 3.0
Brief Description
The Microsoft SOAP Toolkit is deprecated by the .NET Framework. SOAP Toolkit support will be retired in April 2005.
SO - how do we go about using / consuming a Web service, in an MFC / C++ application?
Hope someone can help me
Thanks
Alex
|
|
|
|
|
It is now July 2006. Did you ever find a way to use C++ with web service technology?
mike
|
|
|
|
|
Hi Neil,
the code examples are really great. My first app using this Webservice works really good.
But my target application that also has to use a webservice invoke has some problems:
This application has to run "out of the box", that means, that no installation is done before the first launch. It runs directly from a USB-Device or from CD. It seems that the SOAP-Call is the problem, so I copied the SOAP-dll into the application directory and copied it to the usb-stick, but it crashes when running the webservice-call.
Any Idea how to solve this problem? Using C# or .NET doesn't work, because the .NET framework is required and nearly every customer has "only" W2000 or below and NO Framework installed. So my app has to be a single exe or an exe with dlls and no additional installation.
Everything works except the WS-call.
Thanks for helping!
Greets.
|
|
|
|
|
Hi
I am bginer and i need to make clint for webservice <http: www.handigeproducten.nl="" webservice="">
pliz help how to begin or some manual
Thanks.
|
|
|
|
|
Very nice article...
Cheers!
|
|
|
|
|
服务器端的Webservice.asmx如下:
///
/// 创建新用户
[SoapHeader("Credentials")]
[WebMethod(Description = "创建新用户")]
public DataSet CreateNewUser(String userName,
String password,
String nickName,
int sex,
String email,
String face,
String name,
String oicq,
String msn,
String leader)
{
// SecurityHelper.VerifyCredentials(this);
UserData retval = null;
if((new webteach.BusinessFacade.UserSystem()).
CreateUser(userName, password, nickName,
sex, email, face, name, oicq, msn, leader, out retval))
{
return retval;
}
else
{
//if(retval.Tables[0].Rows[0].RowError != String.Empty)
throw new SoapException(string.Empty,SoapException.ClientFaultCode,retval.Tables[0].Rows[0].RowError);
}
}
return (new webteach.BusinessFacade.UserSystem()).GetReplierListOnline(groupID, postID);
}
///
/// 根据用户名,用户密码得到用户基本信息
///
/// <param name="userName" />
/// <param name="password" />
/// <returns>
[SoapHeader("Credentials")]
[WebMethod(Description = "根据用户名,用户密码得到用户基本信息")]
public DataSet GetUserByUserName(String userName, String password)
{
SecurityHelper.VerifyCredentials(this);
return (new webteach.BusinessFacade.UserSystem()).GetUserByUserName(userName, password);
}
}
现在要用VC++6.0在客户端向服务器端Webservice.asmx注册一个新用户以及通过发送用户的username和password取得服务器发来的用户信息(一个DataSet),该如何办?
Zjroland from http://www.outsourcexp.com
|
|
|
|
|
Can communicate with a webservice running on Tomcat?
Tell me more about this.
Thanks in advance.
|
|
|
|
|
I have a webservice written in java and running on tomcat webserver using AXIS.
_bstr_t varWSDL = "http://localhost:8080/MyWSDL?wsdl";
_bstr_t varWSML = "";
_bstr_t bstrService = "MyServiceName";
_bstr_t bstrPort = "8080";
//Following line of code throws exception:
m_hr = m_pSoapClient->MSSoapInit2(varWSDL, varWSML, bstrService, bstrPort, bstrNS);
Thanks in advance!
-Umashankar H.M
|
|
|
|
|
Hey,
for some odd reason, in my program when the Invoke function from SoapClientBase is invoked, it returns saying "Type Mismatch" the arguments I am trying to pass are (int,int,int,string) ...they all seem to be initialized fine and the address of the VARIANT* pvarParams also comes through fine. The server side seems to be fine, the function there has 4 parameters as defined above.....Need some help here.
|
|
|
|
|
Hey uall....was able to fix my own problen.......dont send a the last variable string needed to be sent as a BSTR. If you need to fill a _variant_t array to send the parameters, you need to pass the address of the BSTR defined. In my code the thing goes like:
BSTR bStr;
bStr = SysAllocString(L"Hello World.");
int return_result = aluriaClient.GetScanResults(1,1,1, bStr);
In the receiving function when you call _variant_t to fill it up you need to do this ::
function(int A,int B,int C, BSTR something)
{
_variant_t varParams[4] = {A,B,C,&something};
_variant_t varResult;
.......
........
}
|
|
|
|
|
Thanks for this clean wrapper. You saved me so much time from doing all the busy work. Great job!
|
|
|
|
|
Hi, i have installed MS SOAP Toolkit3.0, the platform is WINDOWSXP+SP2, the code i wirte is listed below:
#include <stdio.h>
#import "msxml4.dll"
using namespace MSXML2;
#import "C:\Program Files\Common Files\MSSoap\Binaries\mssoap30.dll" \
exclude("IStream", "IErrorInfo", "ISequentialStream", "_LARGE_INTEGER", \
"_ULARGE_INTEGER", "tagSTATSTG", "_FILETIME")
using namespace MSSOAPLib30;
void Get()
{
HRESULT hr;
ISoapSerializerPtr Serializer;
ISoapReaderPtr Reader;
ISoapConnectorPtr Connector;
// Connect to the service.
hr = Connector.CreateInstance(__uuidof(HttpConnector30));
Connector->Property["EndPointURL"] = L"http://update.waytech.com.cn/Webservices/WTAU/WTAU.asmx?WSDL";
hr = Connector->Connect();
// Begin the message.
Connector->Property["SoapAction"] = L"http://www.waytech.com.cn/webservices/WTAU/WTAU0";
hr = Connector->BeginMessage();
// Create the SoapSerializer object.
hr = Serializer.CreateInstance(__uuidof(SoapSerializer30));
// Connect the serializer object to the input stream of the connector object.
hr = Serializer->Init(_variant_t((IUnknown*)Connector->InputStream));
// Build the SOAP Message.
hr = Serializer->StartEnvelope("", "", "");
// Serializer->SoapNamespace(L"xsi", L"http://www.w3.org/2001/XMLSchema-instance");
// Serializer->SoapNamespace(L"xsd",L"http://www.w3.org/2001/XMLSchema");
hr = Serializer->StartBody(L"");
Serializer->StartElement(L"request", "", "", "");
hr = Serializer->StartElement(L"WTAU1", "", "","");
// Serializer->SoapNamespace("", "http://www.waytech.com.cn/webservices/WTAU");
hr = Serializer->StartElement(L"Module", "", "", "");
hr = Serializer->StartElement(L"ProdType","","","");
hr = Serializer->WriteString(L"003");
hr = Serializer->EndElement();
hr = Serializer->StartElement(L"ProdSubType","","","");
hr = Serializer->WriteString(L"003.0001");
hr = Serializer->EndElement();
hr = Serializer->StartElement(L"Version","","","");
hr = Serializer->WriteString(L"1.0.0.0");
Serializer->EndElement();
hr = Serializer->StartElement(L"TimeStamp","","","");
hr = Serializer->WriteString(L"2004 12 31 00:00:00");
hr = Serializer->EndElement();
hr = Serializer->StartElement(L"Name","","","");
hr = Serializer->WriteString(L"RV.EXE");
hr = Serializer->EndElement();
hr = Serializer->StartElement(L"FileName","","","");
hr = Serializer->WriteString(L"RV.EXE");
hr = Serializer->EndElement();
hr = Serializer->EndElement();
hr = Serializer->EndElement();
Serializer->EndElement();
hr = Serializer->EndBody();
hr = Serializer->EndEnvelope();
// Send the message to the XML Web service.
hr = Connector->EndMessage();
// Read the response.
hr = Reader.CreateInstance(__uuidof(SoapReader30));
// Connect the reader to the output stream of the connector object.
Reader->Load(_variant_t((IUnknown*)Connector->OutputStream), "");
// Display the result.
printf("Answer: %s\n", (const char*)Reader->Dom->xml);
}
int main()
{
CoInitialize(NULL);
Get();
CoUninitialize();
return 0;
}
I use a protocol sniffer to capture the request message it generate and found it is like these:
<?xml **UnReg**1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="" xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="">
<request SOAP-ENV:encodingStyle="">
<WTAU1 SOAP-ENV:encodingStyle="">
<Module SOAP-ENV:encodingStyle="">
<ProdType SOAP-ENV:encodingStyle="">003</ProdType>
<ProdSubType SOAP-ENV:e**UnReg**yle="">003.0001</ProdSubType>
<Version SOAP-ENV:encodingStyle="">1.0.0.0</Version>
<TimeStamp SOAP-ENV:encodingStyle="">2004 12 31 00:00:00</TimeStamp>
<Name SOAP-ENV:encodingStyle="">RV.EXE</Name>
<FileName SOAP-ENV:encodingStyle="">RV.EXE</FileName>
</Module>
</WTAU1>
</request>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
you can see that the first line is wrong, the node "ProdSubType" is wrong too, why will this happen, what should i do to sovle this problem, i hope you can help me.
learn to be still.
|
|
|
|
|
What sniffer did you use and how did you set it up?
Was its proxyTrace or tcpTrace. Let me know how you set up the desitnation, etc..
It seems to me that one of your parameters are wrong.
Jack Steel
|
|
|
|
|
Anyone know the solutions and some demo code ?
|
|
|
|
|
hi there!
hope it's not late. you have to use base64string for sending binary data via xml.
HTH
Scarlaxx
|
|
|
|
|