Hi Scott,
I have a class which does all my calling to soap, which works fine with the
official soap 3.2.1
Often I am sending Vectors having some objects (other Vectors for instance).
I give you the source of that class and the part of it which calls it, and
the deploydescriptor with the gzip option.

calling part in a class which is derived from SoapCallingDataHolder

   private Vector retrieveStationen() throws MalformedURLException,
                                             SOAPException,
                                             Exception
   {
        Vector stationen = new Vector();
        Vector resultVec =
(Vector)callSoaply(TechnicalConstants.CALL_GET_STATIONEN, null);

        for (int i=0; i<resultVec.size(); i++)
        {
            Vector stVec = (Vector)resultVec.get(i);
            Station st = new
Station((String)stVec.get(0),(String)stVec.get(2), (String)stVec.get(1) );
            // hier konnen noch weitere Attribute ubernommen werden
            stationen.add(st);
        }
        return stationen;
   }

   public void loadStationen()
   {
           if (m_statusStationenGeladen == _NICHT_GELADEN)
           {
                   Thread threadLoad = new Thread("loadSationen")
                   {
                           public void run()
                           {
                                   try
                                   {
                                           Vector stationen = retrieveStationen();
                                           m_stationen = new HashMap();
                                           for (int i=0; i<stationen.size(); i++)
                                           {

m_stationen.put(((Station)stationen.get(i)).getKey(),stationen.get(i));
                                           }
                                           m_statusStationenGeladen = _FERTIG_GELADEN;
                                   }
                                   catch (Exception ex)
                                   {
                                           MExceptionHandler.handleException(ex);
                                   }

                           }
                   };

                   threadLoad.start();
           }// end of if (m_statusStationenGeladen == _NICHT_GELADEN)
   }// end of loadStationen()



thank you in advance

Malte

PS: I am wondering, if a newer nightly build version of soap does it. I used
the one of the 4.2.2003

