Return-Path: Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 99960 invoked by uid 500); 25 Feb 2003 20:42:12 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 99866 invoked from network); 25 Feb 2003 20:42:10 -0000 Content-return: allowed Date: Tue, 25 Feb 2003 15:39:25 -0500 From: "Ghershony, Arie" Subject: MSG style service To: "'axis-user@ws.apache.org'" Message-id: <5EFDF5D7C3ECA546923C4C7E8C7EDBF944A6E2@ndhmex02.ndhm.gd-ns.com> MIME-version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-type: multipart/alternative; boundary="----_=_NextPart_001_01C2DD0D.FC354CA0" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C2DD0D.FC354CA0 Content-Type: text/plain; charset="iso-8859-1" what does the error mean? I appreciate your help!! Aria. I have 2 files, one client and one service, I run it from the command line: java clientaxis.Battle.message.CatalogPublisherServiceClient I notice that when I publish it (WSDL file), the "main" function is not published even though I use value="*" I see there only CatalogPublisherService (wsdl) publishCatalog the error is: D:\xml-axis>java clientaxis.Battle.message.CatalogPublisherServiceClient Exception in thread "main" AxisFault faultCode: {http://xml.apache.org/axis/}Server.userException faultString: java.lang.NoSuchMethodException: clientaxis.Battle.message.Catalog PublisherService.CATALOG(org.w3c.dom.Document)tried class: clientaxis.Battle.me ssage.CatalogPublisherService, method name: CATALOG. faultActor: null faultDetail: stackTrace: java.lang.NoSuchMethosException: clientaxis.Battle.message.CatalogPublisherService.CATALOG(org.w3c.dom.Docume nt)tried class: clientaxis.Battle.message.CatalogPublisherService, method name: CATALOG. at org.apache.axis.providers.java.MsgProvider.processmessage(MsgProvider.java:1 73)........ .............. here are the files: //CatalogPublisherService.java package clientaxis.Battle.message; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; import org.w3c.dom.Node; import org.w3c.dom.Text; import java.util.Vector; import java.util.Date; import java.text.SimpleDateFormat; import org.apache.axis.MessageContext ; import org.apache.axis.utils.XMLUtils; import org.apache.axis.message.SOAPBodyElement; import java.io.*; public class CatalogPublisherService { public Element[] publishCatalog(MessageContext context, Vector soapBodyElements) throws Exception { Element soapBody = (Element) soapBodyElements.get(0); NodeList productList = soapBody.getElementsByTagName("PRODUCT"); //Get the count of elements in the NodeList int productCount = productList.getLength(); //Call back-end code //Start Building Response Document //Get a DocumentBuilder objec DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); //Start creating the Response //Creat a new DOM Document Document responseDoc = builder.newDocument(); //Create the namespace aware root Element Element resRoot = responseDoc.createElementNS("http:// www.wrox.com/axis/catalogupdate","CATALOGUPDATE "); resRoot.setPrefix("CU"); //Create the ITEMCOUNT element Element itemCount = responseDoc.createElement("ITEMCOUNT"); Text itemCountText = responseDoc.createTextNode(String.valueOf (productCount)); //Create the DATE RECEIVED element Element dateReceived = responseDoc.createElement("DATERECEIVED"); SimpleDateFormat fmt = new SimpleDateFormat("MM/dd/yyyy"); String date = fmt.format(new Date()); Text dateReceivedText = responseDoc.createTextNode(date); //Append the child elements appropriately resRoot.appendChild(itemCount); itemCount.appendChild(itemCountText); resRoot.appendChild(dateReceived); dateReceived.appendChild(dateReceivedText); Element[] result = new Element[1]; result[0] = resRoot; return(result); } } Client File: / CatalogPublisherServiceClient.java package clientaxis.Battle.message; import org.w3c.dom.Element; import org.apache.axis.client.Service; import org.apache.axis.client.Call; import org.apache.axis.message.SOAPBodyElement; import org.apache.axis.utils.Options; import org.apache.axis.utils.XMLUtils; import java.io.FileInputStream; import java.net.URL; import java.util.Vector; public class CatalogPublisherServiceClient { public static void main(String[] args) throws Exception { String endpointURL = " http://localhost:8080/axis/services/CatalogPublisherService "; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(new URL(endpointURL)); SOAPBodyElement[] reqSOAPBodyElements = new SOAPBodyElement[1]; reqSOAPBodyElements[0] = new SOAPBodyElement(XMLUtils.newDocument(new java.io.FileInputStream(new java.io.File("D:\\xml-axis\\clientaxis\\Battle\\message\\catalog.xml"))).get DocumentElement()); Vector resSOAPBodyElements = (Vector) call.invoke(reqSOAPBodyElements); SOAPBodyElement resSOAPBodyElement = null; resSOAPBodyElement = (SOAPBodyElement) resSOAPBodyElements.get(0); System.out.println(XMLUtils.ElementToString(resSOAPBodyElement.getAsDOM())); } } XML document used to send to the service: 02/15/2002 12345-56789 support@supplier.com SKU-1 Toyota Spark Plug 10.99 Each SKU-2 Toyota Wiper 2.99 Each this is the deployee desc: ------_=_NextPart_001_01C2DD0D.FC354CA0 Content-Type: text/html; charset="iso-8859-1" RE: Design review and general axis questions

 
   what does the error mean?
I appreciate your help!!
 
Aria.
 

I have 2 files, one client and one service, I run it from the command line:
java clientaxis.Battle.message.CatalogPublisherServiceClient
 

I notice that when I publish it (WSDL file), the "main" function is not published even though I use  value="*"  I see there only
CatalogPublisherService (wsdl)
publishCatalog
 
the error is:
D:\xml-axis>java clientaxis.Battle.message.CatalogPublisherServiceClient
Exception in thread "main" AxisFault
 faultCode: {http://xml.apache.org/axis/}Server.userException
 faultString: java.lang.NoSuchMethodException: clientaxis.Battle.message.Catalog
PublisherService.CATALOG(org.w3c.dom.Document)tried class:  clientaxis.Battle.me
ssage.CatalogPublisherService, method name:  CATALOG.
 faultActor: null
 faultDetail:
   stackTrace: java.lang.NoSuchMethosException: clientaxis.Battle.message.CatalogPublisherService.CATALOG(org.w3c.dom.Document)tried class: clientaxis.Battle.message.CatalogPublisherService, method name: CATALOG.
 at org.apache.axis.providers.java.MsgProvider.processmessage(MsgProvider.java:173)........
..............
 
here are the files:
//CatalogPublisherService.java
 package clientaxis.Battle.message;
 
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
import java.util.Vector;
import java.util.Date;
import java.text.SimpleDateFormat;
import org.apache.axis.MessageContext ;
import org.apache.axis.utils.XMLUtils;
import org.apache.axis.message.SOAPBodyElement;
 
import java.io.*;
 
public class CatalogPublisherService {
  public Element[] publishCatalog(MessageContext context,
    Vector soapBodyElements) throws Exception {
    Element soapBody = (Element) soapBodyElements.get(0);
    NodeList productList = soapBody.getElementsByTagName("PRODUCT");
    //Get the count of <PRODUCT> elements in the NodeList
    int productCount = productList.getLength();
    //Call back-end code
 
    //Start Building Response Document
    //Get a DocumentBuilder objec
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    //Start creating the Response
    //Creat a new DOM Document
    Document responseDoc = builder.newDocument();
 
    //Create the namespace aware root Element <CATALOGUPDATE>
    Element resRoot = responseDoc.createElementNS("http://
 
www.wrox.com/axis/catalogupdate","CATALOGUPDATE");
    resRoot.setPrefix("CU");
 
    //Create the ITEMCOUNT element
    Element itemCount = responseDoc.createElement("ITEMCOUNT");
    Text itemCountText = responseDoc.createTextNode(String.valueOf  (productCount));
 
    //Create the DATE RECEIVED element
    Element dateReceived = responseDoc.createElement("DATERECEIVED");
    SimpleDateFormat fmt = new SimpleDateFormat("MM/dd/yyyy");
    String date = fmt.format(new Date());
    Text dateReceivedText = responseDoc.createTextNode(date);
 
    //Append the child elements appropriately
    resRoot.appendChild(itemCount);
    itemCount.appendChild(itemCountText);
    resRoot.appendChild(dateReceived);
    dateReceived.appendChild(dateReceivedText);
 
    Element[] result = new Element[1];
    result[0] = resRoot;
 
    return(result);
  }
}
 

Client File:
 

/ CatalogPublisherServiceClient.java
 
package clientaxis.Battle.message;
 
import org.w3c.dom.Element;
import org.apache.axis.client.Service;
import org.apache.axis.client.Call;
import org.apache.axis.message.SOAPBodyElement;
import org.apache.axis.utils.Options;
import org.apache.axis.utils.XMLUtils;
 
import java.io.FileInputStream;
import java.net.URL;
import java.util.Vector;
 
public class CatalogPublisherServiceClient {
 
  public static void main(String[] args) throws Exception {
 
    String endpointURL = "http://localhost:8080/axis/services/CatalogPublisherService";
    Service service = new Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress(new URL(endpointURL));
 
    SOAPBodyElement[] reqSOAPBodyElements = new SOAPBodyElement[1];
 
    reqSOAPBodyElements[0] = new SOAPBodyElement(XMLUtils.newDocument(new java.io.FileInputStream(new java.io.File("D:\\xml-axis\\clientaxis\\Battle\\message\\catalog.xml"))).getDocumentElement());
 
    Vector resSOAPBodyElements = (Vector) call.invoke(reqSOAPBodyElements);
    SOAPBodyElement resSOAPBodyElement = null;
    resSOAPBodyElement = (SOAPBodyElement) resSOAPBodyElements.get(0);
    System.out.println(XMLUtils.ElementToString(resSOAPBodyElement.getAsDOM()));
  }
}
 

XML document used to send to the service:
 
<CATALOG xmlns="http://www.wrox.com/axis/catalog">
  <DOCUMENTINFO>
    <DATE>02/15/2002</DATE>
  </DOCUMENTINFO>
  <SUPPLIERDETAILS>
    <SUPPLIERID>12345-56789</SUPPLIERID>
    <SUPPLIERCONTACTEMAIL>support@supplier.com</SUPPLIERCONTACTEMAIL>
  </SUPPLIERDETAILS>
  <PRODUCTLIST>
    <PRODUCT>
      <SUPPLIER-PRODUCTSKU>SKU-1</SUPPLIER-PRODUCTSKU>
      <PRODUCTDESC>Toyota Spark Plug</PRODUCTDESC>
      <PRODUCTPRICE>10.99</PRODUCTPRICE>
      <PRODUCTUOM>Each</PRODUCTUOM>
    </PRODUCT>
    <PRODUCT>
     <SUPPLIER-PRODUCTSKU>SKU-2</SUPPLIER-PRODUCTSKU>
     <PRODUCTDESC>Toyota Wiper</PRODUCTDESC>
     <PRODUCTPRICE>2.99</PRODUCTPRICE>
     <PRODUCTUOM>Each</PRODUCTUOM>
    </PRODUCT>
  </PRODUCTLIST>
</CATALOG>
 

this is the deployee desc:
 
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
      xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
      xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">
  <service name="CatalogPublisherService" provider="java:MSG">
    <parameter name="className" value="clientaxis.Battle.message.CatalogPublisherService"/>
    <parameter name="allowedMethods" value="*" />
  </service>
</deployment>
 
 
------_=_NextPart_001_01C2DD0D.FC354CA0--