juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svi...@apache.org
Subject cvs commit: ws-juddi/src/java/org/apache/juddi/proxy AxisTransport.java Transport.java
Date Tue, 01 Feb 2005 13:24:36 GMT
sviens      2005/02/01 05:24:36

  Modified:    src/java/org/apache/juddi/proxy AxisTransport.java
                        Transport.java
  Log:
  Added "String send(String,URL) method to the jUDDI Proxy interface and an implementation
to the AxisTransport per request from the Scout project team.
  
  Revision  Changes    Path
  1.6       +42 -0     ws-juddi/src/java/org/apache/juddi/proxy/AxisTransport.java
  
  Index: AxisTransport.java
  ===================================================================
  RCS file: /home/cvs/ws-juddi/src/java/org/apache/juddi/proxy/AxisTransport.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AxisTransport.java	1 Feb 2005 02:52:03 -0000	1.5
  +++ AxisTransport.java	1 Feb 2005 13:24:36 -0000	1.6
  @@ -80,4 +80,46 @@
   
       return response;
     }
  +  
  +  public String send(String request,URL endpointURL)
  +    throws RegistryException
  +  {    
  +    Service service = null;
  +    Call call = null;
  +    String response = null;
  +
  +    log.debug("\nRequest message:\n" + request);
  +
  +    try {
  +        
  +      service = new Service();
  +      call = (Call)service.createCall();
  +      call.setTargetEndpointAddress(endpointURL);
  +    
  +      SOAPBodyElement body = new SOAPBodyElement(new ByteArrayInputStream(request.getBytes("UTF-8")));
  +      Object[] soapBodies = new Object[] { body };
  +    
  +      Vector result = (Vector)call.invoke(soapBodies);
  +      response = ((SOAPBodyElement)result.elementAt(0)).getAsString();
  +    }
  +    catch (AxisFault fault) {
  +
  +      fault.printStackTrace();
  +
  +      try {
  +        Message msg = call.getResponseMessage();
  +        response = msg.getSOAPEnvelope().getFirstBody().getAsString();
  +      }
  +      catch (Exception ex) {
  +        throw new RegistryException(ex);
  +      }
  +    }
  +    catch (Exception ex) {
  +      throw new RegistryException(ex);
  +    }
  +
  +    log.debug("\nResponse message:\n" + response);
  +
  +    return response;
  +  }
   }
  \ No newline at end of file
  
  
  
  1.4       +3 -0      ws-juddi/src/java/org/apache/juddi/proxy/Transport.java
  
  Index: Transport.java
  ===================================================================
  RCS file: /home/cvs/ws-juddi/src/java/org/apache/juddi/proxy/Transport.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Transport.java	1 Feb 2005 02:52:03 -0000	1.3
  +++ Transport.java	1 Feb 2005 13:24:36 -0000	1.4
  @@ -27,4 +27,7 @@
   {
     Element send(Element request,URL endPointURL)
       throws RegistryException;
  +  
  +  String send(String request,URL endpointURL)
  +    throws RegistryException;
   }
  \ No newline at end of file
  
  
  

Mime
View raw message