1 57 58 package clients.zipcode; 59 60 import java.net.*; 61 import java.util.*; 62 import org.w3c.dom.*; 63 import org.apache.soap.*; 64 import org.apache.soap.encoding.*; 65 import org.apache.soap.encoding.soapenc.*; 66 import org.apache.soap.rpc.*; 67 import org.apache.soap.util.xml.*; 68 import org.apache.soap.messaging.*; 69 70 public class zipcoderesolverProxy 71 { 72 private Call call = new Call(); 73 private URL url = null; 74 private String stringURL = "http://webservices.eraserver.net/zipcoderesolver/zipcoderesolver.asmx"; 75 private SOAPMappingRegistry smr = call.getSOAPMappingRegistry(); 76 77 public zipcoderesolverProxy() 78 { 79 } 80 81 public synchronized void setEndPoint(URL url) 82 { 83 this.url = url; 84 } 85 86 public synchronized URL getEndPoint() throws MalformedURLException 87 { 88 return getURL(); 89 } 90 91 private URL getURL() throws MalformedURLException 92 { 93 if (url == null && stringURL != null && stringURL.length() > 0) 94 { 95 url = new URL(stringURL); 96 } 97 return url; 98 } 99 100 101 102 103 public synchronized org.w3c.dom.Element ShortZipCode_(org.w3c.dom.Element parameters) throws Exception 104 { 105 String targetObjectURI = ""; 106 String SOAPActionURI = "http://webservices.eraserver.net/ShortZipCode"; 107 108 if(getURL() == null) 109 { 110 throw new SOAPException(Constants.FAULT_CODE_CLIENT, 111 "A URL must be specified via zipcoderesolverProxy.setEndPoint(URL)."); 112 } 113 114 Envelope msgEnv = new Envelope(); 116 Body msgBody = new Body(); 117 Vector vect = new Vector(); 118 119 vect.add(parameters); 120 msgBody.setBodyEntries(vect); 121 msgEnv.setBody(msgBody); 122 123 Message msg = new Message(); 125 msg.send(getURL(),SOAPActionURI, msgEnv); 126 127 Envelope env = msg.receiveEnvelope(); 129 Body retbody = env.getBody(); 130 java.util.Vector v = retbody.getBodyEntries(); 131 132 return (Element)v.firstElement(); 133 134 } 135 136 public synchronized ShortZipCodeResponse_ElementContentType ShortZipCode(ShortZipCode_ElementContentType parameters) throws Exception 137 { 138 parameters.changeLocalName("ShortZipCode"); 139 parameters.changeNamespaceURI("http://webservices.eraserver.net/"); 140 org.w3c.dom.Element parameters_ = parameters.createElement(); 141 142 org.w3c.dom.Element result_ = ShortZipCode_(parameters_); 144 145 ShortZipCodeResponse_ElementContentType aShortZipCodeResponse_ElementContentType = new ShortZipCodeResponse_ElementContentType(); 147 aShortZipCodeResponse_ElementContentType.populateFrom(result_); 148 149 return aShortZipCodeResponse_ElementContentType; 150 } 151 152 153 154 155 156 157 158 159 160 161 162 } 163 | Popular Tags |