1 24 package com.scalagent.kjoram.ksoap; 25 26 import com.scalagent.kjoram.jms.*; 27 28 import java.io.IOException ; 29 import java.io.InterruptedIOException ; 30 import java.util.Vector ; 31 32 35 class SoapDriver extends com.scalagent.kjoram.Driver { 36 37 String serviceUrl = null; 38 int cnxId = -1; 39 HttpConnection httpConnection = null; 40 String name = null; 41 42 47 SoapDriver(com.scalagent.kjoram.Connection cnx, 48 String serviceUrl, 49 int cnxId) { 50 super(cnx); 51 this.serviceUrl = serviceUrl; 52 this.cnxId = cnxId; 53 httpConnection = new HttpConnection(serviceUrl); 54 name = cnx.getUserName(); 55 } 56 57 58 64 protected AbstractJmsReply getDelivery() throws IOException { 65 AbstractJmsReply reply = null; 66 67 try { 68 reply = httpConnection.call(new GetReply(name,cnxId),name,cnxId); 69 70 if (reply == null) return null; 71 } catch (Exception exc) { 72 throw new IOException ("The SOAP call failed: " + exc.getMessage()); 73 } 74 75 if (reply instanceof CnxCloseReply) { 76 throw new IOException ("Driver is closing."); 77 } else if (reply instanceof AbstractJmsReply) { 78 return (AbstractJmsReply) reply; 79 } else { 80 throw new IOException ("The SOAP service failed to process the call: " 81 + reply); 82 } 83 } 84 85 86 public void shutdown() { 87 } 88 } 89 | Popular Tags |