Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6728629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:11:36+00:00 2026-05-26T10:11:36+00:00

This is about my solution to that question It is been a long time

  • 0

This is about my solution to that question

It is been a long time since my last c# coding, and it is my first time to write a Web Service…

Previous Question:

I need to use a DLL on an Ubuntu with Python. Final solution is using a web service for that propose…

My problem is, the API is used for a kind of payment. There are three basic function of the DLL to be used in the webservice… First one is used for connection to the server, second one is asking available payments, third one is selecting one and making the payment…

Since my system is using Python, I wish to keep the logic that selects the payment method on python, not on the web service.

And my problem is, when I make a connection, webservice must create a connection object, and do the following two steps using that connection. That it may dispose that connection object and create a new one for the next connection and payment.

So, my Python code will do something like that…

  1. Use web service and create a connection
  2. Get a list of available payments from web service (these two functions can be used as a single function in the web service)
  3. Do some calculation and select the proper payment in python…
  4. Send payment method info to web service…

All these steps must be done with the connection object from the first step.
As I said before, I do not have much knowledge about web services and using them on python… So I’m confused whether I may use the same connection object for steps 2 and 4. If I create the connection object as a global in my web service on the connection step, then my following function calls use that object? In OOP that’s the way it must be, but I can not be sure if it will be same in web services?

Some code snippet :

namespace paymentType{
  public class x : System.Web.Services.WebService{

  ConnectionObj conn;
  ConnResult result;

  [WebMethod]
  public void ConnectToServer(String deviceId){
  conn = new ConnectionObj();
  result = baglanti.Connect(deviceId);
  }

  [WebMethod]
  public List<int> GetCompanyList(){
  List<int> kurumlar = new List<int>();
  if (sonuc.CRCStatus){
  if (baglanti.CompanyList != null) { blah blah blah...}

Since conn is a global, can i set it in the function call ConnectToServer and use the baglanti object for the other functions…

UPDATE: Let me try to get it more clear…

When I connect to remote server (via function in the DLL), remote server accepts my connection and give me a somewhat unique id for that connection. Then I ask for available payments for a customer. Server sends all available ones with a transaction id belong to that transaction. And in the final step, I use the transaction id that I want for doing the payment. Problem is, each transaction id is usable within the connection that it was created. So, I must request for transaction id and confirm the one I want in the same connection…

But as far as I see, best solution is using a single function call and do all the job on the web service since API provider considers removing the connection-transactionId lock might cause some security vulnerabilities…

But on the other hand, I do not want to handle it on the web service…

One more question… On the connection step, creating the connection and using set/get functions or returning the connection object and pass it back to the web service for each following step might work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:11:37+00:00Added an answer on May 26, 2026 at 10:11 am

    If you’re communicating using a web service, it should preferrably be stateless – that is, you should always send any context information the service implementation needs in the request. While technologies that let you implement stateful web services exist, they’d likely make things more complicated, not less.

    I’m not clear from your description on why you need the connection object to be created in Step 1, or why you can’t just create a different connection object for steps 2 and 4 – which is how I’d implement this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is about a web app that serves images. Since the same request will
This question has been retitled/retagged so that others may more easily find the solution
In this question superwiren asks about the pitfalls for converting a .net 2.0 solution
I have some questions about cakePHP, I spent long time Googling for a solution
I have been lurking for a long time on this forum and I found
I've created a question about this a few days . My solution is something
I am getting an error about the assembly C:\Ora10g\bin\Zip.exe. The trouble is this solution
This question about Timers for windows services got me thinking: Say I have (and
I know this question has been asked a million times in various ways by
Here's a little problem I've been thinking about for a while now that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.