-----Ursprungliche Nachricht-----
Von: Scott Nichol [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 5. Februar 2003 15:59
An: [EMAIL PROTECTED]
Betreff: Re: AW: zipping Soap URGENT


Is this existing code that works with another version of Apache SOAP
but not the nightly build?  If so, can you post the code?

On 4 Feb 2003 at 18:29, Malte Kempff wrote:

> Hi Scott
> Thank you for the hint.
> But since I am trying the new soap-version form nightly build of SOAP
> (2.2.2002)
> I get an Error
> No mapping found for 'java.lang.Object' using encoding style
> 'http://schemas.xmlsoap.org/soap/encoding/'.
>
> I noticed that this soap-version is about 18 kb smaler in the jar-file
than
> the last one I used.
>
> could you help me what I am to do?
>
> Malte
>
>
> -----Ursprungliche Nachricht-----
> Von: Scott Nichol [mailto:[EMAIL PROTECTED]]
> Gesendet: Freitag, 31. Januar 2003 00:04
> An: [EMAIL PROTECTED]
> Betreff: Re: zipping Soap
>
>
> It uses the Content-Encoding capability of HTTP.  The Apache SOAP
> client always understands something gzipped.  It will gzip a payload
> only when you specify with setGzip(true).  The service always
> understands something gzipped.  It will only gzip a payload if both
> the deployment descriptor enables it *and* the client sends an Accept-
> Encoding HTTP header that says it can read gzip.  Therefore, a client
> that cannot unzip will never get something from the service that is
> zipped (and will also not benefit from such zipping!)
>
> On 31 Jan 2003 at 9:41, Jesus M. Salvo Jr. wrote:
>
> >
> > Is this a standard part of SOAP ( compressing the message )? Or is this
> > only something between Apache-SOAP client and an Apache-SOAP service?
> >
> > Scott Nichol wrote:
> >
> > >If you use a nightly build of SOAP, there is a setGzip method on
> > >SOAPContext that allows you to specify that the payload should be
> > >gzipped.  There is also support for a deployment descriptor option to
> > >gzip the payload sent by the service.  The nightly build has a gzip
> > >sample that demonstrates this.
> > >
> > >On 30 Jan 2003 at 12:54, Malte Kempff wrote:
> > >
> > >
> > >
> > >>Hi everyone,
> > >>I am using Soap for doing RPCs in an Java-Web-Start-application.
> > >>I need to transfer a log of Data and this takes a while.
> > >>As far I understand the xml which soap produces is not packed in a
way.
> Is
> > >>Soap able to pack its messages which are transported?
> > >>When yes what do I have to do for it?
> > >>
> > >>many thanks in advance,
> > >>
> > >>Malte
> > >>
> > >>
> > >>
> > >>--
> > >>To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> > >>For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> > >>
> > >>
> > >>
> > >>
> > >
> > >
> > >Scott Nichol
> > >
> > >
> > >--
> > >To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> > >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> > >
> > >
> > >
> > >
> >
> >
> > --
> > Jesus M. Salvo Jr.
> > Mobile Internet Group Pty Ltd
> > (formerly Softgame International Pty Ltd)
> > M: +61 409 126699
> > T: +61 2 94604777
> > F: +61 2 94603677
> >
> > PGP Public key:
> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC0BA5348
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> >
> >
>
>
> Scott Nichol
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


Scott Nichol
package de.mc.etnbestterm.data;

import java.net.*;
import java.util.*;

import javax.swing.*;

import org.apache.soap.*;
import org.apache.soap.rpc.*;
import org.apache.soap.transport.http.*;

import de.mc.etnbestterm.util.*;
import de.mc.util.*;
import de.mc.etnbestterm.*;



abstract public class SoapCallingDataHolder
{
	private MessageReceiver m_msgRec = null;

    protected Object callSoaply(String callName, Vector params) throws MalformedURLException, SOAPException, Exception
    {
        Properties  props       = SingletonManager.getMainProperties();

		//Properties  hiddenProps = SingletonManager.getHiddenProperties();

        Object     retObj    = null;

		SOAPHTTPConnection st = new SOAPHTTPConnection();

		boolean guterAufruf = false;

		Response response = null;
		String proxyHost = props.getProperty(GlobalConstants.PROPNAME_PROXY_HOST);
		String proxyPort = props.getProperty(GlobalConstants.PROPNAME_PROXY_PORT);
		if (proxyHost!=null && proxyPort!=null)
		{
			System.setProperty("http.proxyHost",proxyHost);
			System.setProperty("http.proxyPort",proxyPort);
		}

		while (!guterAufruf) // oder abgebrochen wurde
		{
			if (proxyHost != null)
			{
				st.setProxyHost(proxyHost);
				st.setProxyPort(Integer.parseInt(proxyPort));
			}

			SOAPContext ctx = new SOAPContext();
			//ctx.setGzip(true);
			Call call = new Call("urn:Bestterm",
								 callName,
		                         params,
								 null,
		                         Constants.NS_URI_SOAP_ENC,
						         ctx
						        );
			call.setSOAPTransport(st);
/*
			call.setTargetObjectURI("urn:Bestterm");
			call.setMethodName(callName);
			call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
			call.setParams(params);
*/
			URL url = new URL(props.getProperty("URLSTR_SOAP_RPCROUTER",
					  GlobalConstants.URLSTR_SOAP_RPCROUTER));

/*
URL url = new URL(props.getProperty("URLSTR_SOAP_RPCROUTER",
		 hiddenProps.getProperty("URLSTR_SOAP_RPCROUTER",
			   GlobalConstants.URLSTR_SOAP_RPCROUTER)) );
*/
//props.setProperty("URLSTR_SOAP_RPCROUTER",url.toString());
			System.out.println("URL = "+url+" - Methode = "+callName);
			Logger.trace(5,"URL = "+url+" - Methode = "+callName);

			try
			{
				response = call.invoke(url,"");
				guterAufruf = true;
			}
			catch (SOAPException sEx)
			{
				if (sEx.getMessage().indexOf("Error opening socket:")>-1)
				{
					boolean parsingOK = false;
					while (!parsingOK)
					{
						String portAdrString = JOptionPane.showInputDialog(null,
								"Es ist keine Verbindung zustandegekommen.\n"
 		                       +"Vermutlich wird bei Ihnen ein Proxy verwendet.\n"
                               +"Bitte geben sie Proxy-Adresse und Port wie folgt an\n"
                               +"Proxyadresse:Portnummer",
                                "Proxy-Konfiguration",
                                JOptionPane.QUESTION_MESSAGE);

						if (portAdrString!=null)
						{
							try
							{
								int colonPos = portAdrString.indexOf(":");
								proxyHost = portAdrString.substring(0,colonPos);
								proxyPort = portAdrString.substring(colonPos+1,portAdrString.length());
								Integer.parseInt(proxyPort);
								props.setProperty(GlobalConstants.PROPNAME_PROXY_HOST, proxyHost);
								props.setProperty(GlobalConstants.PROPNAME_PROXY_PORT, proxyPort);
								parsingOK = true;
								System.setProperty("http.proxyHost",proxyHost);
								System.setProperty("http.proxyPort",proxyPort);
								System.out.println("proxyHost"+proxyHost);
								System.out.println("proxyPort"+proxyPort);
							}
							catch (Exception ex)
							{
							}
						}
						else
						{
							System.exit(1);
						}
					}
				}
				else
				{
					throw sEx;
				}
			}//end of catch (SOAPException sEx)

		}// end of while ((!abgebrochen) && (!guterAufruf))
		if (response.generatedFault())
		{
			Fault fault = response.getFault();
			System.err.println("SOAP-RPC-Fehler:");
			System.err.println("SOAP-RPC:"+fault.toString());
			System.err.println("Fault Code="+fault.getFaultCode());
			System.err.println("SOAP-RPC-Fehler:"+fault.getFaultString());
			throw new Exception(fault.getFaultString());
		}
		else
		{
			Parameter retValue = response.getReturnValue();
			retObj             = retValue == null ? null : retValue.getValue();
		}

        return retObj;
    }// end of callSouply(String, Vector)

	public void setMessageReceiver(MessageReceiver msgRec)
	{
		m_msgRec = msgRec;
	}

	public MessageReceiver getMessgageReceiver()
	{
		return m_msgRec;
	}

}
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment";
             id="urn:Bestterm">
  <isd:provider type="java"
                scope="Application"
                methods="
				getWelcomeInfo
				setWelcomeInfo
				setOEProperty
				setHausProperty
				setProperty
				deleteProperty
				getProperty
				connectToDB
				checkLogin
				changePasswort
				getStationen
				getSparten
				getUserData
				getHausData
				getIndikationen

				getNextBlock
				getNextStreamBlock
				getArtikelStatus
				getGesamtKatalog
				getPreisKatalog
				getHausArtikel
				getOeArtikelIds
				getOeArtikelListe
				searchGlobal
				searchInHouse
				searchGlobalSP
				searchInHouseSP
				deleteStationListEntries
				copyEntriesToStationList
				updateArticleEntries
				putOrdersIntoBasket
				putFreeOrderIntoBasket
				getBasket
				getBasketToCommit
				updateBasketEntries
				signBasketEntriesForDelete
				deleteBasketEntries
				commitBasketEntries
				orderBasketEntries
				searchOrders
				getOrder
				getOrderPositions
				createOrder
				setOrderResponse
				cumulateDelivery

				getStatistikZeitRaum

				getUserRights
				synchronizeUserRights
				createUser
				deleteUser
				changeUser
				searchForUsers
				getKdInstIds

                ">
    <isd:java class="de.mc.etnbestterm.server.BesttermServer" static="false"/>
	<isd:option key="gzip" value="true"/>
  </isd:provider>

  <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>

</isd:service>

Reply via email to