Compilation error when trying to consume a DotNet webservice

Hi all,


I am trying to build a new module in OutSystems that consumes an existing DotNet webservice.

I created a soap integration by referencing to the url of the webservice.

Implementation looks fine, but when I try to publish the application I get the following error (this is an extract of the complete error):


Compilation Error.
CustomClients\Declareren\CcDeclareren.cs(570,51): error CS0234: The type or namespace name 'ServiceModel' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
public interface NotaAppChannel : NotaApp, System.ServiceModel.IClientChannel
CustomClients\Declareren\CcDeclareren.cs(576,45): error CS0234: The type or namespace name 'ServiceModel' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
public partial class NotaAppClient : System.ServiceModel.ClientBase, NotaApp
CustomClients\Declareren\CcDeclareren.cs(610,18): error CS0234: The type or namespace name 'Runtime' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
using System.Runtime.Serialization;
CustomClients\Declareren\CcDeclareren.cs(643,53): error CS0234: The type or namespace name 'Runtime' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
public partial class Exception : object, System.Runtime.Serialization.ISerializable
CustomClients\Declareren\Structures.STSendAccidentReportMessageStructure.cs(1069,14): error CS0234: The type or namespace name 'IO' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
using System.IO;

etc....

CustomClients\Declareren\CcDeclareren.cs(449,13): error CS0234: The type or namespace name 'Xml' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
[System.Xml.Serialization.XmlIgnoreAttribute()]
CustomClients\Declareren\CcDeclareren.cs(449,13): error CS0234: The type or namespace name 'Xml' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
[System.Xml.Serialization.XmlIgnoreAttribute()]
CustomClients\Declareren\CcDeclareren.cs(81,9): error CS0234: The type or namespace name 'CodeDom' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
[System.CodeDom.Compiler.GeneratedCodeAttribute("CompilerService", "11.0.424.0")]
CustomClients\Declareren\CcDeclareren.cs(81,9): error CS0234: The type or namespace name 'CodeDom' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
[System.CodeDom.Compiler.GeneratedCodeAttribute("CompilerService", "11.0.424.0")]
CustomClients\Declareren\CcDeclareren.cs(82,9): error CS0234: The type or namespace name 'SerializableAttribute' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
[System.SerializableAttribute()]
CustomClients\Declareren\CcDeclareren.cs(82,9): error CS0234: The type or namespace name 'SerializableAttributeAttribute' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
[System.SerializableAttribute()]

etc...

CustomClients\Declareren\CcDeclareren.cs(532,9): error CS0234: The type or namespace name 'CodeDom' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
CustomClients\Declareren\CcDeclareren.cs(532,9): error CS0234: The type or namespace name 'CodeDom' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
CustomClients\Declareren\CcDeclareren.cs(533,9): error CS0234: The type or namespace name 'ServiceModel' does not exist in the namespace 'ssNotaApp_CIS.System' (are you missing an assembly reference?)
[System.ServiceModel.MessageContractAttribute(IsWrapped=false)]


etc...


If I do the same thing with another webservice than I don't have a problem publishing the module. So it looks to me there is something in my wsdl that OutSystems does not like.


Does anyone have a clue why the compilation is failing, and how to fix this? 


Hope someone has an answer that helps me,

Robert


Does the SOAP API have a very complex parameter structure? That usually causes a problem as OutSystems does not seem to handle that very well.

The workaround is generally to consume the SOAP service in an extension and use the extension in your OutSystems application.

Hanno wrote:

Does the SOAP API have a very complex parameter structure? That usually causes a problem as OutSystems does not seem to handle that very well.

The workaround is generally to consume the SOAP service in an extension and use the extension in your OutSystems application.


Thanks Hanno for your reply.

To me the SOAP API does not seem very complex. I already stripped must function to see if I could narrow the problem, so far not successfull.

I also read about problems with complex parameter structure in the OutSystems documentation, but for what I read in the documentation that would give other problems.

I think I will try to strip my webservice even further, hope I find a point where it does compile with OutSystems.


If you want/can, share the URL with me in a private message and I can look into it from my side?

Hanno wrote:

If you want/can, share the URL with me in a private message and I can look into it from my side?

Thanks for the offer, but problem is that it is not a public url. 


No worries. Hope you manage to sort it out. Let me know if I can help in any other way.

Can you consume the API through Postman (or similar)?

Solution

Hanno wrote:

If you want/can, share the URL with me in a private message and I can look into it from my side?

I was able to find the line of code in the webservice that is causing the compile problem.

If I remove the FaultContract line than the code compiles in OutSystems.


    public interface IDeclareren

    {

        [OperationContract]

        [FaultContract(typeof(ArgumentException))]

        SendAccidentReportResult SendAccidentReport(int sendAccidentMessage);

    }

It looks like OutSystems can't handle the way we have set up the security in this webservice.

I am afraid I have to make changes to my webservice.

Solution

Hmmm. Not ideal, but glad you at least found the problem. Good luck!