Consuming WCF Webservice

Hello,

I’m trying to consume a WCF Web service published and working fine as we have tested it from other applications.

I have created the service into a library, and invoke the webservice code and everything looks fine, (imported methods, variables, …) but when I try to run the process I always get the same error:
“Could not find default endpoint element that references contract ‘IServiceEnviarEmail’ in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.”

As far as I know, in a C# application, we only need to add the binding and client section into system.service model section of app.config file, but in UiPath, I don’t know here should I have to add this info.

Is there any other way to add the info of the endpoint to the library?

Thanks in advance.

Greetings.

1 Like

You have connected WCF service into a uipath library & then invoked it in code?

But still it’s not working due to above issue right ?

Thanks
#nK

That’s right. Do you need further information?

Thanks

1 Like

Yes please…

I have added the WCF service as a Service in my library. Everyhing looks fine, as I can use the code to invoke the cliente of this web service.
When I try to run the UiPath application, I receive the mentioned error as it cannot find the endpoint of the service, what makes nonsense, because I can use the client and it’s correctly added to the library, so the endpoint is ok.

In c#, for example, this error happens when you haven’t defined the URL address in the app.config of your project, but, I don’t know if I need to do anything else in the library.

Thanks.

1 Like

I hope you are using the right endpoint function.

And is the same getting connected and running using a c# app ?

Yes, the endpoint is correct, and I am using it from differents applications. I think that maybe I need to add the endpoint in a config file, but I don’t know which one.

Greetings.

1 Like

No nothing like that. Is this a public service or private ?

It’s a private service, but it is accessible from our server, and I have no problems to add it to the project. The problem happens when I run the project

1 Like

Is it possible to share your project here as a zip. Will try to troubleshoot it.

If it’s not a confidential data.

Thanks
#nK

No problem, but you won’t be able to use the wcf service, but as far as I know, you should receive a different response (maybe a timeout instead of the error I mentioned)

But I cannot add attachments, as I am a “new user”

1 Like

Yes that’s fine but just to check the setup.

Sorry, but it looks that I’m not allowed to upload files…

1 Like

Okay. If any screenshots are also fine. Let’s see if we can troubleshoot.

Sure, this is the Service Definition:

1 Like

And how I try to Invoke the client code:


All the Webservice parameters are passed as arguments

1 Like

SendMailByRelay.zip (29.0 KB)

1 Like

I tell a mate to upload it from another account with privileges. So SendMailByRelay.zip is the zip with the project.

Thanks in advance.

Greetings

1 Like

I’m not sure why this invoke code is being called.

Kindly check the activities panel after importing wsdl. You should find your endpoints as activities in the activities panel.

Then you can please use it.

Check this please.

#nK

Thanks for the response.
I see the activities, but it looks like the contract has been read as a generic webservice, so I cannot invoke it with a string for example:

In the screenshot, Request accespts only a EnviarEmailRequest type, so if I want to create that object, I would need to invoke code.

If there is another way, please tell me.
In the next post I will show you the activity

1 Like