English 中文(简体)
Calling AS400 SP from ASP .NET webservice
原标题:

I have an external stored procedure (SP) in AS400 with IN and OUT prameters.When my SP is called from webservice with IN and OUT parameters, it shows me an error (Attempted to read or write protected memory).But when the webservice has all the parm as IN mode and calls my SP it works properly.

最佳回答

Just for arguments sake, it should not be important that your stored procedure runs on an AS400. From the point of view of your ASP.NET webservice it is using a regular DB2 database. BTW how do you connect from the Webservice to the database, ADO.NET, ODBC or something else.

Have you tried to call the stored procedure from the AS400 SQL command shell (STRSQL)? Have you tried to call the stored procedure from the Client Access Navigator SQL script? Especially if the last one works, your SP is technically correct. Notice that you can retrieve the definition of the SP in CA Navigator. Study your IN and OUT parameter very good because DB2 is not very forgiving about the type of these parameters.

Notice that your external program on the as400 (ILE or not ILE?) must support the type of parameters that you have defined for your stored procedure. Maybe your IN parameters are correct, but your OUT parameter is not correct. Therefore, your program can fail if it want to return a value. Also, you can have defined a different set of parameters (e.g. SQL instead of JAVA). I can image that defining the wrong set can give strange effects.

For now, test your SP with CA Navigator (available with every AS400). If that works, your SP works. Then you can narrow your problem down to your Webservice.

Also, in DB2 you can define your parameters als INOUT. That will be a nice experiment too.

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签