Trying to consume a soap for a client project's provider. They sent us the location of the wsdl and the definitions of their API. 

I can use SoapUI to test the thing, and it returns no error code and a token. Which is expected behaviour. With OutSystems, tried on 10 and 11, and the API returns an error code.

I managed to capture the xml's sent and I see a difference in the way OutSystems writes it:

Attached a file with the xmls from each.


Is this an issue on our end, on theirs...?

Mariano Picco wrote:

Trying to consume a soap for a client project's provider. They sent us the location of the wsdl and the definitions of their API. 

I can use SoapUI to test the thing, and it returns no error code and a token. Which is expected behaviour. With OutSystems, tried on 10 and 11, and the API returns an error code.

I managed to capture the xml's sent and I see a difference in the way OutSystems writes it:

Attached a file with the xmls from each.


Is this an issue on our end, on theirs...?


If the service, return OK. 

So probable the error happen in the server which you send the request. 

Suellington Gomes wrote:

Mariano Picco wrote:

Trying to consume a soap for a client project's provider. They sent us the location of the wsdl and the definitions of their API. 

I can use SoapUI to test the thing, and it returns no error code and a token. Which is expected behaviour. With OutSystems, tried on 10 and 11, and the API returns an error code.

I managed to capture the xml's sent and I see a difference in the way OutSystems writes it:

Attached a file with the xmls from each.


Is this an issue on our end, on theirs...?


If the service, return OK. 

So probable the error happen in the server which you send the request. 

Well, it doesn't seem to be the case, since the server does reply with the correct information when queried with SoapUI. The server replies to both requests, but the one sent from Outsystems is not to its liking and returns an error code.


Can you attach the error that is being sent in OutSystems?

There's no actual error on Outsystems. The API replies with an error code as if the information was not correctly provided to achieve authentication. If you check the XML I attached to the original post, that's the info I'm sending in. With SoapUI, it returns a proper token, and no error code. With OS, it returns an error code and no token. 


I can see a slight difference between the syntax of the XML between Os and SoapUI, but can't figure out why it's being rejected if the SoapUI one isn't.


Attached the complete log from Service Center

Solution

Okay, found the issue.
I built this simple screen to test the SOAP API, with the corresponding local variables being used in the action as shown: 


The problem is:

If you leave the Referrer field blank, Outsystems flat out removes it from the XML, which is just not what you should do on a SOAP Request, the structure should be kept as is, blank is blank, sure, not removal of a field.

Without setting the Referrer field: 

After setting the referrer field (this case used www.microsoft.com as an example, but also tested with a single space character):


I don't know whether to call it a bug, or an overlook, at the least something to be aware of. 

Solution

Hi Mariano,

If you want to send the referrer field even when it's empty you should change the "Send Default Value"  to yes for the referrer field.

Otherwise it will not be sent when you have the default value (which is "" for text field).


Regards,

Paulo Jadaugy

Paulo Jadaugy wrote:

Hi Mariano,

If you want to send the referrer field even when it's empty you should change the "Send Default Value"  to yes for the referrer field.

Otherwise it will not be sent when you have the default value (which is "" for text field).


Regards,

Paulo Jadaugy


Thanks, that is helpful. Didn't even know this setting existed, and it's really obscure. 

I don't see where this setting would be turned off, which it is by default, what's the benefit of not sending the <Referrer></Referrer> tags? Because not sending them took a day of searching why this simple request was failing.

Mariano Picco wrote:

Paulo Jadaugy wrote:

Hi Mariano,

If you want to send the referrer field even when it's empty you should change the "Send Default Value"  to yes for the referrer field.

Otherwise it will not be sent when you have the default value (which is "" for text field).


Regards,

Paulo Jadaugy


Thanks, that is helpful. Didn't even know this setting existed, and it's really obscure. 

I don't see where this setting would be turned off, which it is by default, what's the benefit of not sending the <Referrer></Referrer> tags? Because not sending them took a day of searching why this simple request was failing.


I'm not sure why it's like that, but one of the points I can think of is that since there's no real value, it doesn't "need" to be sent and this way it's lowering the size of the envelope that needs to be sent to the API.

Which can be useful when dealing with a lot of values.