Topic Options
#55450 - 11/03/17 11:11 AM Return error from a SOAP process
joersmith Offline
OL Expert

Registered: 08/31/06
Posts: 163
Loc: Mount Laurel, New Jersey
What is the best way to return an error to an application from a Planet Press SOAP Workflow? It is a SubmitJob input that has two main branches with a number of different objects in each.

I need to send an error back if processing fails on one of the branches and also if both branches fail to process.

The intent is for output to be created from an XML file submitted to the Soap process and then printed to a printer. The only thing intended to be returned to the application is a success or failure.

For instance, right now if both branches return false the XML that was submitted is returned to the application with a success message.

Top
#55462 - 11/06/17 08:27 AM Re: Return error from a SOAP process [Re: joersmith]
joersmith Offline
OL Expert

Registered: 08/31/06
Posts: 163
Loc: Mount Laurel, New Jersey
Additional info:

In case I was not clear what I am trying to do is set the SubmitSuccess and Submit Message field that are returned under TSubmitJobResult. Here is a sample response:

SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:NS2="urn:RemoteTypeCls">
<NS1:SubmitJobResponse xmlns:NS1="urn:soapActIntf-ISoapAct">
<return href="#1"/>
</NS1:SubmitJobResponse>
<NS2:TSubmitJobResult id="1" xsi:type="NS2:TSubmitJobResult">
<SubmitSuccess xsi:type="xsd:int">-1</SubmitSuccess>
<SubmitMessage xsi:type="xsd:string">SubmitJob:Unknown process name</SubmitMessage>
<SubmitJobInfStruc xsi:nil="true"/>
<SubmitResultFile xsi:nil="true"/>
</NS2:TSubmitJobResult>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Thanks!

Top
#55464 - 11/06/17 10:33 AM Re: Return error from a SOAP process [Re: joersmith]
joersmith Offline
OL Expert

Registered: 08/31/06
Posts: 163
Loc: Mount Laurel, New Jersey
Additional Info:

I have tried setting a variable in the request which I then set in the workflow. Setting this variable is the last action in the workflow. Yet the response comes back with this variable blank.

Top
#55470 - 11/07/17 12:35 PM Re: Return error from a SOAP process [Re: joersmith]
joersmith Offline
OL Expert

Registered: 08/31/06
Posts: 163
Loc: Mount Laurel, New Jersey
Resolved the issue myself with some testing. It all comes down to Syntax. I had the variables defined in the SOAP call and in the workflow. However, they were defined like so:

<VariableName xsi:type="xsd:string">InputDataError</VariableName>

It appears that they must be defined as follows in order to receive the value from Workflow:

<VariableName xsi:type="xsd:string">%{InputDataError}</VariableName>

Thanks!

Top