0

我有一个 ws 客户端,在 solaris 10 中使用 gsoap-2.8 开发为共享库。

如果从独立应用程序(可执行文件)调用 ws 客户端,它工作正常并且能够从服务器检索值。

(dbx) run data
Running: testws data
(process id 5998)
t@1 (l@1) stopped in getDataFromWS at 0xf8953fec
0xf8953fec: ExecuteMCEligibility       :        sethi    %hi(0x1e000), %g1
(dbx)cont
(dbx)execution completed, exit code is 0

如果从另一个共享库调用相同的 ws 客户端,它会崩溃并显示以下消息,

t@12 (l@12) stopped in getDataFromWS at 0xf3ccc9e4
0xf3ccc9e4: getDataFromWS       :        sethi    %hi(0x1e000), %g1
Current function is writeData
180         retval = writeData(data);
(dbx) cont
      t@12 (l@12) signal SEGV (no mapping at the fault address) in soap_end_block at    
      0xf8ea42d8
      0xf8ea42d8: soap_end_block+0x0040:      ld       [%o0], %i3
      Current function is writeData
      180         retval = writeData(data);

(dbx) where
current thread: t@12
[1] soap_end_block(0xf435b874, 0x0, 0x0, 0x68747470, 0x0, 0xf29db108), at 0xf8ea42d8
[2] soap_free(0xf29db108, 0x16148, 0x2fb0, 0x0, 0x154fa, 0xf8f09f9c), at 0xf8ea9380
[3] soap_call___ns1__getSomeData(0xf29db108, 0xb471b8, 0x6a1090, 0xf29db0e4, 
    0xf29db0dc, 0xf29da6d8), at 0xf3ccbddc
[4] getDataFromWS(0x72b618, 0xfffffffe, 0xf29db108, 0xf29f87dc, 0xf29f87d4, 
    0xf29f87c4), at 0xf3ccd0d0
[5] writeData(0x72b618, 0x72b908, 0xf4204448, 0xf29f8940, 0x72d8a0, 0x1010101), at 
    0xf41f2510

代码快照如下,

struct _ns2__getSomeData
{
    char *aaa;     
    char *bb; 
    char *cc;     
    char *dd;      
    char *ee;
    char *ff;  
    char *gg;       
    char *hh;      
    char *ii;     
};


struct _ns2__getSomeDataResponse
{
    char *xx;
    char *yy;  
};

int getDataFromWS( data )
{
    int status = sSUCCESS;
    soap mSoap;
    soap_init(&mSoap);
    mSoap.userid = mUserId;
    mSoap.passwd = mPassword;

    _ns2__getSomeData mcRequest;
    _ns2__getSomeDataResponse mcResponse;

    //initialize request and response  message values
    initRequestResponseMsgValues();

    // Calling external web serice using gSOAP interface
    int ret_val = ret_val = soap_call___ns1__getSomeData(&mSoap,
                                     (const char*) *(mCurrentHost),
                                     (const char*) mSoapAction,
                                     &mcRequest,
                                     &mcResponse );

    // Only return response if web service call was successfull
    if (ret_val == SOAP_OK )
    {
        //set values in data
    }

    soap_free_temp(&eligibleCheck.mSoap);
    soap_done(&eligibleCheck.mSoap);
    return status;
}

如果有人可以提供有关如何解决此问题的提示,那将是一个很大的帮助。

4

0 回答 0