I am still confused. Your code shows only printing of DOM2Writer.nodeToString(custInfo). Do you also do this with custID? Exactly what is the output when you do?
On 4 Jun 2003 at 22:33, Parames wrote: > > Yes im printing in the client > No null pointerecxeption ,elementvalue is null...ie > custID =null; > goes like this > > public Element callCustSVC(String IdToLookup) throws > Exception > > { > IdToLookup = IdToLookup; > call = new Call(); > String soapActionURI =""; > > smr = new SOAPMappingRegistry(); > BeanSerializer beanSer = new BeanSerializer(); > > smr = call.getSOAPMappingRegistry(); > call.setSOAPMappingRegistry(smr); > call.setTargetObjectURI("urn:CustInfoFetcher"); > call.setMethodName("getCustomerInfo"); > > call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML); > > > DocumentBuilderFactory factory = > DocumentBuilderFactory.newInstance(); > DocumentBuilder tempBuilder = > factory.newDocumentBuilder(); > Document docXML = null; > docXML = tempBuilder.newDocument(); > Element custID = docXML.getDocumentElement(); > //Element root = docXML.createElement("CustomerInfo"); > custID.appendChild(docXML.createTextNode(IdToLookup)); > this.url = new > URL("http://10.1.1.237:8080/soap/servlet/rpcrouter"); > > Vector params = new Vector(); > > params.addElement(new > Parameter("IdToLookup",Element.class,custID, > Constants.NS_URI_LITERAL_XML)); > call.setParams(params); > > try > { > > resp = call.invoke(url, soapActionURI); > } > catch (SOAPException e) > { > e.printStackTrace(); > System.err.println("Caught SOAPException (" + > e.getFaultCode() + "): " + > e.getMessage()); > > } > > //Test Response fault.. > > if (!resp.generatedFault()) > { > Parameter ret = resp.getReturnValue(); > custInfo = (Element)ret.getValue(); > > System.out.println(DOM2Writer.nodeToString(custInfo)); > > > } > else > { > Fault fault = resp.getFault(); > > > System.err.println("Generated fault: " + fault); > > } > //Returning Customer Bean > return custInfo; > } > > } > > Thanks a lot > Parames > --- Scott Nichol <[EMAIL PROTECTED]> wrote: > > From where are you printing custID? The client? > > How are you > > printing it? If custID were really null, you would > > get a > > NullPointerException in the line > > > > custID.appendChild(doc.createTextNode(IdToLookUp)) > > > > On 4 Jun 2003 at 18:45, Parames wrote: > > > > > Hi > > > Yes ,im passing element.Im stuck in getting String > > > value and passing to element..... > > > Im getting Null... > > > here IdToLookUp is the string im getting from GUI > > > Where im suppose to pass element to my SERVICE.. > > > > > > > > > IdToLookUp =jTextField1.getText(); > > > > > > > > // HERE the STRING TO PASS AS ELEMENT > > > > > > DocumentBuilder xdb = > > > XMLParserUtils.getXMLDocBuilder(); > > > Document doc = xdb.newDocument(); > > > Element custID =doc.createElement("CustomerID"); > > > > > custID.appendChild(doc.createTextNode(IdToLookUp)); > > > > > > While printing custID ,im getting null.. > > > > > > Hope this time i make you clear about my doubt.. > > > Sorry for the inconvience > > > Thanks > > > parames... > > > > > > > > > > > > > > > --- Scott Nichol <[EMAIL PROTECTED]> > > wrote: > > > > I've read your post multiple times, but I still > > do > > > > not understand > > > > what you are trying to do. Your sample code > > looks > > > > like you are > > > > passing the Element as a parameter. What is it > > that > > > > you do not know > > > > how to do? > > > > > > > > On 4 Jun 2003 at 0:53, Parames wrote: > > > > > > > > > Thanks for your response , > > > > > Any i have query ,Im trying to send string as > > > > > XML(Element) to the service where service > > needs to > > > > > fetch string matching datas from database. > > > > > XML like Addressbook example.. > > > > > > > > > > Can anyone send me some code for > > > > > sending stringas element,Bcoz in service im > > > > passing > > > > > resultset to element. > > > > > Can anyone help me?? > > > > > > > > > > My GUI code > > > > > > > > > > public void actionPerformed(ActionEvent event) > > > > > { > > > > > String but = event.getActionCommand(); > > > > > if (but == "OK" ) > > > > > { > > > > > // IdToLookUp is the value i want to take > > > > > IdToLookUp =jTextField1.getText(); > > > > > > > > > > > > > > > // HERE the STRING TO PASS AS ELEMENT > > > > > > > > > > DocumentBuilder xdb = > > > > > XMLParserUtils.getXMLDocBuilder(); > > > > > Document doc = xdb.newDocument(); > > > > > Element custID = > > > > doc.createElement("CustomerID"); > > > > > > > > > > > custID.appendChild(doc.createTextNode(IdToLookUp)); > > > > > > > > > > > > > > > //make a call to soap server with customer > > ID > > > > > > > > > > try{ > > > > > > > > > > // GetCustInfo() is the SOAP CLIENT where i > > need > > > > to > > > > > pass this element... > > > > > > > > > > gci = new GetCustInfo(); > > > > > > > > > > Element element =gci.callCustSVC(customerId);} > > > > > catch (Exception e) { > > > > > e.printStackTrace(); > > > > > System.out.println("ERROR "+e); > > > > > } > > > > > } > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > Thanks in advance > > > > > Expecting to hear from you > > > > > regards > > > > > parames > > > > > > > > > > > > > > > > > > > > > > > > > __________________________________ > > > > > Do you Yahoo!? > > > > > Yahoo! Calendar - Free online calendar with > > sync > > > > to Outlook(TM). > > > > > http://calendar.yahoo.com > > > > > > > > > > > > > > > > > Scott Nichol > > > > > > > > Do not reply directly to this e-mail address, > > > > as it is filtered to only receive e-mail from > > > > specific mailing lists. > > > > > > > > > > > > > > > > > __________________________________ > > > Do you Yahoo!? > > > Yahoo! Calendar - Free online calendar with sync > > to Outlook(TM). > > > http://calendar.yahoo.com > > > > > > > > > Scott Nichol > > > > Do not reply directly to this e-mail address, > > as it is filtered to only receive e-mail from > > specific mailing lists. > > > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Calendar - Free online calendar with sync to Outlook(TM). > http://calendar.yahoo.com > Scott Nichol Do not reply directly to this e-mail address, as it is filtered to only receive e-mail from specific mailing lists.