Swastik
Swastik
Swastik
Swastik
Swastik
ruchita mahajan wrote:i downlaoded the axis2.war and imported it and executed it in my eclipse ide.its working fine there giving me the happiness page of axis2.
but when i create the client api it is not working.
here i am sending you the client api that i have written in java to consume the webservice.
may be i am missing something.
so please i need your guidence.
thanks a lot for you guys reply
package org.apache.axis2.webapp;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.databinding.types.soapencoding.String;
public class Clientapi {
public static void main(String args[]) throws Exception {
ServiceClient client = new ServiceClient();
// create option object
Options opts = new Options();
//setting target EPR
opts.setTo(new EndpointReference("http://192.168.1.26/MapMakerWrapper/service1.asmx"));
//Setting action ,and which can be found from the wsdl of the service
opts.setAction("http://tempuri.org/VMM_CreateMap");
client.setOptions(opts);
//client.setOptions2(width);
//client.setOptions3(height);
OMElement res = client.sendReceive(createPayLoad());
System.out.println(res);
//System.out.println(System.getProperty("java.version"));
}
public static OMElement createPayLoad() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://tempuri.org/", "ns1");
OMElement method = fac.createOMElement("VMM_CreateMap", omNs);
OMElement value = fac.createOMElement("24018", omNs);
value.setText("client Api");
method.addChild(value);
return method;
}
}
ruchita mahajan wrote:i downlaoded the axis2.war and imported it and executed it in my eclipse ide.its working fine there giving me the happiness page of axis2.
but when i create the client api it is not working.
here i am sending you the client api that i have written in java to consume the webservice.
may be i am missing something.
so please i need your guidence.
thanks a lot for you guys reply
package org.apache.axis2.webapp;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.databinding.types.soapencoding.String;
public class Clientapi {
public static void main(String args[]) throws Exception {
ServiceClient client = new ServiceClient();
// create option object
Options opts = new Options();
//setting target EPR
opts.setTo(new EndpointReference("http://192.168.1.26/MapMakerWrapper/service1.asmx"));
//Setting action ,and which can be found from the wsdl of the service
opts.setAction("http://tempuri.org/VMM_CreateMap");
client.setOptions(opts);
//client.setOptions2(width);
//client.setOptions3(height);
OMElement res = client.sendReceive(createPayLoad());
System.out.println(res);
//System.out.println(System.getProperty("java.version"));
}
public static OMElement createPayLoad() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://tempuri.org/", "ns1");
OMElement method = fac.createOMElement("VMM_CreateMap", omNs);
OMElement value = fac.createOMElement("24018", omNs);
value.setText("client Api");
method.addChild(value);
return method;
}
}
Today's lesson is that you can't wear a jetpack AND a cape. I should have read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|