• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 17,  comments - 2,  trackbacks - 0
              2009年3月28日
            October 09

            gSoap: How to add info to SOAP Header using gSOAP

            gSoap: How to add info to SOAP Header using gSOAP
            There's some misleading info in gSOAP's official documents in SOAP Header Processing Part. 
            This article leads you to the right way and can make your program work.
            The use case is: 
            Client needs to pass user name and password to Server Side to get authenticated.
            The username and password info should be embeded in SOAP Header.
            Steps:
            1. Edit struct SOAP_ENV__Header in soapStub.h file which is generated by gSOAP's soapcpp2 compiler
            Add the neccesary info to this struct 
            For example:
            The original one is:
            struct SOAP_ENV__Header
            {
            public:
             void *dummy; /* transient */
            };
            This should be changed to:
            struct SOAP_ENV__Header
            {
            public:
             void *dummy; /* transient */
             char *username;
             char *password;
            };
            2.  Edit function soap_out_SOAP_ENV__Header in soapC.cpp file which is also generated by gSOAP
            Add statements to serialize those info into SOAP Header.
            For example:
            The original one is:
            SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Header(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Header *a, const char *type)
            {
                soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Header), type);
                /* transient dummy skipped */
                soap_element_end_out(soap, tag);
                return SOAP_OK;
            }
            This could be changed to:
            SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Header(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Header *a, const char *type)
            {
                soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Header), type);
                /* transient dummy skipped */
                soap_out_string(soap, "headerNS:username", 1, &(a->username), "");
                soap_out_string(soap, "headerNS:password", 2, &(a->password), "");
                soap_element_end_out(soap, tag);
                return SOAP_OK;
            }
            3. Add the namespace mapping to namespaces array in .nsmap file.
             {"headerNS", "http://customeheader.test.com", NULL, NULL},
             
            4. Set the header before invoking Web Service Method. This part you can also refer to the gSOAP's official documenthttp://www.cs.fsu.edu/~engelen/soapdoc2.html#tth_sEc12.
               struct soap soap; 
               soap_init(&soap);  
            ...
                soap->header = (SOAP_ENV__Header *)soap_malloc(soap, sizeof(SOAP_ENV__Header));
                soap->header->username = (char*)malloc(MAX_NAME_SIZE * sizeof(char));
                soap->header->password = (char*)malloc(MAX_NAME_SIZE * sizeof(char));
                strcpy(soap->header->username, username);
                strcpy(soap->header->password, passwd);
                soap_call_method(&soap, ...);  //the SOAP Header will be in the request
            ...
            5. Compile
            6. Run. 
            The SOAP Message could be
            ... 
            <SOAP-ENV:Envelope xmlns:headerNS="
            http://customeheader.vpamws.com">
            <SOAP-ENV:Header>
            <headerNS:username>admin</headerNS:username>
            <headerNS:password>default</headerNS:password>
            </SOAP-ENV:Header>
            <SOAP-ENV:Body> 
            ... 
            </SOAP-ENV:Body> 
            </SOAP-ENV:Envelope>
             
            Any Questions, Please let me know. Thanks.
             
            -Debora
            posted @ 2009-03-28 15:29 BeyondCN 閱讀(1182) | 評(píng)論 (0)編輯 收藏
              2009年3月21日

            1.subst.exe煥發(fā)青春 
            subst.exe是一個(gè)不太常用的DOS命令,它的位置隱藏在\Windows\Command\下(針對(duì)Windows 9X/Me系統(tǒng)),如果是Windows 2000/XP,則應(yīng)該隱藏在\Windows\System32\下,前者的大小為17.6KB,后者的大小更小一些,才9.0KB而已。 
            subst.exe的完整名稱是“給目錄賦驅(qū)動(dòng)器符命令”,它的功能是以磁盤(pán)驅(qū)動(dòng)器號(hào)代替路徑名稱,以使驅(qū)動(dòng)器號(hào)與指定的子目錄路徑關(guān)聯(lián),其命令格式很簡(jiǎn)單: 
            subst.exe [Driver1: [Driver2:] Path] 
            其中的“Driver1”是指定指派路徑的虛擬驅(qū)動(dòng)器盤(pán)符,“Driver2 Path”則是指定物理驅(qū)動(dòng)器和要指派給虛擬驅(qū)動(dòng)器的路徑。 
            2.利用subst.exe虛擬軟驅(qū) 
            例如,在安裝瑞星殺毒軟件前,你可以先通過(guò)其他方式(例如局域網(wǎng)、郵件、共享文件)將A盤(pán)的所有文件復(fù)制到本機(jī)的一個(gè)文件夾中,例如D:\temp下。然后在命令提示符窗口下鍵入如下命令“subst A: D:\temp”,如圖1所示,朋友們可以看一看這里用“dir A:”命令后的文件列表,就知道一張軟盤(pán)中是絕不可能放入如此之多的東東的。這樣,我們就可以按照這種方法將D:\temp文件夾虛擬成A盤(pán),瑞星殺毒軟件的安裝就可以順利完成了。 
            當(dāng)我們虛擬軟驅(qū)后,你會(huì)發(fā)覺(jué)軟驅(qū)的圖標(biāo)已經(jīng)變成了圖2所示的硬盤(pán)圖標(biāo),當(dāng)然雙擊打開(kāi)后就是D:\Temp文件夾中的內(nèi)容。 
            3.刪除虛擬軟驅(qū) 
            如果你要?jiǎng)h除這個(gè)虛擬出來(lái)的A盤(pán),只要執(zhí)行“subst A:/D”命令就行了,切記工作結(jié)束后一定要及時(shí)刪除這個(gè)虛擬出來(lái)的A盤(pán),否則無(wú)法正常使用原來(lái)的物理A盤(pán)喲。 
            有些軟件只能在軟盤(pán)上運(yùn)行,這是軟件開(kāi)發(fā)者的特別設(shè)計(jì),主要目的是為了防止非法拷貝。不過(guò),我們可以先通過(guò)HD-COPY工具將軟盤(pán)做成一個(gè)擴(kuò)展名為img的鏡像文件存放在硬盤(pán)上的某個(gè)文件夾中,然后利用IMGDRIVE、UNDISK等工具軟件將該鏡像文件展開(kāi),這樣就可以在硬盤(pán)上創(chuàng)建一個(gè)虛擬軟盤(pán),自然也就可以正常運(yùn)行了,不過(guò)如果是加密的軟件,則無(wú)法通過(guò)這種方法正常運(yùn)行。

            posted @ 2009-03-21 13:18 BeyondCN 閱讀(577) | 評(píng)論 (0)編輯 收藏
              2009年3月19日

            Sector, Boot Sector, Track, Cluster, Bad Sector, Lost Cluster

            Sector, Track and Cluster

            Sector, Track and Cluster

            A Sector in the context of computing refers to a small area of a storage device, for example a hard disk drive. 
            For more detailed information please see below.
            spr
            AddThisThis page is © Copyright 2001-2008 helpwithpcs.com
            spr

            Sector, Track and Cluster continued...

            A typical hard disk drive when low-level formatted is split into tracks, sectors and clusters:
            • Tracks are concentric circles around the disk.
            • Sectors are segments of a track.
            • Clusters are a set of sectors.

            Sector, track and cluster example
            In the example on the left in fig 1.1 we have only illustrated one track, one sector and one cluster, but you can see where the other tracks, sectors and clusters would reside. 

            A typical hard drive may have 30 or more tracks, and 10 or more sectors per track. 

            The size of a cluster will vary depending on the size of the partition.

            Bad Sector

            A bad sector refers to a single sector that has some physical flaw. Although a disk can operate with a bad sector, any data that was stored in that sector will be lost, further, no data can be written to that sector. 

            Lost Cluster

            A lost cluster is a cluster that the operating system has classed as being in use, but actually contains no data. The ScanDisk utility within Windows is designed to search for lost clusters and make them available to the file system again. 

            The Boot Process and the boot sector

            Boot sector refers to a single sector (normally the first in the active partition) that contains the code to boot the operating system. 

            Before the boot sector is read, the computer's bios will call a small program called an MBR (Master Boot Record), which normally resides in the first record of the first disk. 

            The MBR will query the FAT (File Allocation Table) to establish the primary partition and then pass control over to the boot sector of that partition. 

            The small program stored in the boot sector is then executed and the operating system will begin to load.
            spr
            posted @ 2009-03-19 10:20 BeyondCN 閱讀(508) | 評(píng)論 (0)編輯 收藏
              2008年11月14日
                 摘要:   閱讀全文
            posted @ 2008-11-14 11:40 BeyondCN 閱讀(1022) | 評(píng)論 (0)編輯 收藏
              2008年11月8日
                 摘要:   閱讀全文
            posted @ 2008-11-08 13:26 BeyondCN 閱讀(871) | 評(píng)論 (0)編輯 收藏
              2008年11月7日
                 摘要:   閱讀全文
            posted @ 2008-11-07 00:24 BeyondCN 閱讀(231) | 評(píng)論 (0)編輯 收藏
              2008年11月3日
                 摘要: 在 .Net 中實(shí)現(xiàn)自定義事件   .Net 中的自定義事件,其實(shí)是利用委托實(shí)現(xiàn),大概可以分為以下幾個(gè)步驟:1、定義事件傳送的 EventArgs ,當(dāng)然也可以直接使用系統(tǒng)的 EventArgs。2、定義該事件類(lèi)型的委托。3、定義事件的處理方法。4、在需要的地方拋出事件,拋出的事件會(huì)在外部被捕捉到。我們以一個(gè)簡(jiǎn)單的計(jì)算程序?yàn)槔v解,該程序?qū)崿F(xiàn)計(jì)算兩個(gè)給定數(shù)字的和,當(dāng)結(jié)果<=100時(shí)...  閱讀全文
            posted @ 2008-11-03 00:58 BeyondCN 閱讀(511) | 評(píng)論 (0)編輯 收藏
                 摘要:  使用Delegate類(lèi)型設(shè)計(jì)自定義事件作者:羅會(huì)濤    在C#編程中,除了Method和Property,任何Class都可以有自己的事件(Event)。定義和使用自定義事件的步驟如下: (1)在Class之外定義一個(gè)delegate類(lèi)型,用于確定事件程序的接口   (2)在Class內(nèi)部,聲明一個(gè)public e...  閱讀全文
            posted @ 2008-11-03 00:55 BeyondCN 閱讀(598) | 評(píng)論 (0)編輯 收藏
            僅列出標(biāo)題  下一頁(yè)
            久久久久亚洲爆乳少妇无| 亚洲国产精品无码久久久秋霞2 | 一本大道久久香蕉成人网| 久久久久久久97| 91久久精品视频| 亚洲中文字幕无码久久2020| 狠狠久久亚洲欧美专区| 午夜视频久久久久一区| 久久久久高潮毛片免费全部播放| 狠狠综合久久综合中文88| 久久婷婷激情综合色综合俺也去| 久久91这里精品国产2020| 99精品国产综合久久久久五月天| 国产亚洲精午夜久久久久久| 996久久国产精品线观看| 久久婷婷人人澡人人爽人人爱 | 婷婷久久综合| 精品久久久久一区二区三区 | 久久久国产99久久国产一| 青青青青久久精品国产| 久久综合国产乱子伦精品免费| 国内精品伊人久久久影院| 精品久久久无码中文字幕| 一本一道久久精品综合| 99久久精品影院老鸭窝| 潮喷大喷水系列无码久久精品| 人妻精品久久无码专区精东影业 | 久久99久久99精品免视看动漫| 久久人妻少妇嫩草AV无码蜜桃| 久久99精品国产麻豆宅宅| 久久国产欧美日韩精品| 久久久久女人精品毛片| 久久99精品久久久久久hb无码| 久久久久亚洲AV成人片| 日产精品久久久久久久性色| 久久亚洲日韩精品一区二区三区| 久久久久久精品成人免费图片| 精品久久亚洲中文无码| 97久久国产露脸精品国产| 日韩人妻无码精品久久久不卡| 久久综合亚洲欧美成人|