Mortin kim

Ranch Hand
+ Follow
since Nov 15, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Mortin kim

Hi.,
I have one simple problem..on how to read xml doc nested same element..

Problem is like this :

XML File :
a sample xml file

<testxml>
<sonname>
<Fname>aaa</Fname>
<Lname>bbb</Lname>
</sonname>
<Fathername>
<Fname>aaa</Fname>
<Lname>bbb</Lname>
</Fathername>
</testxml>

to papulate the values into filed I am doing like this..

document.getElementById('Fname').value = xmlDoc.getElementsByTagName("Fname")[0].childNodes[0].nodeValue;
document.getElementById('Lname').value = xmlDoc.getElementsByTagName("Lname")[0].childNodes[0].nodeValue;

But how to get the nested same elment Fname,Lname of <Fathername> node..?

Thanks
Kim
Hi.,
I am trying to implement auto Complete application using AJAX and java where the input fields that attempt to second guess what your user is typing based on live data.

can any one guide or is there any link to get the details of this implementation.

Thanks
Kim
HI
I need to generate WSDL file using java2wsdl but
I am getting ClassNotFoundException using Java2WSDL command.
let me brief.

1. I have created a interface and implementtaion class

public interface Fibonacci {
public int calculateFibonacci( int num );
public int[] calculateFibonacciRange(int start, int stop);
}
public class FibonacciImpl {
public int calculateFibonacci( int num ) {
if (num <= 0) return 0;
if (num == 1) return 1;
int previous1 = 1, previous2 = 0, fib = 0;
for (int i=2; i <= num; i++) {
// the fib is the answer of the previous two answers
fib = previous1 + previous2;
// reset the previous values
previous2 = previous1;
previous1 = fib;
}
return fib;
}
These 2 are under my workspace C:\workspace\TestWS\src\com\ibm\test\

and i have my axis in under tomcat :C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\axis

so ran this command at this path ( C:\workspace\TestWS\src\com\ibm\test\ )
like this :

java org.apache.axis.wsdl.Java2WSDL -o fib.wsdl -l"http://localhost:8080/axis/services/fibonacci" -n urn:fibonacci -p"fibonacci" urn:fibonacci fibonacci.Fibonacas i am new to webservices can any one tell me how to run this java2wsdl commnd and where to run this commnd

Suggenstions are highly appreciated.

KIM.
16 years ago
HI
I need to generate WSDL file using java2wsdl but
I am getting ClassNotFoundException using Java2WSDL command.
let me brief.

1. I have created a interface and implementtaion class

public interface Fibonacci {
public int calculateFibonacci( int num );
public int[] calculateFibonacciRange(int start, int stop);
}
public class FibonacciImpl {
public int calculateFibonacci( int num ) {
if (num <= 0) return 0;
if (num == 1) return 1;
int previous1 = 1, previous2 = 0, fib = 0;
for (int i=2; i <= num; i++) {
// the fib is the answer of the previous two answers
fib = previous1 + previous2;
// reset the previous values
previous2 = previous1;
previous1 = fib;
}
return fib;
}
These 2 are under my workspace C:\workspace\TestWS\src\com\ibm\test\

and i have my axis in under tomcat :C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\axis

so ran this command at this path ( C:\workspace\TestWS\src\com\ibm\test\ )
like this :

java org.apache.axis.wsdl.Java2WSDL -o fib.wsdl -l"http://localhost:8080/axis/services/fibonacci" -n urn:fibonacci -p"fibonacci" urn:fibonacci fibonacci.Fibonacas i am new to webservices can any one tell me how to run this java2wsdl commnd and where to run this commnd

Suggenstions are highly appreciated.

KIM.
16 years ago
HI
Can any one tell me how to configure Struts 1 (or struts 2) in Eclipse3.3.

what I did is downloded eclipse 3.3 from eclipse site and tried to creat a struts project by right clicking on the project to add struts support,but I am not able to find Struts support option.
do I need to add any plug-in to configure struts in eclipse,if so where can I get Struts plug-in for eclipse,seached in google but not able to find proper responce.
any Suggestion are appriciated.

Thanks
Kim.
HI here is the class I writen,i am able to get the connection and constructed SOAP msg too this is publically available webservice can you please tell how to proceed further..it will great help.

import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
public class TestClient {
public static void main(String [] args) {
try {
// Construct data

String soapMsg = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web="+"http://www.webserviceX.NET/\">";
st1 = st1 +"<soapenv:Header/> <soapenv:Body> <web:GetQuote> <web:symbol>"+"GOOG"+"</web:symbol> </web:GetQuote> </soapenv:Body> </soapenv:Envelope>";

String data = URLEncoder.encode(soapMsg, "UTF-8");
// Send data
URL url = new URL("http://www.webservicex.net/stockquote.asmx?wsdl");
URLConnection conn = url.openConnection();
System.out.println("Url Connection "+conn);
16 years ago
HI.,
can any one tell me
What is http POST and http get..
where we are using these and how tey will work..what is the difference



Kim.
16 years ago
HI
can any one help me out to slove this problem.
I need to invoke a webservice
i have a wsdl file Stockquotes.wsdl file
based on this i have constructed an input SOAP msg
like this
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET/">
<soapenv:Header/>
<soapenv:Body>
<web:GetQuote>
<!--Optional:-->
<web:symbol>GOOG</web:symbol>
</web:GetQuote>
</soapenv:Body>
</soapenv:Envelope>

from java i will construct a String with this SOAP.

now my Doubt is how to send this SOAP msg to hit that wsdl and to get responce.
please address me how to create a stand alone java class with this soap msg to get the responce.

Mortin.
16 years ago
Hi
I am Using WSAD 5.1
I wanted to upgrade it with java 1.5
can any one please tell how to do it..?

What I did is :
I installed the java 1.5 in my machine any from WSAD -> window -> preference -> java ->Installed JREs
I pointed new new installed jre dir (C:\Program Files\Java\jdk1.5.0_15\jre\lib)
and when I am trying run my java programe it is giving the fallowing error

Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

Hope you you under the problem


KIM.
can any one please tell,How to change the password of my username ..?
16 years ago
HI.,
I am trying to invoke one webservices.
What i have is wsdl file,By using this i need to generate JAVA stubs.
for that do i need to use wsdl2java command.
can any one tell me the steps to generate java stubs using wsdl2java command using AXIS 1.4 api.

Thanks for your time.
Kim.
16 years ago
HI.,
I Have one problem..IN reading WSDL file..
my senario is like this..
if i got WSDL file..i need to find out what are all the webservcies available and what are in input message and out put mesaages..for the wsdl..using some java apis..like xml-rpc,JAXb..any java related APIs
please suggest me any solution to do this..

Kim
16 years ago
HI.,
Can any one tell me how to parse the XSD which is there is WSDl.
My problem is getting elements and their types from XSD.

like i need to invoke some service frmo WSDl for that i need to know what is the XML input and XML output for that i need to get XML schema and that elements


any code will be most appreciatble.

Thanks
Kim.
HI.,
I Have one problem..
I need to get The response from a WSDL.Which contains XSD.
I am able to get All the services and Portypes.
But i am not able to get the XSD elements..
can any one tell me how to get XSD from WSDL using Java.is there is any API to do this.



Breaf: Want to get XSD from WSDL(like SOAP request or Responce)


any code would be most appreciatable.

KIM.
16 years ago
Hi.,
I want know what are the services are there in WSDL,What is the INPUT and OUTPUT xmls formats for the WSDL.I am wariting one stand alone programe to get all these.can you please tell me How achive this senario.
i am a beginer of Webservcies.


Here is the WSDL File fallowing is My JAVA programe..

<?xml version="1.0" encoding="UTF-8"?>
<definitions
name="WeatherSummary"
targetNamespace=
"http://www.roguewave.com/soapworx/examples/WeatherSummary.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns=
"http://www.roguewave.com/soapworx/examples/WeatherSummary.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsx=
"http://www.roguewave.com/soapworx/examples/WeatherSummary.xsd">

<types>
<xsd:schema
targetNamespace=
"http://www.roguewave.com/soapworx/examples/WeatherSummary.xsd"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="WeatherSummary">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="zipcode"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="windSpeed"
nillable="true" type="xsd:unsignedInt"/>
<xsd:element maxOccurs="1" minOccurs="1" name="sky"
nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="temp"
nillable="true" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>

<message name="getSummary">
<part name="zipcode" type="xsd:string"/>
</message>
<message name="updateWeather">
<part name="weatherData" type="wsx:WeatherSummary"/>
<part name="port" type="xsd:string"/>
<part name="transportName" type="xsd:string"/>
<part name="weatherData" type="wsx:WeatherSummary"/>
</message>
<message name="getSummaryResponse">
<part name="weatherData" type="wsx:WeatherSummary"/>
</message>
<portType name="WeatherSummary">
<!-- request-responserequest-response -->
<operation name="getSummary">
<input message="tns:getSummary"/>
<output message="tns:getSummaryResponse"/>
</operation>
<!-- One-way -->
<operation name="updateWeather">
<input message="tns:updateWeather"/>
</operation>
<!-- Notification -->
<operation name="weatherNotification">
<output message="tns:getSummaryResponse"/>
</operation>
</portType>

<binding name="WeatherSummary" type="tns:WeatherSummary">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getSummary">
<soap peration soapAction="getSummary"/>
<input>
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.roguewave.com/soapworx/examples"/>
<soap:header message="tns:getSummary" part="header" use="literal"/>
</input>
<output>
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.roguewave.com/soapworx/examples"/>
</output>
</operation>
<operation name="updateWeather">
<soap peration soapAction="updateWeather"/>
<input>
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.roguewave.com/soapworx/examples"/>
</input>
</operation>
<operation name="weatherNotification">
<soap peration soapAction="weatherNotification"/>
<output>
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.roguewave.com/soapworx/examples"/>
</output>
</operation>
</binding>

<service name="WeatherSummary">
<documentation>WeatherSummary</documentation>
<port name="WeatherSummary" binding="tns:WeatherSummary">
<soap:address
location="http://localhost:8090/weather/WeatherSummary"/>
</port>
</service>
</definitions>



JAVA Program:
-------------

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import javax.wsdl.Definition;
import javax.wsdl.Message;
import javax.wsdl.WSDLException;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
import javax.xml.namespace.QName;

public class TestWSDL {
// WSDL Factory
private static WSDLFactory factory;
// WSDL Reader
private static WSDLReader reader;
public static void main(String[] args)
{
String wsdlFileName = "C:\\Documents and Settings\\Satya\\Desktop\\WEB SERVICES\\WeatherSummary.wsdl";
try {
System.out.println("WSDL FILE :: "+wsdlFileName);
factory = WSDLFactory.newInstance();
reader = factory.newWSDLReader();
Map sampleMap = new HashMap();
Definition def = reader.readWSDL(null, wsdlFileName);
sampleMap = def.getAllServices();

for (Iterator iter = sampleMap.keySet().iterator(); iter.hasNext() {
QName qName = (QName) iter.next();

System.out.println(" SERVICE KEY :" + qName.getLocalPart());

}


}
catch (WSDLException e) {
System.out.println("Can't create WSDLFactory: " + e.getMessage());

}

}

}


any sample code will be a great help for me..

Thanks
KIM.
16 years ago