Web Service Access

I am trying to write to a client to access a web service to work. I have successfully written clients using SUDS and ZSI with Python. I used NetBeans 6.9 to help write several Java clients. Successful clients have access to the free web services that I found on the Internet.

The client I need to connect with to work is not very friendly. This requires authentication:

http://www.cmicdataservices.com/datacenter/service.asmx

If I grab the WSDL descriptions of this web service, I see that there are six methods.

Methods (6): CheckIfAuthorized() DataProcessed() GetCurrentDataVer1() GetID() LogDSCStatus(xs:string _clientname, xs:string _status, xs:string _errormsg) ResetNewDataReferences() 

Also returns 70 types. One of them is authentication type.

In my Python and Java clients, I was able to create these authentication objects, but could not do anything.

From the WSDL, there is no indication that there is any way to create these authentication objects with what is available. The web service provider offers a client built using Adobe Air, and I can check this to make sure that I can authenticate with the web service and use it.

This is the first time I have had to interact with a web service, and I'm not sure if something is missing here. Can someone tell me if there is something obvious that I am missing here how to authenticate using this service?

Here is the Python client I wrote, plus its output. You can see a beautiful printout of WSDL information if you uncomment the print client line. A.

 #!/usr/bin/python from suds.client import Client url='http://www.cmicdataservices.com/datacenter/service.asmx?wsdl' client = Client(url) #print client print client.service.CheckIfAuthorized() 

Output:

 Traceback (most recent call last): File "CMICTest.py", line 23, in <module> print client.service.CheckIfAuthorized() File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg /suds/client.py", line 542, in __call__ return client.invoke(args, kwargs) File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 602, in invoke result = self.send(soapenv) File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 649, in send result = self.failed(binding, e) File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 702, in failed r, p = binding.get_fault(reply) File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/bindings /binding.py", line 265, in get_fault raise WebFault(p, faultroot) suds.WebFault: Server raised fault: 'Server was unable to process request. ---> Object reference not set to an instance of an object.' 
+4
source share
2 answers

try using wirehark (or just debug) to capture the full request and response for the running Adobe Air Client. Then write down the request / response of the client that you created. Compare two queries and determine which objects you are not creating or adding to your client.

0
source

A problem with your code does not generate the Authentication header for your CheckIfAuthorized request, as required by the WSDL. Take a look at my answer to your other question, which contains a sample SOAP client created using foaming that adds the required header element to the request:

soap ui generated code

0
source

Source: https://habr.com/ru/post/1346367/


All Articles