 |
|
 |
Hi-
The project compiles successfully. When I run and try to get conversion rate I get the error :
"SOAP 1.1 fault: SOAP-ENV:Client [no subcode]"No Data Detail: get host by name failed in tcp_connect()"
The error occurs at MyCurrencyConvertor.cpp line 56 iRet = m_pCurrencyConvertor->__ns1__ConversionRate(pConversionRate,pConversionRateResponse);
returned value is equla to SOAP_TCP_ERROR
Any hint on this?
Thanks a lot,
Waleed
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi Waleed,
You can't retrieves host information corresponding to a host name from a host database, than you can try to use the ip directly.
More specific the gethostbyname not work. It was called into soap->fresolve at stdsoap2.cpp(3449) and it's inside the tcp_connect function. Debug this place to find your error. Try to see the result about nslookup (nslookup www.webserviceX.NET --> must be 209.162.186.60). You cannot resolve this address name with gethostbyname than insert directly the IP addres inside the soap->peer.sin_addr and avoid to call the gethostbyname.
For a better way check the return code about gethostbyname and follow this gethostbyname Function[^].
keep me informed.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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 ?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.LuijiTrust and you'll be trusted.Try iPhone UI [ ^] a new fresh face for your Windows Mobile, here on Code Project.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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);
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) { return; } else
I hope this will help you.
Regards, Renata
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |