Best Practice: Consuming Different Web Services based on Engineering Environment

Gray, Chris 1 Reputation point
2021-09-02T02:58:08.847+00:00

All,
Recently inherited a ASP.NET project that utilizes a number of production IBM I-Series Web Services (23) based on RPG.

I am handing the Microsoft ASP.NET side. I know little on the IBM side.

The plan is to now have a stage version of the Web Services as well as a Stage version Microsoft ASP.NET Web setup.

I have the Microsoft setup (DB, Site etc.) in place but currently utilizing (pointing to) the Production Web Services.
My colleague who handles the IBM side has the Web Services in place based on the Stage IBM Libraries/Data. Smoke testing has shown that the Stage Web Services work if I Add/Consume the Stage Web Service and call the proxy object/methods.

My question is what is the best practice to setup things properly on the Microsoft side to utilize/consume the proper Web Services on the IBM.

Ideally I would like the process to be based on the Web.config file.

A quick trial of simply swapping out just the URLs in the web config has given errors similar to;
Unexpected Wrapper Element getempdep found. Expected {stggettempdep.wsbeans.iseries/} getempdep.

I have also tried the approach to create a class based around a single stage and a single production proxy class. This new class then selects, based on a environment variable in the Web.Config, which proxy class to utilize. I have gotten this approach to work but it will entail a lot of code considering there are 23 web services involved.

Looking at the error I was receiving from just swapping out the URLs it appears the issue may be around XML namespaces. The production namespace is named; SOAPgettempdep.wsbeans.iseries/ and Stage is stggettempdep.wsbeans.iseries.

Again this is from a quick look and I think getting the best practice approach is a first step.

Thanks so much,
Chris

Developer technologies | .NET | Other
Developer technologies | VB
Developer technologies | ASP.NET | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Gray, Chris 1 Reputation point
    2021-09-02T15:51:53.833+00:00

    All,
    Another thing I have come up with is having two separate instances of the environments.

    One Stage and One Prod. Then swapping the Web Service URLs and then creating the proxy class a new for each of the IBM environments..

    Then any production moves would have me moving the non-proxy class files in a typical code move from Stage to Prod and then a recompile. This assumes little to no Web Service code changes on the IBM. I would use the proxy objects as I have before regardless of Stage or Prod.

    I am thinking to get this to work my IBM colleague would have to create a separate test folder and rename the Web References to be similar. I believe this would correct the WSDL issue pointing to different namespaces. The only thing looking at the WSDLs currently that would change would be the soap:address lines between the stage and production.

    Thoughts?

    Thanks
    Chris

    0 comments No comments

  2. Duane Arnold 3,216 Reputation points
    2021-09-02T20:46:11.893+00:00

    There are ASP.NET tags in MS Q&A you could post to for help.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.