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 ?
<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! 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.
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.
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.
It should work if you create an array of the type that I marked here:
(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).
I need to print java:CustID & java:CustIDType values as mentionedin SOAP Response. This is what i am facing issue. As per wsdl file these two values stores in CustIdInfo Object as mentioned below:
The first step would be to find out how to navigate to the array directly from your output variable
With a simple Write line, try to ‘navigate’ to your array and count its records with a .Count.ToString.
When you get a count of array elements, you should be able to use the same syntax in the For Each loop (minus the .Count.ToString part) that has the argument set to the type you are iterating
(I can explain more when needed and when we get there)
I tried a bit more with the example SOAP service, see here: