Hello !
 
I use soap 2.2 + Tomcat 3.2.
When I run example  \soap-2_2\samples\stockquote whith multiple ( work 2-3 different clients on one competer or no)
 requests in body ( for(...){ }  ) at the same time, we got following exception:
 
Exception in thread "main" [SOAPException: faultCode=SOAP-ENV:Client; msg=parsing error: org.xml.sax.SAXException: FWK005 parse may not be called while parsing.]
        at GetQuoteProxy1.getQuote(GetQuoteProxy1.java:57)
        at Client1.main(Client1.java:19)
 
Only 1 client can run all reqests, other after 5-20 reqests get exception.
Why it is occured? Or it s my error..
Here is code classes:
//-------------------------------
import java.net.*;
import org.apache.soap.*;
import com.ibm.wsdl.Main;
import com.ibm.nassl.*;
import java.lang.reflect.*;
import com.ibm.wsdl.*;
import org.w3c.dom.*;
 

import java.io.*;
 
public class Client1
{
  public static void main(String[] argv) throws MalformedURLException, SOAPException
  {
    String my_argv = "test";
    GetQuoteProxy1 testProxy = new GetQuoteProxy1();
  for (int i=1;i<100;i++)
    System.out.println(i+" Result: " + testProxy.getQuote(my_argv));
    System.out.println("Result: ");
  }
}
//-------------------------------
import java.net.*;
import java.util.*;
import org.apache.soap.*;
import org.apache.soap.encoding.*;
import org.apache.soap.rpc.*;
import org.apache.soap.util.xml.*;
 
public class GetQuoteProxy1
{
  private Call call = new Call();
  private URL url = null;
  private String SOAPActionURI = "";
  private SOAPMappingRegistry smr = call.getSOAPMappingRegistry();
 
  public GetQuoteProxy1() throws MalformedURLException
  {
    call.setTargetObjectURI("urn:xmltoday-delayed-quotes1");
    call.setEncodingStyleURI("http://schemas.xmlsoap.org/soap/encoding/");
    this.url = new URL("http://192.168.0.12:8080/soap/servlet/rpcrouter");
    this.SOAPActionURI = "";
  }
 
  public synchronized void setEndPoint(URL url)
  {
    this.url = url;
  }
 
  public synchronized URL getEndPoint()
  {
    return url;
  }
 
  public synchronized float getQuote
    (java.lang.String symbol) throws SOAPException
  {
    if (url == null)
    {
      throw new SOAPException(Constants.FAULT_CODE_CLIENT,
      "A URL must be specified via " +
      "GetQuoteProxy.setEndPoint(URL).");
    }
 
    call.setMethodName("getQuote");
    Vector params = new Vector();
    Parameter symbolParam = new Parameter("symbol", java.lang.String.class,
      symbol, null);
    params.addElement(symbolParam);
    call.setParams(params);
    Response resp = call.invoke(url, SOAPActionURI);
 
    // Check the response.
    if (resp.generatedFault())
    {
      Fault fault = resp.getFault();
 
      throw new SOAPException(fault.getFaultCode(), fault.getFaultString());
    }
    else
    {
      Parameter retValue = resp.getReturnValue();
      return ((Float)retValue.getValue()).floatValue();
    }
  }
}
//-------------------------------
public class GetQuoteService1
{
  static float start = 0;
 
  public GetQuoteService1 ()
  {
     System.out.println("Empty constructor_1");
  }
//  public float getQuote(java.lang.String symbol)
  public static synchronized float getQuote(java.lang.String symbol)
 
  {
    System.out.println("Servis GetQuoteService is runed");
    return start++;
  }
}

Reply via email to