Error consuming a Soap Webservice from an extension

Error consuming a Soap Webservice from an extension

  

Hi all,

I have this issue trying to consume a SOAP webservice so I decided to import it to an extension following this tutorial from OS.

Everything went well until I tried to consume a method in runtime when the attached error appear.

Anyone has any idea what can be causing this error? Is the first time I'm using an webservice through an extension so maybe I missed some steps or configurations...


Thanks in advance for your help.


Cheers


Hi Gonçalo,

That will be difficult to troubleshoot remotely, but it seems that the endpoint that you are using does not mach the webservice definition (WSDL), or either you are not using or passing the correct attributes for the method invocation.


Hope it helps you.

Best regards.

Daniel Martins.

Hello Gonçalo

By the error message, it looks like you are getting an error while instantianting the proxy class of the SOAP service because it tries to read some settings from the app.config file and that is not supported with extensions.

First make sure you are trying to consume the SOAP service using 'Add Web Reference...' instead of 'Add Service Reference...' which uses WCF. For that you have to click on 'Add Service Reference...' but then select the 'Advanced' button.

If that doesn't solve the problem or you need to use WCF, you'll need to replicate the XML service configurations (probably bindings) in code; most of the times it's simple are there's information online on how to do that.

Hope this helps.

Pedro Guimarães