Hello,
I created a custom connector that sends a request to a SOAP Web Service.
For this reason I created two input parameters, a SOAPAction parameter that will contain the action to execute on the server, and the body that contains the actual xml string. I can correctly use the connector from Postman, and from the Connector's Test Tab, and I receive an xml string in response.
When calling the connector directly from powerapps, using
CustomConnector.Action({SOAPAction: "soapAction", body: xmlString})
nothing works anymore. I receive a "500 Internal Server Error" without any error message. The request seen from the PowerApp Monitor Tool is correct:
and if I copy the exact same request and insert it into Postman, it works without any issue.
In order to debug further, I created a flow that calls the custom connector's action, and it works as expected.
So the question is, has anyone any idea whatsoever about why the whole thing is behaving this way? I have been trying everything I know, including monitoring the request from Developer Tools, and it returns a "SOAP message is invalid!" error, even though the request's headers and body contain the correct data.
Any help would be greatly appreciated, thanks in advance.
Have a nice day!
Hello @muralidharan,
unfortunately, the usage of a flow demands more execution time, making the app slower. Since I do not need to make any other operation that may require a flow, I just need to forward the request and receive the response within PowerApps, I think using flows would be an overkill.
Also flows have limited executions capabilities, and since we cannot afford for the app to stop working because too many flows are called, their usage is greatly discouraged.
Is there any way to tell PowerApps to correctly pass a raw string in the request body without applying any transformation to it?
Any help will be very much appreciated, thanks,
have a nice day.
As you said, it is working fine from Flow, try to call the flow from Power Apps and hopefully that should solve your issue now.
Hope this helps.
Thanks,
Murali
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up,
Hello @muralidharan and thanks for taking the time to read and reply.
The xmlString is correctly passed to the Custom Connector and no extra characters are added.
However your suggestion made me think and I have the suspicion that, while I am able to send a raw XML string from Postman and Flow, thus receiving the correct response from the server, that might not be the case for PowerApps. In particular, i think the string is sent to the connector as a JSON string (encapsulated between " ") and not as a raw string, that might be why the server responds with an Error 500.
Apparently, there is no way to set the content-type, even providing it as a parameter in the swagger is not working.
If anyone has any suggestions they would be very welcome.
Thanks again, and have a nice evening.
Just a thought.
Have you compared the SOAP message from Power Apps and Power Automate ?
Does Power Apps added any extract character or encoded any characters in the XML ?