Issue using a custom logic apps connector(SOAP) to wcf service

Rajesh Nerenki 1 Reputation point
2024-06-24T12:44:31.67+00:00

Hi

I'm trying to use the logic apps custom connector(SOAP) - https://learn.microsoft.com/en-us/connectors/custom-connectors/create-register-logic-apps-soap-connector

The wcf service is hosted on azure vm and is set up with basic authentication. There's only one operation to submit the details to SAP. I've imported the wsdl and I can see the request body and response body generated successfully from the wsdl. However when I try to call the connector from logic apps, I get internal server error. The vnet has been set up properly and I'm able to ping the host server from within logic apps(I used tcpping from kudu)

One issue I see is the webservice has a weird url for e.g. https://xyz.abc.az:1443/order/abc/data/200/abc123. When I import the wsdl, the basepath gets set up as "/" instead of the whole relative path. I tried amending the basePath in swagger editor, but that hasn't worked. The fazioservice example that is shown in the documentation has all the operations at the root of the service and hence works fine. I don't know if this is being the root cause.

I'm able to connect to the service using the HttpConnector by providing the full path to the service, passing the request body xml and using basic authentication. So I'm not sure why the SOAP connector doesn't work. I tried looking at the logs but doesn't see any exception details. Is there a way to turn on verbose logging? I've also tried using Postman sending the request body as xml and that too works. Any help highly appreciated

