首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ASIC BRS SOAP API服务绑定错误

ASIC BRS SOAP API服务绑定错误
EN

Stack Overflow用户
提问于 2020-12-31 16:22:01
回答 1查看 21关注 0票数 0

我正在为一个客户建立ASIC(澳大利亚)商业登记(BRS)应用程序。UAT中的ASIC SOAP API在soap响应内的服务绑定中存在缺陷。它会返回一个不正确的URL。

EN

回答 1

Stack Overflow用户

发布于 2020-12-31 16:22:01

下面的代码解决了这个问题:

代码语言:javascript
复制
def your_wsdl(DocumentHeader, DocumentBody):

    """Call ASIC using the SOAP API listin the BRS document
    :param DocumentHeader: dictonary with the fields as specifed in BRS documentation 
    :param DocumentBody: dictonary with the fields as specifed in BRS documentation
    """


wsdl = Config.objects.get(code="ASIC_API").value + str('?WSDL')
wsdl_session = Session()
wsdl_session.auth = HTTPBasicAuth(Config.objects.get(code="ASIC_API_ID").value, Config.objects.get(code="ASIC_API_PASS").value)
transport = Transport(session=wsdl_session)
client = Client(wsdl, transport=transport)

##get_service2 fixes the incorrect binding response in BRS UAT
service = get_service2(client=client)


soap_response={}
with client.settings(raw_response=True, xsd_ignore_sequence_order=False):
    try:
        soap_response= service.externalInitiat
    except Exception as e:
        soap_response = { 'status_code': 500 }            

def get_service2(客户端):

代码语言:javascript
复制
    """Fix for the incorrect Service Binding
    :param client: soap client object
    """

service_binding = client.service._binding.name
service_address = Config.objects.get(code="ASIC_API_url").value
return client.create_service(service_binding, service_address)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65518389

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档