gsoap 写的WebServer服务端不能在IE上正确显示wsdl信息(帮帮忙,小弟我只有那么点分哦)
gsoap 写的WebServer服务端不能在IE上正确显示wsdl信息(各位大哥帮帮忙,我只有那么点分哦)
语言:C/C++, gsoap_linux_2.7.9j(最新)
功能:客户端通过调用服务端的接口,能够把一段比特流传送到服务端
问题:服务端写好后,通过我服务器ip在IE上不能正确得到wsdl信息;
在IE上键入(程序运行的服务器实际ip) http://192.168.18.180:9090/
显示如下:
<?xml version= "1.0 " encoding= "UTF-8 " ?>
- <SOAP-ENV:Envelope xmlns:SOAP-ENV= "http://schemas.xmlsoap.org/soap/envelope/ " xmlns:SOAP-ENC= "http://schemas.xmlsoap.org/soap/encoding/ " xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance " xmlns:xsd= "http://www.w3.org/2001/XMLSchema " xmlns:ns= "urn:OCWeb ">
- <SOAP-ENV:Body>
- <SOAP-ENV:Fault SOAP-ENV:encodingStyle= "http://schemas.xmlsoap.org/soap/encoding/ ">
<faultcode> SOAP-ENV:Client </faultcode>
<faultstring> HTTP GET method not implemented </faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
小弟实在不懂为什么会在Body部分出错,望指点,谢谢!代码如下:
OCWeb.h部分:
//gsoap ns service name: OCWeb
//gsoap ns service style: rpc
//gsoap ns service encoding: encoded
//gsoap ns service namespace: http://192.168.18.180:9090/OCWeb.wsdl
//gsoap ns service location: http://192.168.18.180:9090
//gsoap ns schema namespace: urn:OCWeb
struct xsd__base64Binary{
unsigned char *__ptr;
int __size;
};
int ns__transferStream(struct xsd__base64Binary *pstBinary, double *result);
OCWebServer.c部分的代码:
#include "soapH.h "
#include "OCWeb.nsmap "
unsigned char* data = NULL;
int iNum = 0;
int main(int argc, char **argv)
{
int m, s; /* master and slave sockets */
struct soap soap;
soap_init(&soap);
if (argc < 2)
soap_serve(&soap); /* serve as CGI application */
else{
m = soap_bind(&soap, NULL, atoi(argv[1]), 100);
if (m < 0){
soap_print_fault(&soap, stderr);
exit(-1);
}
fprintf(stderr, "Socket connection successful: master socket = %d\n ", m);
for ( ; ; ){
s = soap_accept(&soap);
fprintf(stderr, "Socket connection successful: slave socket = %d\n ", s);
if (s < 0){
soap_print_fault(&soap, stderr);
exit(-1);
}
soap_serve(&soap);
soap_end(&soap);
}
}
return 0;
}
int ns__transferStream(struct soap *soap, struct xsd__base64Binary *pstBinary, double *result)
{
*result = pstBinary-> __size;
iNum = pstBinary-> __size;
data = new unsigned char[pstBinary-> __size + 1];
memcpy(data, pstBinary-> __ptr, pstBinary-> __size);
语言:C/C++, gsoap_linux_2.7.9j(最新)
功能:客户端通过调用服务端的接口,能够把一段比特流传送到服务端
问题:服务端写好后,通过我服务器ip在IE上不能正确得到wsdl信息;
在IE上键入(程序运行的服务器实际ip) http://192.168.18.180:9090/
显示如下:
<?xml version= "1.0 " encoding= "UTF-8 " ?>
- <SOAP-ENV:Envelope xmlns:SOAP-ENV= "http://schemas.xmlsoap.org/soap/envelope/ " xmlns:SOAP-ENC= "http://schemas.xmlsoap.org/soap/encoding/ " xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance " xmlns:xsd= "http://www.w3.org/2001/XMLSchema " xmlns:ns= "urn:OCWeb ">
- <SOAP-ENV:Body>
- <SOAP-ENV:Fault SOAP-ENV:encodingStyle= "http://schemas.xmlsoap.org/soap/encoding/ ">
<faultcode> SOAP-ENV:Client </faultcode>
<faultstring> HTTP GET method not implemented </faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
小弟实在不懂为什么会在Body部分出错,望指点,谢谢!代码如下:
OCWeb.h部分:
//gsoap ns service name: OCWeb
//gsoap ns service style: rpc
//gsoap ns service encoding: encoded
//gsoap ns service namespace: http://192.168.18.180:9090/OCWeb.wsdl
//gsoap ns service location: http://192.168.18.180:9090
//gsoap ns schema namespace: urn:OCWeb
struct xsd__base64Binary{
unsigned char *__ptr;
int __size;
};
int ns__transferStream(struct xsd__base64Binary *pstBinary, double *result);
OCWebServer.c部分的代码:
#include "soapH.h "
#include "OCWeb.nsmap "
unsigned char* data = NULL;
int iNum = 0;
int main(int argc, char **argv)
{
int m, s; /* master and slave sockets */
struct soap soap;
soap_init(&soap);
if (argc < 2)
soap_serve(&soap); /* serve as CGI application */
else{
m = soap_bind(&soap, NULL, atoi(argv[1]), 100);
if (m < 0){
soap_print_fault(&soap, stderr);
exit(-1);
}
fprintf(stderr, "Socket connection successful: master socket = %d\n ", m);
for ( ; ; ){
s = soap_accept(&soap);
fprintf(stderr, "Socket connection successful: slave socket = %d\n ", s);
if (s < 0){
soap_print_fault(&soap, stderr);
exit(-1);
}
soap_serve(&soap);
soap_end(&soap);
}
}
return 0;
}
int ns__transferStream(struct soap *soap, struct xsd__base64Binary *pstBinary, double *result)
{
*result = pstBinary-> __size;
iNum = pstBinary-> __size;
data = new unsigned char[pstBinary-> __size + 1];
memcpy(data, pstBinary-> __ptr, pstBinary-> __size);