Thanks

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,957 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ganeshkumar R 265 Reputation points
    2024-06-24T13:47:57.7966667+00:00

    It sounds like you have a complex setup and you're encountering issues with the custom SOAP connector in Azure Logic Apps. Here are some detailed steps and suggestions to help you troubleshoot and resolve the issue:

    Step-by-Step Troubleshooting:

    1. Check the Base URL Configuration:
      • Ensure that the base URL is correctly configured in the custom connector. Since your URL includes a specific path (e.g., /order/abc/data/200/abc123), you need to ensure that the WSDL's service address is correctly specified.
      • You mentioned that the basePath gets set up as / instead of the whole relative path. Make sure to adjust this in the connector configuration.
    2. Modify the Swagger Definition:
      • You can manually edit the Swagger (OpenAPI) definition to ensure that the paths and operations are correctly defined. Use the Swagger Editor to load your definition and ensure that the paths are accurate.
      • For example:
        
             paths:
        
               /order/abc/data/200/abc123:
        
                 post:
        
                   ...
        
        
    3. Authentication Configuration:
      • Since your service uses basic authentication, double-check that the credentials are correctly configured in the custom connector.
      • Verify that the authentication headers are being correctly sent in the request.
    4. Enable Detailed Logging:
      • Unfortunately, Logic Apps do not have a built-in feature for verbose logging for custom connectors. However, you can add logging within your workflow to log request and response details.
      • Consider using an HTTP connector before and after the SOAP connector to log request and response details.
    5. Test with HTTP Connector:
      • Since you mentioned that the HTTP connector works, compare the request details (headers, body, URL) between the HTTP connector and the SOAP connector.
      • Ensure that the SOAP connector is sending the request in the same format as the HTTP connector.
    6. Use Postman for Testing:
      • Continue to use Postman to test your SOAP requests. Verify the exact request details and compare them with what is being sent by the Logic Apps custom connector.
    7. Review Network Configuration:
      • Ensure that all necessary network configurations, such as VNET and firewall rules, are correctly set up and that there are no network issues preventing the Logic App from reaching the service.

    Example of Swagger Definition for Custom Connector:

    Here is an example of how you might define the path in your Swagger definition:

    
    swagger: '2.0'
    
    info:
    
      title: Your Connector
    
      description: SOAP Custom Connector
    
      version: '1.0'
    
    host: xyz.abc.az:1443
    
    basePath: /order/abc/data/200
    
    schemes:
    
      - https
    
    paths:
    
      /abc123:
    
        post:
    
          summary: Your Operation
    
          description: Operation description
    
          operationId: SubmitDetails
    
          consumes:
    
            - application/soap+xml
    
          produces:
    
            - application/soap+xml
    
          parameters:
    
            - name: body
    
              in: body
    
              required: true
    
              schema:
    
                $ref: '#/definitions/RequestBodySchema'
    
          responses:
    
            '200':
    
              description: Successful response
    
              schema:
    
                $ref: '#/definitions/ResponseBodySchema'
    
    definitions:
    
      RequestBodySchema:
    
        type: object
    
        properties:
    
          # Define your request body schema
    
      ResponseBodySchema:
    
        type: object
    
        properties:
    
          # Define your response body schema
    
    

    Additional Resources:

    Contact Microsoft Support:

    If you continue to experience issues, consider reaching out to Microsoft support for more detailed assistance. Provide them with the exact error messages, logs, and configuration details you have.

    By carefully reviewing and adjusting the configuration, you should be able to resolve the issue with the SOAP connector in Azure Logic Apps.

    0 comments No comments

  2. Rajesh Nerenki 1 Reputation point
    2024-06-26T09:57:55.4833333+00:00

    Hi Ganesh

    Thanks for looking. I've already tried updating swagger with the base path and that hasn't worked. I've mentioned the Http connector works fine and the payload is an xml, header content-type set to xml. There's not enough documentation provided on setting up the custom connector and the suggestions provided above is what I've already tried. I'd like to know if there's a way to find the detailed error message from logic apps error logs. I've copied the wsdl and client config with dummy values if that helps

    <wsdl:message name="MyOrderService_InputMessage">
    	<wsdl:part name="parameters" element="tns:submitOrderDetails"/>
    </wsdl:message>
    <wsdl:message name="MyOrderService_OutputMessage">
    	<wsdl:part name="parameter" element="tns:submitOrderDetailsResponse"/>
    </wsdl:message>
    <wsdl:portType name="MyOrderService">
    	<wsdl:operation name="submitOrder">
    		<wsdl:input message="tns:MyOrderService_InputMessage"/>
    		<wsdl:output message="tns:MyOrderService_OutputMessage"/>
    	</wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="MyOrder_basic" type="tns:MyOrderService">
    	<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    	<wsdl:operation name="submitOrder">
    		<soap:operation style="document"/>
    		<wsdl:input>
    			<soap:body use="literal"/>
    		</wsdl:input>
    		<wsdl:output>
    			<soap:body use="literal"/>
    		</wsdl:output>
    	</wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="MyOrder_soap12" type="tns:MyOrderService">
    	<wsoap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    	<wsdl:operation name="submitOrder">
    		<wsoap12:operation style="document"/>
    		<wsdl:input>
    			<wsoap12:body use="literal"/>
    		</wsdl:input>
    		<wsdl:output>
    			<wsoap12:body use="literal"/>
    		</wsdl:output>
    	</wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="OrderService">
    	<wsdl:port name="MyOrder_basic" binding="tns:MyOrder_basic">
    		<soap:address location="https://xyz.abc.az:1443/order/abc/data/200/abc123"/>
    	</wsdl:port>
    	<wsdl:port name="MyOrder_soap12" binding="tns:MyOrder_soap12">
    		<wsoap12:address location="https://xyz.abc.az:1443/order/abc/data/200/abc123"/>
    	</wsdl:port>
    </wsdl:service>
    
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    	<startup>
    		<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
    	</startup>
    	<system.serviceModel>
    		<bindings>
    			<basicHttpBinding>
    				<binding name="MyOrder_basic">
    					<security mode="Transport" />
    				</binding>
    			</basicHttpBinding>
    			<customBinding>
    				<binding name="MyOrder_soap12">
    					<textMessageEncoding messageVersion="Soap12" />
    					<httpsTransport />
    				</binding>
    			</customBinding>
    		</bindings>
    		<client>
    			<endpoint address="https://xyz.abc.az:1443/order/abc/data/200/abc123"
                    binding="basicHttpBinding" bindingConfiguration="MyOrder_basic"
                    contract="MyOrderService" name="MyOrder_basic" />
    			<endpoint address="https://xyz.abc.az:1443/order/abc/data/200/abc123"
                    binding="customBinding" bindingConfiguration="MyOrder_soap12"
                    contract="MyOrderService" name="MyOrder_soap12" />
    		</client>
    	</system.serviceModel>
    </configuration>
    
    
    0 comments No comments