Skip to main content

Notifications

Power Automate - Connector Development
Unanswered

[BUG] Custom Connector returning error 500 when directly called from PowerApp

(0) ShareShare
ReportReport
Posted on by 39

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:

DennisPreatto_0-1663079504241.png

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!

Categories:
  • DennisPreatto Profile Picture
    DennisPreatto 39 on at
    Re: [BUG] Custom Connector returning error 500 when directly called from PowerApp

    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.

  • Muralidharan Profile Picture
    Muralidharan 340 on at
    Re: [BUG] Custom Connector returning error 500 when directly called from PowerApp

    @DennisPreatto ,

    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,

     

  • DennisPreatto Profile Picture
    DennisPreatto 39 on at
    Re: [BUG] Custom Connector returning error 500 when directly called from PowerApp

    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.

  • Muralidharan Profile Picture
    Muralidharan 340 on at
    Re: [BUG] Custom Connector returning error 500 when directly called from PowerApp

    @DennisPreatto ,

    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  ?

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,495

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,822

Leaderboard

Featured topics