commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morg...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jelly/jelly-tags/soap/src/java/org/apache/commons/jelly/tags/soap InvokeTag.java
Date Sun, 26 Jan 2003 07:08:45 GMT
morgand     2003/01/25 23:08:45

  Modified:    jelly/jelly-tags/soap/src/java/org/apache/commons/jelly/tags/soap
                        InvokeTag.java
  Log:
  converted soap taglib from Exception to JellyTagException
  
  Revision  Changes    Path
  1.2       +32 -16    jakarta-commons-sandbox/jelly/jelly-tags/soap/src/java/org/apache/commons/jelly/tags/soap/InvokeTag.java
  
  Index: InvokeTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/soap/src/java/org/apache/commons/jelly/tags/soap/InvokeTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InvokeTag.java	7 Jan 2003 14:10:03 -0000	1.1
  +++ InvokeTag.java	26 Jan 2003 07:08:45 -0000	1.2
  @@ -61,13 +61,16 @@
    */
   package org.apache.commons.jelly.tags.soap;
   
  +import java.net.MalformedURLException;
  +import java.rmi.RemoteException;
   import java.util.Collection;
   
   import javax.xml.namespace.QName;
  +import javax.xml.rpc.ServiceException;
   
   import org.apache.axis.client.Call;
   import org.apache.axis.client.Service;
  -import org.apache.commons.jelly.JellyException;
  +import org.apache.commons.jelly.JellyTagException;
   import org.apache.commons.jelly.MissingAttributeException;
   import org.apache.commons.jelly.TagSupport;
   import org.apache.commons.jelly.XMLOutput;
  @@ -92,7 +95,7 @@
   
       // Tag interface
       //-------------------------------------------------------------------------
  -    public void doTag(XMLOutput output) throws Exception {
  +    public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException
{
           if (endpoint == null) {
               throw new MissingAttributeException("endpoint");
           }
  @@ -116,21 +119,34 @@
           if (service == null) {
               service = createService();
           }
  -        Call call = (Call) service.createCall();
  -
  -        // @todo Jelly should have native support for URL and QName
  -        // directly on properties
  -        call.setTargetEndpointAddress(new java.net.URL(endpoint));
  -        call.setOperationName(new QName(namespace, method));
  -
  -        Object answer = call.invoke(params);
  +        
  +        Object answer = null;
  +        try {
  +            Call call = (Call) service.createCall();
  +
  +            // @todo Jelly should have native support for URL and QName
  +            // directly on properties
  +            call.setTargetEndpointAddress(new java.net.URL(endpoint));
  +            call.setOperationName(new QName(namespace, method));
  +
  +            answer = call.invoke(params);
  +        } 
  +        catch (MalformedURLException e) {
  +            throw new JellyTagException(e);
  +        } 
  +        catch (ServiceException e) {
  +            throw new JellyTagException(e);
  +        }
  +        catch (RemoteException e) {
  +            throw new JellyTagException(e);
  +        }
           
           if (var != null) {
               context.setVariable(var, answer);
           }
           else {
               // should turn the answer into XML events...
  -            throw new JellyException( "Not implemented yet; should stream results as XML
events. Results: " + answer );
  +            throw new JellyTagException( "Not implemented yet; should stream results as
XML events. Results: " + answer );
           }
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message