 |
|
 |
Thanks a lot Dr.Luiji for your response.
Like you said, I bridged the line at 3448 and tried to assign soap->peer.sin_addr myself as below.
But I get a new error "SOAP 1.1 fault: SOAP-ENV:CLient [no subcode]" A socket operation was attempted to an unreachable host" Detail: connect failed in tcp_connect()". I am including my modified code.
3448 : { 3449 : if (0)
3450 : { soap_set_sender_error(soap, tcp_error(soap), "get host by name failed in tcp_connect()", SOAP_TCP_ERROR);
3451 : soap->fclosesocket(soap, (SOAP_SOCKET)fd);
3452 : return SOAP_INVALID_SOCKET;
3453 : }
3454 : 3455 : soap->peer.sin_addr.S_un.S_un_b.s_b1= 209;
3456 : soap->peer.sin_addr.S_un.S_un_b.s_b2=162;
3457 : soap->peer.sin_addr.S_un.S_un_b.s_b3=186;
3458 : soap->peer.sin_addr.S_un.S_un_b.s_b4=60;
3459 :
3460 : soap->peer.sin_port = htons((short)port);
3461 : }
the new error occurs at
if (connect((SOAP_SOCKET)fd, (struct sockaddr*)&soap->peer, sizeof(soap->peer)))
can you help me with this.
thanks
|
|
|
|
 |
|
 |
Yes, you have miss the other values of struct in_addr, S_un_w and S_addr.
The S_un_w is the address of the host formatted as two u_shorts.
The S_addr is the address of the host formatted as u_long.
Add the code hereunder
soap->peer.sin_addr.S_un.S_addr = 1018864337;
soap->peer.sin_addr.S_un.S_un_w.s_w1 = 41681;
soap->peer.sin_addr.S_un.S_un_w.s_w2 = 15546;
Keep me informed.
Have a nice day!
|
|
|
|
 |
|
 |
Dear Dr.Luiji
Now,I am trying to implement the webservice(which is previous implemented by .net proxy class) by gosap in vc6.0(with c++ proxy class).
I try the solution you list to gernerate the client,gernerate the c++ proxy class according with wsdl file in the internet.compile is ok,but the return response is error code "28"(SOAP_TCP_ERROR)?can you give some clue?
The client need to access a remote sever link which is based the https ,and the sever seems only need an user name and password verification,but no key file need to verfication how shall i implement it?Can you help me on that?
Thanks&Regards
Jenny
|
|
|
|
 |
|
 |
Hi Jenny,
The SOAP_TCP_ERROR is a connection error.
The problem is your link HTTPS. Normally with HTTP the WS use use default encryption/decryption. To use the HTTPS you must enable the SSL.
I suggest to you to use OpenSSL, important use the installer not the source code, it will avoid you to set a lot of environment variables. You can find the installer or the source code here[^].
In principle you need to set up your VS6 with the right lib and add the #define WITH_OPENSSL to your code.
Some time can be enough, but if not the steps can be a lot more complicated...
I'll sugget to you to read this chapters on the User Guide:
- 18.19[^]
- 18.20[^]
- 18.21[^]
- 18.24[^]
Inside the User Guide You can find a lot of other useful info about HTTPS and SSL.
Please let me know,
have a nice day.
|
|
|
|
 |
|
 |
Dear Dr.Luiji,
I Can not find the installer for OpenSSL from the link you direct,only can find the source,and i have a little knowledge for it,can you help me find the installer?
And one question:
for window ssl ,need to set the full path to libssl.lib and libcrypto.lib under the MSVC++ "Projects" menu, then choose "Link": Öbject/Modules". The path to libssl32.dll and libeay32.dll need to be specified in the PATH environment variable when running gSOAP applications. here comes my question,shall the application depend on the openSSL?For the users install my client application but not install the OpenSSL in their pc,can the application work normally.I want to know if the application if depend on it.
Thanks&Best Regards,
Jenny
|
|
|
|
 |
|
 |
Jenny_air wrote: I Can not find the installer for OpenSSL from the link you direct,only can find the source,and i have a little knowledge for it,can you help me find the installer?
Yes, the link is this Binary Distributions[^]. In this page you must select 'OpenSSL for Windows'.
Jenny_air wrote: shall the application depend on the openSSL?
Yes your app will depends on theese dlls, but you don't need to install openSSL on the client, only you need is distribute the two dlls.
Note that the installer will automatically add to your path all the openSSL dirs.
Have a good day.
|
|
|
|
 |
|
 |
Hi,
We need a C++ client application to consume WCF server with NetTCPBinding, and Callback events supported. I have generated the proxy using gSOAP 2.7.10. But my proxy does not communicate with server. When I use BasicHttp binding, it seems to work. Not sure of events.
Can anyone suggest me, if gSOAP works with TCP binding, and callback events.
Is it worth trying. If it does not work any other alternative?
|
|
|
|
 |
