DhaKatta Dha

Greenhorn
+ Follow
since Aug 25, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by DhaKatta Dha

Ivan Krizsan wrote:Hi!
Have you tried to issue requests to the service using soapUI or some similar program?
This to isolate the problem to the client side.
Best wishes!



Hi Ivan,

Yes I tried soap UI is not even connecting to the server provider. It has some proxy prolems which I resolved in my java by setting through java code. So I could connect through eclipse but not soapUI.

But I'm trying to see what could cause such problems that I encountered about endpoint?

Could you please give me some solution?

Regards
-Katta
8 years ago
Hi All,

This is very urgent requirement. I'm wrote a webservice client for an external service using http.

I can paste the code below. I'm getting a exception shown below If I try to use the service hosted.

Exception in thread "main" org.apache.axis2.AxisFault: Endpoint {http://www.dolby.com/dcinema/ws/smi/v1}ContentManagementService_v1_0 does not contain operation meta data for: {http://www.dolby.com/dcinema/ws/smi/v1/getClipInfosResponse}getClipInfosResponse
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:548)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
at com.dolby.www.dcinema.ws.smi.v1.testserviceClient.main(testserviceClient.java:33)


So can anybody please help me the probable cause for this type of exceptions.
Its really urgent. Please help..
Best Regards
-katta
8 years ago
Hi Gudi,

Could you please send me sample code how did you test the client side stubs and code to make a call to a service using the stub.

Regards
-Dha

gudim gudi wrote:server is tomcat 6.0 running on my same laptop. Not really sure what is blocking. Please advise

8 years ago
Hi Navin,

Could you please share your experience with axis2 in eclipse using java.

I have a eclipse and wsdl given to me I know how to generate code using axis plugins. My question is how do I test the webservice as stub?

Regards
-Dha

Navin Pillu wrote:Hi All

I'm also new to Web Service & eagerly want to learn it. I've done it using Axis tool. But i want to do it in a way that is most appropriate.
Could anybody tell which book has most practical oriented approach, please.

Thanks
Navin

8 years ago
Hi Ruchita,

This is really quick which I forgot to mention earlier.

Could you please make me understand how do you conusme the webservic eusing your code may be some inline comments in your code below.

Best Regards



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;
}

}

8 years ago
Hi Ruchita,

I have seen your question to generate a webservice stub and consume a webservice using axis.

Its very useful to me as a first timer. Can you please explain me what is "http://tempuri.org/VMM_CreateMap" I want to similar task by using eclipse,axis2 and wsdl.

I'm at a point with axis2 setup ready and wsdl2java is also ready. I want to make a call using the stub I have where are you using the generated stub?

Please explain your code.

Thank you very much
-Tankatta

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;
}

}

8 years ago
Hi Alex,

I'm posting some part of my wsdl for understanding to make a call to the url and call any serice from the wsdl and its methos and about QName used in the client code.

<wsdl:definitions name="TransferManagement_v1"
targetNamespace="http://www.dolby.com/dcinema/ws/smi/v1"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.dolby.com/dcinema/ws/smi/v1"
xmlns:tra="http://www.dolby.com/dcinema/ws/smi/v1/schemas/transfermanagement"
xmlns:com="http://www.dolby.com/dcinema/ws/smi/v1/schemas/common"
xmlns:flt="http://www.dolby.com/dcinema/ws/smi/v1/schemas/fault"
xmlns:v1_0="http://www.dolby.com/dcinema/ws/smi/v1_0"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<!-- Request/Response Schema Definitions -->

<wsdl:types>
<xsd:schema targetNamespace="http://www.dolby.com/dcinema/ws/smi/v1_0">

<xsd:import schemaLocation="TransferManagement.xsd" namespace="http://www.dolby.com/dcinema/ws/smi/v1/schemas/transfermanagement"/>
<xsd:import schemaLocation="Common.xsd" namespace="http://www.dolby.com/dcinema/ws/smi/v1/schemas/common"/>
<xsd:import schemaLocation="Fault.xsd" namespace="http://www.dolby.com/dcinema/ws/smi/v1/schemas/fault"/>

<!-- transferContent elements -->

<xsd:element name="transferContentRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="transferType" type="tra:NetworkTransferType" minOccurs="0"/>
<xsd:element name="transferProtocolType" type="tra:TransferProtocolType" minOccurs="0"/>
<xsd:element name="contentType" type="com:ContentType" minOccurs="0"/>
<xsd:element name="auditoriumNumber" type="xsd:string" minOccurs="0"/>
<xsd:element name="destinationContentStore" type="com:ContentStoreType" minOccurs="0"/>
<xsd:element name="url" type="xsd:anyURI"/>
<xsd:element name="userName" type="xsd:string" minOccurs="0"/>
<xsd:element name="password" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>




