亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問(wèn)板塊 發(fā)新帖
查看: 8963 | 回復(fù): 1
打印 上一主題 下一主題

[C++] gsoap Error 200 fault:SOAP-ENV:Client [no subcode] [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2013-08-28 15:56 |只看該作者 |倒序?yàn)g覽
最近在用gsoap進(jìn)行web service 客戶端的開(kāi)發(fā),現(xiàn)在使用c進(jìn)行開(kāi)發(fā),連接用java開(kāi)發(fā)的服務(wù)器,現(xiàn)在連接不上,調(diào)試了好久,都還是不行,下面我貼下代碼,牛人給指導(dǎo)一下:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "Service.nsmap"
#include "soapH.h"

#define GROUPID        "12"

int get_list (const char *server, struct _ns2__GetDeviceList *send,
                struct _ns2__GetDeviceList_Rsp *recv);

int
main (int argc, char **argv)
{
        int result;
        struct _ns2__GetDeviceList list1;
        struct _ns2__GetDeviceList_Rsp list2;


        const char server[] = "http://192.168.14.48:8080/megaWS/services/Service?wsdl";
//        const char server[] = "192.168.14.48:8181";

        list1.WSRequest->GroupId = (char *)malloc(10 * sizeof(char));

        if(list1.WSRequest->GroupId == NULL)
        {
                printf("malloc error\n");
                exit(1);

        }
        printf("-------------------start to connect service server!--------------------\r\n");
        memcpy ((list1.WSRequest)->GroupId, GROUPID, 2);
        printf("--->Groupid is %s\r\n", list1.WSRequest->GroupId);
        result = get_list (server, &list1, &list2);
        if (result != 0)
        {
                printf ("get list error:%d\n", __LINE__);
                printf ("soap error, errcode=%d\n", result);
        }
        else
        {
                printf ("-->get_list successful!\n");
                printf("__sizeDeviceItem is :%d\r\n", list2.DeviceInfo->DeviceList->__sizeDeviceItem);
                //list2.ns2__GetDeviceList_Req->DeviceInfo->DeviceList->DeviceItem
                printf("DeviceId\t\tName\t\tStatus\t\t\n");
                printf("%s\t\t%s\t\t%s\t\t\n",
                                list2.DeviceInfo->DeviceList->DeviceItem->DeviceId,
                                list2.DeviceInfo->DeviceList->DeviceItem->Name,
                                list2.DeviceInfo->DeviceList->DeviceItem->Status);
        }
        return 0;
}

int
get_list (const char *server, struct _ns2__GetDeviceList *send,
                struct _ns2__GetDeviceList_Rsp *recv)
{
        int result;
        struct soap black_soap;

        soap_init (&black_soap);
        soap_set_namespaces (&black_soap, namespaces);
        printf("--->to call the soap_call___ns1__GetDeviceList\r\n");
        if(soap_call___ns1__GetDeviceList (&black_soap, server, NULL, send, recv) == SOAP_OK)
        {
                printf("soap is ok!\r\n");
        }
        else
        {
                soap_print_fault(&black_soap, stderr);
        }
        soap_call___ns1__GetDeviceList (&black_soap, server, NULL, send, recv);
/*        if (black_soap.error)
        {
                printf ("soap error: %d, %s, %s\n", black_soap.error,
                                *soap_faultcode (&black_soap), *soap_faultstring (&black_soap));
                result = black_soap.error;
        }*/
        printf("the funtion soap_call___ns1__GetDeviceList is return!\r\n");
        soap_end (&black_soap);
        soap_done (&black_soap);
        return result;
}

出現(xiàn)如下錯(cuò)誤:
Error 200 fault: SOAP-ENV:Client [no subcode]
"Error 200"
Detail: [no detail]

現(xiàn)在的問(wèn)題:連接不上服務(wù)器 調(diào)用soap_call___ns1__GetDeviceList 傳入的server不同錯(cuò)誤不一樣。
const char server[] = "http://192.168.14.48:8080/megaWS/services/Service?wsdl";
const char server[] = "192.168.14.48:8080";
這兩種全是錯(cuò)誤的
服務(wù)器IP 192.168.14.48 port是8080 以何種方式才能正確連接呢?

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2013-08-28 16:24 |只看該作者
差了很多資料,網(wǎng)上說(shuō)要將server[]換成全路徑、、但是不知道怎么才是全路徑,我剛剛接觸gsoap,所以大家多多指教、、、
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過(guò)ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP