axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ghershony, Arie" <Arie.Ghersh...@GDC4S.Com>
Subject RE: Type Jeff Greif []
Date Wed, 12 Feb 2003 21:55:21 GMT
I try to call this function and I get an error:      
public static void main(String [] args) throws Exception {
         OrderB client = new OrderB();

getBattleService(java.lang.String[]) in clientaxis.Battle.OrderB cannot be
applied to <java.lang.String>
Error 1

-----Original Message-----
From: Ghershony, Arie 
Sent: Wednesday, February 12, 2003 4:20 PM
To: ''
Subject: RE: Type Jeff Greif []

thank you

-----Original Message-----
From: Jeff Greif []
Sent: Wednesday, February 12, 2003 4:19 PM
Subject: Re: Type Jeff Greif []

use XMLUtils.PrettyElementToWriter

----- Original Message ----- 
From: Ghershony, Arie <mailto:Arie.Ghershony@GDC4S.Com>  
To: '' <mailto:''>  
Sent: Wednesday, February 12, 2003 12:49 PM
Subject: Type Jeff Greif []

I still receive an error:

PrettyElementToStream(org.w3c.dom.Element,jav in org.apache.axis.utils.XMLUtils cannot be applied to
      XMLUtils.PrettyElementToStream(result, w);
1 error

Thank you for your time. 
here is some of the code relavant to this issue:  perhaps you could
understand what I am exactly doing: 
package clientaxis.Battle;
import java.util.Vector;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import java.util.Iterator;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.message.SOAPEnvelope;
import org.apache.axis.message.SOAPBodyElement;
import org.apache.axis.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
//import com.wrox.jws.stockcore.StockCore;
import clientaxis.Battle.BCore;
public class OrderB {
... some code goes here...
public String getBattleService(String[] uniqb) throws Exception {
   //final String methodName = "OrderB.main";
     StringWriter w = new StringWriter();
    try {
  DocumentBuilderFactory documentBuilderFactory = null;
      DocumentBuilder  parser                 = null;
      // We need a namespace-aware parser
      documentBuilderFactory = DocumentBuilderFactory.newInstance();
      parser = documentBuilderFactory.newDocumentBuilder();
      // We create the document for the request (the XML document that will 
      // be embedded inside the SOAP body).
      Document document = parser.newDocument();
      Element  element  = document.getDocumentElement();
      // The <portfolio/> element is the root of our document;
      Element requestElement = document.createElementNS(nameSpaceURI, 
     // Element command        = document.createElement(args[0]);
     Element command        = document.createElement(uniqb[0]);
      // We add the list of ticker symbols
      for(int index = 1; index < uniqb.length; index++) {
        Element ticker = document.createElement(tickerTag);
       // ticker.appendChild(document.createTextNode(args[index]));
      // Unless the command is a get, we add the get command
      if(!uniqb.equals(getCommand)) {
      Element result = null;
      boolean local  = false;  // set to true for local test (inproc)
      if(local) {
        // Local test, no SOAP
        result = orderbattle(requestElement, 
      } else {
        // We create a SOAP request to submit the XML document to the

    // server. You might need to replace the following URL with what is 
        // suitable for your environment
        String  endpointURL = 
    " http://localhost:8080/axis/servlet/AxisServlet
<http://localhost:8080/axis/servlet/AxisServlet> ";
        Service service     = new Service();
        Call    call        = (Call)service.createCall();
        // Create a SOAP envelope to wrap the newly formed document
        SOAPEnvelope    requestEnvelope = new SOAPEnvelope();
        SOAPBodyElement requestBody     = 
     new SOAPBodyElement(requestElement);
        // Set the endpoint URL (address we are talking to) and method name
        call.setTargetEndpointAddress(new URL(endpointURL));
        call.setSOAPActionURI(orderbattleTag); // method name = tag name
        // Submit the document to the remote server
        SOAPEnvelope responseEnvelope = call.invoke(requestEnvelope);
        // Get the <orderbattle/> element from the response
        SOAPBodyElement responseBody =
        result = responseBody.getAsDOM();
      XMLUtils.PrettyElementToStream(result, w);
      return w.toString();
        } catch (Exception exception) {
         throw exception;

 ...some code here....

View raw message