Cannot Invoke Webservice Error


Hi All,

I am using .Net Proxy to access webServices.If the return argument of my service is String or Numeric it gets called successfully.

However when I am calling a service which returns nested objects I am getting exception "Cannot Invoke Webservice".

This the piece of code I am using is below:

SoapConnection conn
samserviceservice lnv_sam
businessactivityto   lstr_businessactivity_to
long li_ret
String ls_typecd,ls_classname,ls_sequence
conn = Create SoapConnection
li_ret = conn.CreateInstance(lnv_sam,'samserviceservice')
ls_sequence = lnv_sam.getsequenceid() // Works fine
ls_classname = lnv_sam.classname() // Works Fine
lstr_businessactivity_to=lnv_sam.retrievebusinessactivity( '32364124', 'G' ,'t001275') // Give Exception
ls_typecd = lstr_businessactivity_to.typecd
Catch (SoapException e)
End Try

Thanks & Regards,

Shaila Panwar


Question Tags: 


Marco Meoni answered Cannot Invoke Webservice Error



Do you get in the client pbl as many NVOs as number of nested objects used by the WS?

What exactly e.getmessage() says?

Is the deployment of the proxy project working fine or any warning in the PB log window?


Marco's picture


Yes i have got all the NVO generated from the PROXY.

e.GetMessage () give me the error  "Cannot Invoke Webservice"

However I am able to use the function  ls_sequence = lnv_sam.getsequenceid() from same webservice.

But when I am using function lstr_businessactivity_to=lnv_sam.retrievebusinessactivity( '32364124', 'G' ,'t001275')  it goes to exception block and gives me error "Cannot Invoke Webservice"

I am not getting any error while creating the instance of the webservice apart from this.

The only difference in this two  calls are that first one returns string while other returns nested object.








Marco Meoni's picture

Hi Shaila,

so, you do have a businessactivityto NVO generated in the client PBL, do you?

Now, if yes, does it have nested object(s) and the corresponding NVO(s) is/are created in the client PBL too? You were mentioning "nested objects", but I only see one among the declared variables, the following:

businessactivityto   lstr_businessactivity_to

‚ÄčThis said, provided that businessactivityto as well as ALL its nested objects are in the client PBL, what if you return the businessactivityto nested object by reference? For example:

ll_rc = lnv_sam.retrievebusinessactivity( '32364124', 'G' ,'t001275', lstr_businessactivity_to) 

instead of

lstr_businessactivity_to = lnv_sam.retrievebusinessactivity( '32364124', 'G' ,'t001275') // Give Exception


Marco's picture

Hi Marco,

Thanks for the input.

Let me give you bit more details about the businessactivityto .This is an array kind of objects and is having below properties:

    string businessActivityId
    string typeCd
    string expectedCompletionDate
    string datetimeCreated
    string creationUserId
    string datetimeUpdated
    string updateUserId
    string statusCd
    string lockedByUserId
    string lockedDatetime
    string llvrValidResultFlag
    PositionTO ws_positionTO
    ConcurrentDealsTO concurrentDeals[]
    string updateSequenceId
    string modificationStatus
    string stampingComplete
    string savedPositionCd
    string goeCreditApplId
    string dateTimeRetrieved
    SamErrorTO samErrorsTO[]

Array object inside businessactivityto  and all of them are available in my PBL after deploying the proxy Objects.

Are you saying that I need to declare all the other objects inside businessactivityto   as well before calling to the function?

When I am using these services via EJB which are on EA server it works fine. I am getting issue when I try to access them Directly without EJB via WSDL.

EJB is on PB12.5 where WSDL I am trying to check on PB2017.

I tried using the other  method  ll_rc = lnv_sam.retrievebusinessactivity( '32364124', 'G' ,'t001275', lstr_businessactivity_to) but it did not work for me as it has given me compilation error "Bad Number of Argument to function "retrievebusinessactivity".

This function has only three input parameter and which I have already given hence it is not accepting the fourth one.

As I mentioned if I call the service ls_sequence = lnv_sam.getsequenceid() from the WSDL , getsequenceid returns only string and thus I am able to call this without any issue.

I am wondering if the return parameter has anything to do with this error.

Thanks & regards,

Shaila Panwar