Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsdl issues? #1

Open
7yl4r opened this issue Apr 7, 2024 · 0 comments
Open

wsdl issues? #1

7yl4r opened this issue Apr 7, 2024 · 0 comments

Comments

@7yl4r
Copy link
Member

7yl4r commented Apr 7, 2024

The soap wsdl at https://cdmo.baruch.sc.edu//webservices2/requests.cfc?wsdl might have issues. I am having trouble making it work and tried two different SOAP drivers:

from zeep import Client as ZeepClient

# Initialize the Zeep client                                                                                                                                                      
zeep_client = ZeepClient(wsdl="http://cdmo.baruch.sc.edu/webservices2/requests.cfc?wsdl")

print(zeep_client.service)  # Lists available operations and their bindings                                                                                                       

# Assuming `station_code` and `param_name` are defined                                                                                                                            
response = zeep_client.service.exportSingleParamXML(
    station_code,  # Station_Code                                                                                                                                                 
    25,  # recs                                                                                                                                                                   
    param_name  # param                                                                                                                                                           
)

yields a bunch of these:

/home/tylarmurray/.local/lib/python3.10/site-packages/zeep/wsdl/definitions.py:146: UserWarning: The wsdl:operation 'exportAllParamsXML' was not found in the wsdl:portType '{http://webservices2}Requests'
  warnings.warn(str(exc))

and

<zeep.proxy.ServiceProxy object at 0x7fcd6d537f70>
Traceback (most recent call last):
  File "/home/tylarmurray/.local/lib/python3.10/site-packages/zeep/proxy.py", line 97, in __getitem__
    return self._operations[key]
KeyError: 'exportSingleParamXML'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tylarmurray/nerrs-data/nerrs_data/nerrs_data.py", line 57, in <module>
    getData("acespwq", "Sal")
  File "/home/tylarmurray/nerrs-data/nerrs_data/nerrs_data.py", line 19, in getData
    response = zeep_client.service.exportSingleParamXML(
  File "/home/tylarmurray/.local/lib/python3.10/site-packages/zeep/proxy.py", line 88, in __getattr__
    return self[key]
  File "/home/tylarmurray/.local/lib/python3.10/site-packages/zeep/proxy.py", line 99, in __getitem__
    raise AttributeError("Service has no operation %r" % key)
AttributeError: Service has no operation 'exportSingleParamXML'

I worked around this by manually parsing the raw xml, which is certainly not ideal. I think this might be a bug in the provided wsdl which could be reported to the CDMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant