on 01-23-2007 5:01 PM
I'm having trouble passing null values as a parameter in a web service call.
Lets say I have the following code:
____________________
public int UpdateDistributor( java.lang.String Distributor_SAPID, int Country_ID )
{
//@@begin UpdateDistributor()
IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
int returnCode;
Request_EmployeeSalesServicesSoap_updateDistributor reqUpdateDistributor = new Request_EmployeeSalesServicesSoap_updateDistributor();
try {
reqUpdateDistributor.setCountryID(Country_ID);
reqUpdateDistributor.setDistributorSAPID(Distributor_SAPID);
reqUpdateDistributor.execute();
returnCode = reqUpdateDistributor.getResponse().getResult();
} catch(Exception ex) {
msgMgr.reportException(ex.getLocalizedMessage(),true);
returnCode = -1;
}
return returnCode;
//@@end
}
______________
If "Distributor_SAPID" is null (which it can be under certain circumstances). I get an error:
<b>Server was unable to process request. --> Procedure 'UpdateDistributor' expects parameter '@DIST_SAPID', which was not supplied</b>
"@DIST_SAPID" is the name of the parameter in my stored procedure that the web service calls.
Yet, if I make the equivalent call to the stored procedure directly:
<b>UpdateDistributor null,1,0</b>
Everything works fine.
The problem, I am speculating, is that I need to pass a "DBNull" as opposed to a "null" from Dynpro. Unfortunately I haven't been able to find this identifier anywhere.
Any suggestions?
Hi Sheldon,
What i feel is that it's not been handled in your webservice if the parameter is null or "" <blank> space
i just you to take care in webservice that if the parameter is null or "" pass the parameter null to the stored proc
Regards
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.