0

I have this python code to access webservice.

import urllib.request
import ssl
import suds.transport.http
import os.path
from os import path
from suds.client import Client
import json
import time

class UnverifiedHttpsTransport(suds.transport.http.HttpTransport):
  def __init__(self, *args, **kwargs):
     super(UnverifiedHttpsTransport, self).__init__(*args, **kwargs)
  def u2handlers(self):
     handlers = super(UnverifiedHttpsTransport, self).u2handlers()
     context = ssl.create_default_context()
     context.check_hostname = False
     context.verify_mode = ssl.CERT_NONE
     handlers.append(urllib.request.HTTPSHandler(context=context))
     return handlers

url="https://xxxxxxx.com/datamanagement.asmx?WSDL"
client = Client(url, transport=UnverifiedHttpsTransport())
client.service.ClearPeopleStatus()

def InsertPeopleData(data):
  info=data.decode("utf-8")
  json_obj = json.dumps(json.loads(info))
  ret_ = client.service.ReadPeopleStatus()
  ret=client.service.InsertPeopleData(json_obj)  
  return

The code is to update data to IIS webservice using Gsoap. If I don't call these two APIs client.service.ReadPeopleStatus() and ret=client.service.InsertPeopleData(json_obj) , my program runs ok.

If I call these two APIs, I have Segmentation Fault (Core dump).

How can I solve the issue?

batuman
  • 7,066
  • 26
  • 107
  • 229
  • Your question is not clear or incomplete, i.e. where does the segfault occur? Perhaps use a debugging tool to find out? If the server side backend service C/C++ code crashes, then this is most likely due to an backend application-level logic issue, such as a nullptr access when pointer derefs go unchecked. Problems are typically unrelated to IIS+gSOAP. – Dr. Alex RE Sep 03 '20 at 12:58
  • Segmentation fault happened only at client side when I call webservice APIs. If no interfacing webAPIs, there is no segmentation fault at client code. How can I debug the issue? – batuman Sep 04 '20 at 00:17
  • Something in suds isn't working right, so perhaps log the messages https://stackoverflow.com/questions/4426204/how-can-i-output-what-suds-is-generating-receiving then check the suds docs? – Dr. Alex RE Sep 05 '20 at 17:55

0 Answers0