|
 |
I'm sorry I've never try the described configuration you write.
I suggest you two possibilities:
-Try to search inside gSOAP 2.7.11 User Guide[^].
-Ask directly to Robert A. van Engelen, you can find the email inside the User Guide at the top, or try 'engelen at cs dot fsu dot edu'.
Cheers.
|
|
|
|
 |
|
 |
I am not getting responce from Robert A. van Engelen. Also I am not able to find any useful information in user guide.
Do you have any other source of information. Do you have idea on how a WCF server can send an event back to client. This is what i am trying to achive using tcp channel.
|
|
|
|
 |
|
 |
I'm really sorry but I've never used WCF and all I read is for C# not C++.
BicycleTheif wrote: Do you have any other source of information.
- Here[^] you can find how event work
- Here[^] on CP you have a lot of WCF working sample with code.
- On MSDN[^] you have all info about WCF.
BicycleTheif wrote: Do you have idea on how a WCF server can send an event back to client. This is what i am trying to achive using tcp channel.
I'm not a WCF expert but substantially you must add an event service to your server, to see the notification you must subscribe it on your client(s).
Hope You find a way,
Cheers
|
|
|
|
 |
|
 |
Hi,
We need a C++ client application to consume WCF server with NetTCPBinding, and Callback events supported. I have generated the proxy using gSOAP 2.7.10. But my proxy does not communicate with server. When I use BasicHttp binding, it seems to work.
Can anyone suggest me, if gSOAP works with TCP binding, and callback events.
|
|
|
|
 |
|
 |
I generated the stubs and proxy classes through soapcpp2 from multiple wsdls all at once. So all the namespace bindings are in a single nsmap file. Now the problem is all the namespace bindings are being send with all the method calls I make. The http post packet is unusually large and ugly. Is there anyway i can programatically override the namespace binding ?
|
|
|
|
 |
|
 |
First, I'll be honest. I've never used multiple WSDL, But I remeber here[^] in the documentation a way to avoid some problem like this. I hope you find answers there.
Kind regards.
Dr.Luiji
Trust and you'll be trusted.
Try iPhone UI [ ^] a new fresh face for your Windows Mobile, here on Code Project.
|
|
|
|
 |
|
 |
Hi, Thank for the article. I need some project in Visual C++ that helps to ignore certificate errors using SOAP in Visual C++ 6. The same task can be done in DotNet using the RemoteCertificateValidationCallback function as given on the following site:
http://stackoverflow.com/questions/178578?sort=newest
But I need to do this in Visual C++ 6. Secondly if it cannot be done, how it is possible to use WinInet with SOAP to achieve this task
Thanks
|
|
|
|
 |
|
 |
Hi Wahaj,
This is a Secure gSOAP question, I'll be honest, I've used the SSL but I can't remember it. But I looked around briefly at the gSOAP User Guide and i've found two chapters that can be useful to you, 18.19 Secure SOAP Web Services with HTTPS/SSL[^], 18.22 SSL Certificates[^].
I am not sure either, however, I think you must install the OpenSSL. The documentation can be found here[^], and this is the OpenSSL Frequently Asked Questions[^].
I hope my suggestion helps you to solve your problem.
Best regards.
Dr.Luiji
Trust and you'll be trusted.
|
|
|
|
 |
|
 |
Hi Dr. Luiji
We are using SOAP3.0 toolkit for achieving our purpose. Kindly let us know any solution in that context. Your solution is concerning gSOAP
Thanks and Regards
Wahaj Khan
|
|
|
|
 |
|
 |