Other part in the bottm is:

<wsdl:binding name="TransferManagementBinding_v1_0" type="tns:TransferManagementService_v1_0">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdlperation name="transferContent">
<soapperation soapAction="http://www.dolby.com/dcinema/ws/smi/v1/transferContent"/>
<wsdl:input name="transferContentRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdlutput name="transferContentResponse">
<soap:body use="literal"/>
</wsdlutput>
<wsdl:fault name="transferContentFault">
<soap:fault name="transferContentFault" use="literal"/>
</wsdl:fault>
</wsdlperation>
8 years ago
Hi Alex,

After your response this is my second message.

I have done something like this based on what I understood. My question is how do I call the wsdl by connecting to the server. I thin k QName is used for calling a service in the WSDL am I right?

import java.rmi.RemoteException;

import javax.xml.namespace.QName;


import org.apache.axis2.AxisFault;
import org.apache.axis2.client.ServiceClient;
import com.dolby.www.dcinema.ws.smi.v1.TransferManagement_v1_0Stub.TransferContentRequest;
import com.dolby.www.dcinema.ws.smi.v1.TransferManagement_v1_0Stub.TransferContentResponse;

public class testTransfer {
public static void main(String args[]) throws RemoteException, Fault{

TransferManagement_v1_0Stub TMS=new TransferManagement_v1_0Stub();
ServiceClient sc=TMS._getServiceClient();

sc=TMS._getServiceClient();
sc.addStringHeader(new QName("",""),"" );
com.dolby.www.dcinema.ws.smi.v1.TransferManagement_v1_0Stub tmStub=new com.dolby.www.dcinema.ws.smi.v1.TransferManagement_v1_0Stub();
TransferContentRequest trReq=new TransferContentRequest();
trReq.setUserName("");
trReq.setPassword("");
//trReq.setUrl();
TransferContentResponse tcresponse=tmStub.transferContent(trReq);
System.out.println(tcresponse.getTransferId());


}
8 years ago
Hi Alex,

Thank you very much for your reply. Its very helpful to me. I'm working on the code. I will post the resply soon after testing it. Because it being the external server may take some time to get connection as wen have to notify the server to be up ahead of time.

Still the question aI have is for this to be build and deploy do I need just axis and tomcat any ant/maven?

Can you please explain me the deployment steps.

If it is handed over to thirdparty what dependencies can I tell them to use?

But this reply from you is very much understandable.

Regards
-Katta
8 years ago
Hi Alex,

Thank you very much for your reply. I have the wsdl but its not a url as its given as .wsdl to me. Yes we definitly need credentials for username and password.

We need to connect to that external server through username and password then call the service and its method.

I installed axis2 as plugin to eclipse galilio with axis2 code gen and axis2 service archiver.

So far what I did is I created a dynamic project and tomcat 6.0.20 server added to it and pasted the wsdl under webcontent by creating wsdl folder. Then by right clicking the wsdl file->new->Web service client and it generated 2 java classes. stub and callbackhandler(I choose both for sync and async for client).

Now my question is how do I make a call to the service with a url is it by using the stub instance?Shall I create new java class and call a method in
my wsdl I have a request method with parameters for username/password,url.
Is that the way we have to work with axis and eclipse galilio with the autogenerated stub and callbackhandler?

I'm not able to send my wsdl?

Here are the dependent xsds for the wsdl.

Transfermanagement.xsd there are 2 more dependent xsd not giving here and you may not be able to generate the client as this message is getting too bigger.
if you have the mailid I can send to you.

Regards
Katta

8 years ago
Hey Alex,

Thank you very much for your reply. I have read this article before and I have questions in it.

1. My service which I call is not in my local axis server. It a remote service running in external server.
2. I have to get connected to that remote server through its IP and then make a call to that service.

3. The question related to this tutorial is it generated 2 classes called stub and callbackhandler. Both java classes. How do I code the call to make to the service.

Do I edit the stub class or just make an instance of stub and call the service and its method in a different java class just for calling the service? Some examples online gave service client calls instance some examples gave servicelocator class instance. When do we use which in my eclipse with the generated classes (stub and callbackhandler) how do i make a call to the service?

Can you please give me the steps

8 years ago
Hi,

I'm new to webservice client code calling from external service in different machine with given ipaddress. I would need to generate a client call and call one service and add logic to it using axis2 ,eclipse galilio.

Please provide me steps and how to deploy it if the service is not in our local axis2 server.

Regards
-TanKatta
8 years ago