Package org.apache.soap.rpc

Examples of org.apache.soap.rpc.Response


     *                   will be raw XML
     */
    public void fireAsyncResponse(Object response) throws WSIFException {
        Trc.entry(this, response);

        Response resp = deserialiseResponseObject(response);

        WSIFMessage outMsg = createOutputMessage();
        WSIFMessage faultMsg = createFaultMessage();
        buildResponseMessages(resp, outMsg, faultMsg);

View Full Code Here


        WSIFMessage output,
        WSIFMessage fault)
        throws WSIFException {
        Trc.entry(this, response, output, fault);

        Response resp = deserialiseResponseObject(response);
        boolean ok = buildResponseMessages(resp, output, fault);

        Trc.exit( ok );
        return ok;
    }
View Full Code Here

            // Unmarshall the response envelope.
            Envelope respEnv = Envelope.unmarshall(payload, respCtx);

            // Extract the response from the response envelope.
            Response resp = Response.extractFromEnvelope(respEnv, smr, respCtx);

            return resp;

        } catch (Exception ex) {
            Trc.exception(ex);
View Full Code Here

        setTransportContext(st);

        setCallContext(call);

        // invoke the operation through ApacheSOAP
        Response resp;
        boolean respOK = true;
        URL locationUri = portInstance.getEndPoint();
        if ( locationUri != null && !isHostInNonProxyProperty( locationUri ) ) {
           setSOAPProxy( st );
        }

        Trc.event(
            this,
            "Invoking operation ",
            getName(),
            " on ",
            locationUri,
            " call object ",
            call);

        try {
            resp = call.invoke(locationUri, getSoapActionURI());
        } catch (SOAPException e) {
            Trc.exception(e);

            // Log message
            MessageLogger.log("WSIF.0005E", "ApacheSOAP", getName());

            throw new WSIFException(
                "SOAPException: " + e.getFaultCode() + e.getMessage(),
                e);
        }

        Trc.event(this, "Operation returned ", resp);

        // setJMSOutPropsInContext( st ); TODO doesn't work yet

        if (!isAsyncOperation() && returnType != null) {
            respOK = buildResponseMessages(resp, output, fault);
        }
       
        if (resp instanceof Response) {
            Header soapHeader = resp.getHeader();
           addContextResponseSOAPHeaders(soapHeader);
        }

        Trc.exit(respOK);
        return respOK;
View Full Code Here

    params.add(new Parameter("map", Hashtable.class, h, null));
    sendCall.setParams(params);

    // Sending the request, checking the reply:
    try {
      Response resp = sendCall.invoke(serviceUrl,"");

      // Check the response.
      if (resp.generatedFault ()) {
        throw new IllegalStateException("The SOAP service failed to process"
                                        + " the call: "
                                        + resp.getFault().getFaultString());
      }
    } catch (SOAPException exc) {
      throw new IllegalStateException("The SOAP call failed: "
                                      + exc.getMessage());
    }
View Full Code Here

    }
    long currentTime;
    long nextSleep = 2000;
    boolean tryAgain;
    int attemptsC = 0;
    Response resp;
    String error;

    try {
      serviceUrl = new URL("http://"
                           + factParams.getHost()
                           + ":"
                           + factParams.getPort()
                           + "/soap/servlet/rpcrouter");
    }
    catch (MalformedURLException exc) {}

    // Building the Call object for checking the user's identification:
    Call checkCall = new Call();
    checkCall.setTargetObjectURI("urn:ProxyService");
    checkCall.setMethodName("setConnection");
    checkCall.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

    Vector params = new Vector();
    Hashtable h;
    try {
      h = identity.soapCode();
    } catch (IOException e) {
      throw new JMSException("EXCEPTION:: connect identity.soapCode(): " + e.getMessage());
    }
    params.add(new Parameter("identityMap", Hashtable.class, h, null));
    params.addElement(new Parameter("timeout",
                                    Integer.class,
                                    new Integer(factParams.cnxPendingTimer),
                                    null));

    checkCall.setParams(params);

    while (true) {
      tryAgain = false;
      attemptsC++;
      error = null;

      try {
        resp = checkCall.invoke(serviceUrl,"");

        // SOAP sends a fault back: the service is possibly not started or
        // not running.
        if (resp.generatedFault ()) {
          error = resp.getFault().getFaultString();
          tryAgain = true;
        }
        // RPC call worked:
        else {
          Integer result = (Integer) resp.getReturnValue().getValue();

          // The returned value is either the key of the connection, or -1
          // if the user is invalid:
          if (result.intValue() == -1) {
            throw new JMSSecurityException("Can't open the connection with"
View Full Code Here

    Vector params = new Vector();
    params.addElement(new Parameter("name", String.class, identity.getUserName(), null));
    params.addElement(new Parameter("cnxId", int.class, new Integer(cnxId), null));   
    receiveCall.setParams(params);
   
    Response resp = null;
    AbstractJmsReply reply = null;
   
    try {
      resp = receiveCall.invoke(serviceUrl, "");
    } catch (SOAPException exc) {
      throw new IOException("The SOAP call failed: " + exc.getMessage());
    }

    if (resp.generatedFault()) {
      throw new IOException("The SOAP service failed to process the call: "
                            + resp.getFault().getFaultString());
    }  
   
    try {
      Hashtable h = (Hashtable) resp.getReturnValue().getValue();
      reply = (AbstractJmsReply) AbstractJmsMessage.soapDecode(h);
    } catch (Exception exc) {
      throw new IOException(exc.getMessage());
    }
View Full Code Here

    * desc: the results of the service request
    *       must be cast by caller
    */
    public Object processRequest(String url) throws SOAPException {
        // create soap response
        Response response = null;
        Object result = null;
        try {
            request.setParams(parameters);
            response = request.invoke(new java.net.URL(url), "");
            // verify result
            if (response.generatedFault() == true ) {
                    logger.warn(response.getFault().getFaultString());
            }
            else {
            /* get result as object
              * caller must cast result to proper type
              */
                result = response.getReturnValue().getValue();
                // if logging enabled, output response
                if (logger.isDebugEnabled()) {
                    logger.debug(response.getReturnValue().toString());
                }
            }
        }
        catch (java.net.MalformedURLException exception) {
            // if logging enabled output exception
View Full Code Here

    * desc: the results of the service request
    *       must be cast by caller
    */
    public Object processRequest(String url) throws SOAPException {
        // create soap response
        Response response = null;
        Object result = null;
        try {
            request.setParams(parameters);
            response = request.invoke(new java.net.URL(url), "");
            // verify result
            if (response.generatedFault() == true && loggingEnabled == true) {
                    log.warn("system", response.getFault().getFaultString());
            }
            else {
            /* get result as object
              * caller must cast result to proper type
              */
                result = response.getReturnValue().getValue();
                // if logging enabled, output response
                if (loggingEnabled == true) {
                    log.debug("debug", response.getReturnValue().toString());
                }
            }
        }
        catch (java.net.MalformedURLException exception) {
            // if logging enabled output exception
View Full Code Here

TOP

Related Classes of org.apache.soap.rpc.Response

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.