I'm trying to rum the samples that comes with apache soap 2.2. Heres dd.xml <isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment" id="urn:AddressFetcher"> <isd:provider type="java" scope="Application" methods="getAddressFromName addEntry getAllListings putListings"> <isd:java class="samples.addressbook.AddressBook" static="false" /> </isd:provider> <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultLis tener> <isd:mappings> <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:x="urn:xml-soap-address-demo" qname="x:address" javaType="samples.addressbook.Address" java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer" xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer" /> <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:x="urn:xml-soap-address-demo" qname="x:phone" javaType="samples.addressbook.PhoneNumber" java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer" xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer" /> </isd:mappings> </isd:service> and heres the java file. package samples.addressbook; import java.util.*; import org.w3c.dom.*; import javax.xml.parsers.*; import org.apache.soap.util.xml.*; /** * See \samples\addressbook\readme for info. * * @author Matthew J. Duftler ([EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ) */ public class AddressBook { private Hashtable name2AddressTable = new Hashtable(); public AddressBook() { addEntry("John B. Good", new Address(123, "Main Street", "Anytown", "NY", 12345, new PhoneNumber(123, "456", "7890"))); addEntry("Bob Q. Public", new Address(456, "North Whatever", "Notown", "ME", 12424, new PhoneNumber(987, "444", "5566"))); } public void addEntry(String name, Address address) { name2AddressTable.put(name, address); } public Address getAddressFromName(String name) throws IllegalArgumentException { if (name == null) { throw new IllegalArgumentException("The name argument must not be " + "null."); } return (Address)name2AddressTable.get(name); } public Element getAllListings() { DocumentBuilder xdb = XMLParserUtils.getXMLDocBuilder(); Document doc = xdb.newDocument(); Element bookEl = doc.createElement("AddressBook"); bookEl.appendChild(doc.createTextNode("\n")); for (Enumeration keys = name2AddressTable.keys(); keys.hasMoreElements();) { String name = (String)keys.nextElement(); Address address = (Address)name2AddressTable.get(name); Element listingEl = doc.createElement("Listing"); Element nameEl = doc.createElement("Name"); nameEl.appendChild(doc.createTextNode(name)); listingEl.appendChild(doc.createTextNode("\n ")); listingEl.appendChild(nameEl); listingEl.appendChild(doc.createTextNode("\n ")); Element addressEl = doc.createElement("Address"); Element streetNumEl = doc.createElement("StreetNum"); streetNumEl.appendChild(doc.createTextNode(address.getStreetNum() + "")); addressEl.appendChild(doc.createTextNode("\n ")); addressEl.appendChild(streetNumEl); addressEl.appendChild(doc.createTextNode("\n ")); Element streetNameEl = doc.createElement("StreetName"); streetNameEl.appendChild(doc.createTextNode(address.getStreetName())); addressEl.appendChild(streetNameEl); addressEl.appendChild(doc.createTextNode("\n ")); Element cityEl = doc.createElement("City"); cityEl.appendChild(doc.createTextNode(address.getCity())); addressEl.appendChild(cityEl); addressEl.appendChild(doc.createTextNode("\n ")); Element stateEl = doc.createElement("State"); stateEl.appendChild(doc.createTextNode(address.getState())); addressEl.appendChild(stateEl); addressEl.appendChild(doc.createTextNode("\n ")); Element zipEl = doc.createElement("Zip"); zipEl.appendChild(doc.createTextNode(address.getZip() + "")); addressEl.appendChild(zipEl); addressEl.appendChild(doc.createTextNode("\n ")); PhoneNumber phone = address.getPhoneNumber(); Element phoneEl = doc.createElement("PhoneNumber"); phoneEl.appendChild(doc.createTextNode("\n ")); Element areaCodeEl = doc.createElement("AreaCode"); areaCodeEl.appendChild(doc.createTextNode(phone.getAreaCode() + "")); phoneEl.appendChild(areaCodeEl); phoneEl.appendChild(doc.createTextNode("\n ")); Element exchangeEl = doc.createElement("Exchange"); exchangeEl.appendChild(doc.createTextNode(phone.getExchange())); phoneEl.appendChild(exchangeEl); phoneEl.appendChild(doc.createTextNode("\n ")); Element numberEl = doc.createElement("Number"); numberEl.appendChild(doc.createTextNode(phone.getNumber())); phoneEl.appendChild(numberEl); phoneEl.appendChild(doc.createTextNode("\n ")); addressEl.appendChild(phoneEl); addressEl.appendChild(doc.createTextNode("\n ")); listingEl.appendChild(addressEl); listingEl.appendChild(doc.createTextNode("\n ")); bookEl.appendChild(doc.createTextNode(" ")); bookEl.appendChild(listingEl); bookEl.appendChild(doc.createTextNode("\n")); } return bookEl; } public int putListings(Element el) { Element listingEl = DOMUtils.getFirstChildElement(el); int count = 0; while (listingEl != null) { String name = null; int streetNum = 0; String streetName = ""; String city = ""; String state = ""; int zip = 0; int areaCode = 0; String exchange = ""; String number = ""; Element tempEl = DOMUtils.getFirstChildElement(listingEl); while (tempEl != null) { String tagName = tempEl.getTagName(); if (tagName.equals("Name")) { name = DOMUtils.getChildCharacterData(tempEl); } else if (tagName.equals("Address")) { Element tempEl2 = DOMUtils.getFirstChildElement(tempEl); while (tempEl2 != null) { String tagName2 = tempEl2.getTagName(); String content2 = DOMUtils.getChildCharacterData(tempEl2); if (tagName2.equals("StreetNum")) { streetNum = Integer.parseInt(content2); } else if (tagName2.equals("StreetName")) { streetName = content2; } else if (tagName2.equals("City")) { city = content2; } else if (tagName2.equals("State")) { state = content2; } else if (tagName2.equals("Zip")) { zip = Integer.parseInt(content2); } else if (tagName2.equals("City")) { city = content2; } else if (tagName2.equals("PhoneNumber")) { Element tempEl3 = DOMUtils.getFirstChildElement(tempEl2); while (tempEl3 != null) { String tagName3 = tempEl3.getTagName(); String content3 = DOMUtils.getChildCharacterData(tempEl3); if (tagName3.equals("AreaCode")) { areaCode = Integer.parseInt(content3); } else if (tagName3.equals("Exchange")) { exchange = content3; } else if (tagName3.equals("Number")) { number = content3; } tempEl3 = DOMUtils.getNextSiblingElement(tempEl3); } } tempEl2 = DOMUtils.getNextSiblingElement(tempEl2); } } tempEl = DOMUtils.getNextSiblingElement(tempEl); } if (name != null) { Address address = new Address(streetNum, streetName, city, state, zip, new PhoneNumber(areaCode, exchange, number)); addEntry(name, address); count++; } listingEl = DOMUtils.getNextSiblingElement(listingEl); } return count; } } thanks --ola -----Original Message----- From: Pae Choi Sent: Fri 11/9/2001 11:50 PM To: [EMAIL PROTECTED] Cc: Subject: Re: java.lang.NoSuchMethodError You will probably get better luck if you show us the content of your dd.xml file and the related java file. So we can help you what is wrong. Probably, either missing method in your java file or wrong method name in your dd.xml file. Pae <Ola> Hi, I'm trying to register a SOAP service and I get the following error C:\soap-bin-2.2\soap-2_2\samples\addressbook>java org.apache.soap.server.ServiceManagerClient http://localhost:8082/soap/servlet/rpcrouter deploy dd.xml Ouch, the call failed: Fault Code = SOAP-ENV:Server.Exception: Fault String = java.lang.NoSuchMethodError I hope someone out there can help me. --ola </Ola>
<<winmail.dat>>