Hi Wahaj
I'm using WinInet for the SSL and it works fine for me.
Follow these simple steps:
1. Reference the wininet.lib library in your project
2. Add two files to your project gsoapWinInet.h and gsoapWinInet.cpp (you can download them from net, and if don't tell me to send you)
3. After soap_init(), register the wininet plugin and get access to the WinInet session, like given:
soap_init2(pSoap->soap, SOAP_IO_DEFAULT|SOAP_IO_KEEPALIVE, SOAP_IO_DEFAULT|SOAP_IO_KEEPALIVE|SOAP_IO_FLUSH);
soap_register_plugin(pSoap->soap, wininet_plugin);
//Get access to the WinInet session that is going to be used for the SOAP call
HINTERNET session = *(HINTERNET*)soap_lookup_plugin(pSoap->soap, "wininet-2.0");
HINTERNET request = InternetOpenUrl(session, _T("http://localhost:8080/MyService"), NULL, 0, 0, NULL);
if (request == NULL)
{
// Opening session failed!
return;
}
else
// Session opened. Now you can go on with instantiate and
// calling method from the service
I hope this will help you.
Regards,
Renata
|
|
|
|
 |
|
 |
Hi Renata
We are using SOAP3.0 toolkit for achieving our purpose. Kindly let us know any solution in that context. Your solution is concerning gSOAP
Thanks and Regards
Wahaj Khan
|
|
|
|
 |
|
 |
Hi!
I develop a gSoap client that uses WCF service with callback contract.
To handle the messages that the WCF service sends back to me, I include the soapServer.cpp file in my project, but I'm getting errors for unresolved external symbols:
Err1 soapServer.obj : error LNK2019: unresolved external symbol "int __cdecl __ns1__Connect struct soap *,class _ns1__Connect *)" referenced in function "int __cdecl soap_serve___ns1__Connect(struct soap *)"
Err2 soapServer.obj : error LNK2019: unresolved external symbol "int __cdecl __ns1__SayToServer(struct soap *,class _ns1__SayToServer *)" referenced in function "int __cdecl soap_serve___ns1__SayToServer(struct soap *)"
Err3 soapServer.obj : error LNK2019: unresolved external symbol "int __cdecl __ns1__Disconnect(struct soap *,class _ns1__Disconnect *)" referenced in function "int __cdecl soap_serve___ns1__Disconnect(struct soap *)"
My questions are:
1. Does gSoap support WCF service under 3.5 framework?
2. Does it support netTcpBinding for the service or it must be any kind of HttpBining?
3. If the above is supported, should I use soapServer.cpp or something else ( ) ...?
Any help will be more than appreciated.
Regards,
Renata
|
|
|
|
 |
|
 |
Hi Renata,
First of all try to see this[^] and this[^] posts hereunder, about LNK2019 error.
Let me know if it works.
Regards.
Dr.Luiji
Trust and you'll be trusted.
|
|
|
|
 |
|
 |
I saw that posts, but it doesn't help. I've included the file that contains the definitions in the soapServer.cpp, but nothing... Also, I don't use that APIs.
I've just forgot to mention that i am not using VC++ 6, but I'm using VC++ 2005, so maybe that's the problem?!
And can you please tell me, is this the rigth approach for service with callbacks that sends back messages? Cause if this is not the rigth solution, then I don't need nothing of this, but I need a new app design
Regards,
Renata
|
|
|
|
 |
|
 |
Hi, when I use gsoap, I get a link error:
error 1 error LNK2001: can't resolve external symbol: _namespaces stdsoap2.obj 3
How can I solve this problem, thank you!
|
|
|
|
 |
|
 |
Hi CharlieLei,
this is a simple Visual Studio error. take a look here[^] on MSDN.
Kind regards.
Dr.Luiji
Trust and you'll be trusted.
|
|
|
|
 |
|
 |
Hi all ;
When I call C:\soap\gsoap\bin\win32>wsdl2h -o Header.h http://project:9999/Header/services?wsdl, I get this warning :
______________________
Warning: no SOAP RPC operation namespace, operations will be ignored
Warning: no SOAP RPC operation namespace, operations will be ignored
To complete the process, compile with:
soapcpp2 RRS.h
______________________
What does it mean ?
Also, the file generated, soapClient.cpp, doas not have source code to call my WebService. It contains this :
______________________
#include "soapH.h"
SOAP_SOURCE_STAMP("@(#) soapClient.cpp ver 2.7.12 2008-10-27 15:40:08 GMT")
/* End of soapClient.cpp */
______________________
Is there any problem on generation?
I thank you
|
|
|
|
 |
|
 |
Hi CSharpJSharp,
I'm a bit confused... Help me better to understand your problem
-First of all you have read the article?
Probaby you must take care to the Section about WSDL Importer and gSOAP Compiler.
-Why you don't want to compile it whit soapcpp2 RRS.h?
It's suggest to you by the importer, try it. Probably after compiled it, you are ready to go ahead. If it dont go try to add the path as writed in the article Eg:
soapcpp2 -ID:\gsoap-win32-2.7\Import RRS.h.
Any way i try for you let me no if i wrong.
CSharpJSharp wrote: Warning: no SOAP RPC operation namespace, operations will be ignored
Warning: no SOAP RPC operation namespace, operations will be ignored
Theese warnings exclude the possibility to use the RPC in your solution. (You need it to do ahead ?)
CSharpJSharp wrote: To complete the process, compile with:
soapcpp2 RRS.h
______________________
What does it mean ?
it means that you must execute this command
CSharpJSharp wrote: Also, the file generated, soapClient.cpp, doas not have source code to call my WebService. It contains this :
______________________
#include "soapH.h"
SOAP_SOURCE_STAMP("@(#) soapClient.cpp ver 2.7.12 2008-10-27 15:40:08 GMT")
/* End of soapClient.cpp */
______________________
this file can be empty becouse you havn't completed all the step.
thanks.
Dr.Luiji
Trust and you'll be trusted.
|
|
|
|
 |