It happend with me before. In service definition i used different port, while the server was listening to different port. This seems your problem too.
gsoap Server does not accept Client request
-
31-05-2022 - |
Pregunta
I have created a web service in gsoap, but server does not accept requests. There is no error, but i dont understand why it does not accept requests from client. I am pasting my client and server code here.
Clientcode
EnrollmentServiceSOAPProxy proxy;
_ns1__performRequest *req = new _ns1__performRequest();
_ns1__performRequestResponse *res = new _ns1__performRequestResponse();
if(proxy.performRequest(req, res) == SOAP_OK)
print "OK" // pseudo code for print.
else
print "Not Ok"
Server Code:
int __ns1__performRequest(soap *, _ns1__performRequest *ns1__performRequest, _ns1__performRequestResponse *ns1__performRequestResponse)
{
ns1__performRequestResponse->jobID = "1011";
return SOAP_OK;
}
The server is listening on localhost. but the request does not reach the server.
This is the WSDL file:https://www.dropbox.com/s/n2sdv51qmttp7vb/EnrollmentService.wsdl
I debugged the code, but it did not help me.
Solución
Otros consejos
The service endpoint may not be set to your server, but to whatever the WSDL defines as the server address. You should use EnrollmentServiceSOAPProxy proxy("URL");
with the URL that is your server's endpoint address (http://hostaddr
or http://localhost:8000
when you run your server local on port 8000).