title: zeep.exceptions.Fault - Invalid Enum Value | Python Zeep Enum Attribute Error
body: <pre><code>def generate_waybill(shipper, consignee, services, profile):
      success = True
  
      request = {
          &quot;Shipper&quot;: shipper,
          &quot;Consignee&quot;: consignee,
          &quot;Services&quot;: services
      }
  
      client = Client(url)
      
      res = client.service.GenerateWayBill(Request=request, Profile=profile)
      
      print(&quot;RESPONSE GENERATE WAYBILL: \n\n&quot;, res, res.json())
  
      if not res:
          success = False
  
      return res, success
  </code></pre>
  <p>While calling the <code>generate_waybill</code> function i get an execption from <code>zeep</code> &gt;&gt;&gt; 'Invalid enum value 'ProductType.Dutiables'</p>
  <p>In the services object it has a key named as <code>ProductType</code> and its Data Type <code>ProductType [Enumerator]</code> and the allowed values for this fields are <code>ProductType.Docs, ProductType.Dutiables</code>.</p>
  <p><code>The services object</code></p>
  <pre><code>services = {
      &quot;ProductCode&quot;: shipping_options['bluedart']['product_code'],
      &quot;ProductType&quot;: shipping_options['bluedart']['product_type'],
      &quot;PieceCount&quot;: return_request_line_items.all().count(),
      &quot;ActualWeight&quot;: weight,
      &quot;CreditReferenceNo&quot;: reference_id,
      &quot;PickupDate&quot;: timezone.now() + timezone.timedelta(days=2),
      &quot;PickupTime&quot;: '1052',
      &quot;RegisterPickup&quot;: True,
      &quot;IsReversePickup&quot;: True
  }
  </code></pre>
  <p>In the <code>&quot;ProductType&quot;:</code> field I have passed hard coded string value as <code>'ProductType.Dutiables'</code></p>
  <p>I have also tried creating a calss with Enum type like</p>
  <pre><code>from enum import Enum
  class ProductType(Enum):
      Dutiables = &quot;Dutiables&quot;
  </code></pre>
  <p>and used this as <code>ProductType.Dutiables</code> in the 'ProductType' field.</p>
  <p>But nothing seems to work for me. Please help!</p>
  <pre><code>zeep.exceptions.Fault: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:Request. The InnerException message was 'Invalid enum value 'ProductType.Dutiables' cannot be deserialized into type 'SAPI.Entities.Enums.AWBGeneration.ProductType'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'.  Please see InnerException for more details.
  </code></pre>