Sonu
Sonu

Reputation: 314

How to send(set) parameter dictonaryy to zeep client

Sorry if this question is already asked. I am trying to send some parameter as dict, but i am getting results as none or not note found. in parameter i am sending NodeName(GOAFB) and want to change its NodeDetails as mention in param. And this node name is available on the address, check with get method(Shown in snapshot). Below is the code i tried

from zeep import Client
from zeep.transports import Transport
from requests import Session
from requests.auth import HTTPBasicAuth
from zeep.wsse.username import UsernameToken
import json

wsdl = "http://10.2.1.8/ws/17.0/Bhaul.asmx?wsdl"
session = Session()
client = Client(wsdl, transport=Transport(session=session),wsse=UsernameToken('admin','password'))

param = {
  "Ib440ConfigSet": {
    "NodeName": "GOAFB",
    "NodeDetail": {
      "Custom": [
        {
          "Name": "Circle",
          "Value": "KOLKATA"
        },
        {
          "Name": "SGW",
          "Value": "1010"
        }
      ]
    }
   }
}
dd=client.service.Ib440ConfigGet("GOAFB")

client.service.Ib440ConfigSet(*param)

Below snapshot contains results: enter image description here

Please support how to make it working

Upvotes: 0

Views: 539

Answers (1)

Tarique
Tarique

Reputation: 1461

In order to send a dict we need to assign double * So this should work for you:

client.service.Ib440ConfigSet(**param)

Upvotes: 1

Related Questions