SOAP Request - Issue with the output format returned by the web service

I am trying to invoke a web service (XXXXXX.svc?wsdl) using SOAP Request activity. The web service accepts input and returns output as an object (custom data type, i.e. XML format).

I tried setting the following in the SOAP request activity.
End point:
Contract Name:
Method:
Parameters: I have defined a variable of type ‘Object’ and assigned the input values (i.e.XML tags) to the input parameter
Output: Defined a variable of Type String

When the XAML file is executed, the SOAP request is invoked and the output returned is just the namespace. The actual XML output is not appearing.

Please note that when the same SOAP request is tested using SOAP UI, it returns the output in XML format as expected.

When changing the Output variable type as Object, compilation error pops up. I believe SOAP request in UiPath stores the output only as String. But it does not store the entire XML output as string, and that is the problem.

Can you please suggest how to overcome the problem stated above ?

I have submitted a ticket for this issue as well.

I have been trying to figure out a work around or something, but no luck.

Has anyone been able to get SOAP Request to work correctly?

WSDL: http://ws.cdyne.com/phoneverify/phoneverify.asmx?wsdl
method: CheckPhoneNumber
params: PhoneNumber: 7575449510
LicenseKey: F01d89fd-5155-5455-5585-e84ab8de8591

UiPath returns: ws.cdyne.com.PhoneVerify.query.PhoneReturn

SOAPUI returns:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
  <CheckPhoneNumberResponse xmlns="http://ws.cdyne.com/PhoneVerify/query">
     <CheckPhoneNumberResult>
        <Company>Please Purchase a license key or email us for a test key.</Company>
        <Valid>false</Valid>
        <OriginalNumber>7575449510</OriginalNumber>
        <CleanNumber>7575449510</CleanNumber>
        <Wireless>false</Wireless>
     </CheckPhoneNumberResult>
  </CheckPhoneNumberResponse>
   </soap:Body>
</soap:Envelope>

Also the LicenseKey is optional, so leaving it blank in UiPAth results in an error:

“Exception has been thrown by the target of an invocation.”

leaving in blank in SOAPUI results in:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <CheckPhoneNumberResponse xmlns="http://ws.cdyne.com/PhoneVerify/query">
         <CheckPhoneNumberResult>
            <Company>LEVEL 3 COMMUNICATIONS. LLC -</Company>
            <Valid>true</Valid>
            <Use>Assigned to a code holder for normal use.</Use>
            <State>VA</State>
            <RC>PARKSLEY</RC>
            <OCN>8825</OCN>
            <OriginalNumber>7575449510</OriginalNumber>
            <CleanNumber>7575449510</CleanNumber>
            <SwitchName>NORFOLK</SwitchName>
            <SwitchType/>
            <Country>United States</Country>
            <CLLI>CHSKVAAYDS0</CLLI>
            <PrefixType>CLEC - (Competitive Local Exchange Carrier)</PrefixType>
            <LATA>252</LATA>
            <sms>CLEC - (Competitive Local Exchange Carrier)</sms>
            <Email/>
            <AssignDate>23/10/2005</AssignDate>
            <TelecomCity>Chesapeake</TelecomCity>
            <TelecomCounty/>
            <TelecomState>VA</TelecomState>
            <TelecomZip>23324</TelecomZip>
            <TimeZone>EST</TimeZone>
            <Lat/>
            <Long/>
            <Wireless>false</Wireless>
            <LRN>7576559199</LRN>
         </CheckPhoneNumberResult>
      </CheckPhoneNumberResponse>
   </soap:Body>
</soap:Envelope>

I am also having a similar issue. Provided Input via the Parameter property and created a String variable for output. When executing the SOAP request get the below error,

Yes, I have the same issue. It seems UiPath could only get the type of returned output…

Hi everyone,

SOAP activity not handling complex outputs is a known issue and will be addressed at one point (no specific ETA).

An alternative is to either use HTTP Request activity or to create a custom activity to perform the required SOAP request.

Is there any solution available now ?

1 Like

Hi @Ash

Welcome to our UiPath Forum! :slight_smile:

Yes! Well, kind of. The old activity for the SOAP request was not fixed, but a whole new functionality to consume SOAP and Swagger services was introduced.

See here for the official piece of documentation:

And here for my blog with an example on how to use it with Orchestrator Community Edition:

Hi, Is The old activity for the SOAP request fixed? It will be great if UI Path reads complex output

I believe the old activity to be a bit outdated by today’s standards. The library service approach (as explained above) is the recommended one for SOAP services.

Thanks for the reply. Requesting you to share library service approach some sample where request & response has complex object

@ramskothamasu

Sure, have a look at a sample project that uses some random free SOAP demo service:
https://www.crcind.com/csp/samples/SOAP.Demo.CLS

SampleLibraryProject.zip (4.2 KB)

Shared details are so helpful. Thank you so much. I am able to read parameters but unfortunately i am unable to read complex type (Output). I am getting error as below.

1 Like

I see.

It should work if you create an array of the type that I marked here:
image
(so not String[], but something like OSCPWSimpleService.CustIdInfo[]

I don’t think you need an array of arrays here.

If this works, you can start working on trying to cast your values to a string so that you can put it in the String Array.

It is always a bit tricky without having access to your IntelliSense hints, but the gist of it is that you will have to start with custom classes of your SOAP service and find a method in there that allows you to pull out simple strings (or other, more common types).