How to define fault message?

Help
2009-03-23
2013-06-06
  • Jonas Silveira
    Jonas Silveira
    2009-03-23

    How do I define a "fault message" to an operation (or to all operarions)?

    When I register a function, I don't have this option.

      <operation name='testConnection' parameterOrder='testConnection'>
       <input message='tns:IPartnerServiceWS_testConnection'/>
       <output message='tns:IPartnerServiceWS_testConnectionResponse'/>
       <fault message='tns:LogisticsManagerWSException' name='LogisticsManagerWSException'/>
      </operation>

    Thanks,
    Jonas

     
    • Fred
      Fred
      2009-04-25

      Have you tried to use the "soap_fault" class?

      Or you can do something like

      function IPartnerServiceWS_testConnection ($values,$error='') {
          $response = array(
              'output1' => $values[0],
              'output2' => $values[1],
              'faultcode' => $error
          );
          return $response;
      }

      Making the client use the "faultode" response to parse the error.