python-zeep icon indicating copy to clipboard operation
python-zeep copied to clipboard

[4.2.1] Validation Error Exception

Open ThomasGessert opened this issue 3 years ago • 3 comments

I need to access this SOAP API:

  • https://bipro-bipro.cora.vema-test.de/va/TransferService_2.6.1.1.0?wsdl

The problematic part is the tag 'ns8:Requests' that is part of the body of the listShipments and getShipment services.

Those WSDL should be o.k. as SoapUI 5.7.2 can generate new (and working) requests from them.

Whenever I try to submit a request I'm getting a Validation Error exception 'Missing element Request (listShipments.Request)'.

I tried several variants:

  • building the request myself and used client.service.(_soapheaders=[request]) -> Validation Error
  • using client1.get_type('ns8:listShipments') method -> results in Lookup Error
  • using client1.get_type('ns8:CT_ListShipments') -> works for for building the request, but Validation Error later

Disabling strict mode didn't help. For now I'm using the work-around to build the request with zeep and then posting it via requests.

Is there an option to disable validation for a request?

ThomasGessert avatar Nov 20 '23 16:11 ThomasGessert

@ThomasGessert have you found a solution to this in the meantime?

Roritharr avatar Apr 19 '25 15:04 Roritharr

Well, its some time since I was working on this project so I had to look into the code again.

Yes, but not using only zeep. SoapUI provided me examples how to format the requests based on the WDSL and then I used a combination of zeep (for the connection) and lxml to build the requests in a handcrafted way. Not the most elegant solution but its working.

Because there is no newer version of zeep I didn't try again if the error persists.

ThomasGessert avatar May 02 '25 14:05 ThomasGessert

Thank you so much for the reply! Saves me a ton of trial & error!

Roritharr avatar May 02 '25 14:05 Roritharr