Commits

Daniel Holth committed 943cb47

fix path error

Comments (0)

Files changed (1)

ewsclient/__init__.py

     def loaded(self, ctx):
         """Add missing service."""
         urlprefix = urlparse.urlparse(ctx.url)
-        service_url = urlparse.urlunparse(urlprefix[:2] + ('Exchange.asmx', '', '', ''))
-        servicexml = '''  <wsdl:service name="ExchangeServices">
+        service_url = urlparse.urlunparse(urlprefix[:2] + ('/EWS/Exchange.asmx', '', '', ''))
+        servicexml = u'''  <wsdl:service name="ExchangeServices">
     <wsdl:port name="ExchangeServicePort" binding="tns:ExchangeServiceBinding">
       <soap:address location="%s"/>
     </wsdl:port>
   </wsdl:service>
 </wsdl:definitions>''' % service_url
-        ctx.document = ctx.document.replace('</wsdl:definitions>', servicexml)
+        ctx.document = ctx.document.replace('</wsdl:definitions>', servicexml.encode('utf-8'))
         return ctx
 
 # Otherwise suds will try, and often fail, to download this document.