<%@ page import="org.apache.axis.client.Call, org.apache.axis.client.Service, javax.xml.namespace.QName, java.io.*, java.net.URL, javax.activation.*, org.apache.axis.*, java.util.*, javax.xml.soap.*" %>

<%
			String endpoint = "http://localhost:8080/axis/services/Info";
			
			Service service = new Service();
			Call call = (Call) service.createCall();
			call.setTargetEndpointAddress(new URL(endpoint));
						
			call.setOperationName(new QName("http://soapinterop.org", "getPicture"));
			String result = (String) call.invoke(new Object[]{request.getParameter("lastname")});
			
			Message msg = call.getResponseMessage();
			Iterator attachments = msg.getAttachments();
			
			if (attachments.hasNext())
			{
				AttachmentPart attachment = (AttachmentPart) attachments.next();
				DataHandler handler = attachment.getDataHandler();
				handler.writeTo(response.getOutputStream());
			}
			else
			{
				result = result += " No attachments!";
			}
%>