This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Web Services and the fly likes Problem while calling methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem while calling methods" Watch "Problem while calling methods" New topic
Author

Problem while calling methods

Gopalakrishnan Thangarajan
Greenhorn

Joined: Jun 23, 2004
Posts: 1
Hai
I am using Web Service Invocation Framework from apache to call webservices.
I created an sample example which contains a method getValues() which takes a ArrayList and String as parameters and return back a String

While i am trying to execute the method getValues
it throws a exception method not found, but the method is there

Exception is :
=============

Error while executing sample, received an exception
from WSIF; details:
org.apache.wsif.WSIFException: Method getValues(class
java.util.ArrayList, class java.lang.String) was not
found in portType
{http://localhost:7001/axis/services/WSIFProdcut}WSIFProductRemote
at
org.apache.wsif.base.WSIFClientProxy.findMatchingOperation(Unknown
Source)
at
org.apache.wsif.base.WSIFClientProxy.invoke(Unknown
Source)
at $Proxy0.getValues(Unknown Source)
at Run.main(Run.java:47)




I attached the .wsdl file,my client program and the
remote interface with this.

I am using Weblogic 7, Java 1.4.2
Please help me to resolve this.

Thanks
T.Gopalakrishnan



MY WSDL FILE
============

<?xml version="1.0" encoding="UTF-8"?>
<wsdl efinitions
targetNamespace="http://localhost:7001/axis/services/WSIFProdcut"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost:7001/axis/services/WSIFProdcut"
xmlns:intf="http://localhost:7001/axis/services/WSIFProdcut"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="http://soapinterop.org/xsd"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema targetNamespace="http://xml.apache.org/xml-soap"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
</schema>
<schema targetNamespace="http://soapinterop.org/xsd"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="java.util.ArrayList">
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="item"
type="xsd:anyType"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="getValuesResponse">
<wsdl art name="getValuesReturn" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getValuesRequest">
<wsdl art name="in0" type="tns1:java.util.ArrayList"/>
<wsdl art name="in1" type="xsd:string"/>
</wsdl:message>
<wsdl ortType name="WSIFProductRemote">
<wsdl peration name="getValues" parameterOrder="in0 in1">
<wsdl:input message="impl:getValuesRequest"
name="getValuesRequest"/>
<wsdl utput message="impl:getValuesResponse"
name="getValuesResponse"/>
</wsdl peration>
</wsdl ortType>
<wsdl:binding name="WSIFProdcutSoapBinding"
type="impl:WSIFProductRemote">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl peration name="getValues">
<wsdlsoap peration soapAction=""/>
<wsdl:input name="getValuesRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://DefaultNamespace" use="encoded"/>
</wsdl:input>
<wsdl utput name="getValuesResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost:7001/axis/services/WSIFProdcut" use="encoded"/>
</wsdl utput>
</wsdl peration>
</wsdl:binding>
<wsdl:service name="WSIFProductRemoteService">
<wsdl ort binding="impl:WSIFProdcutSoapBinding"
name="WSIFProdcut">
<wsdlsoap:address
location="http://localhost:7001/axis/services/WSIFProdcut"/>
</wsdl ort>
</wsdl:service>
</wsdl efinitions>


MY REMOTE INTERFACE
===================

import java.util.ArrayList;

public interface WSIFProductRemote extends javax.ejb.EJBObject{
public String getValues(ArrayList arrayList,String args) throws
java.rmi.RemoteException;
}


MY CLIENT PROGRAM
=================

import org.apache.wsif.WSIFService;
import org.apache.wsif.WSIFServiceFactory;
import org.apache.wsif.WSIFException;
import javax.xml.namespace.QName;
import java.rmi.RemoteException;



public class Run {
public static void main(String[] args) {
try {

java.util.ArrayList al =new java.util.ArrayList();
al.add("Test Value");

// create a service factory
WSIFServiceFactory factory =
WSIFServiceFactory.newInstance();

// parse WSDL
WSIFService service =
factory.getService(
"C:/WSIF/wsif/WSIFProdcut.wsdl",
null,
null,
"http://localhost:7001/axis/services/WSIFProdcut",
"WSIFProductRemote");
// map types
service.mapType(
new
QName("http://localhost:7001/axis/services/WSIFProdcut", "ArrayList"),
Class.forName(
"java.util.ArrayList"));

// create the stub
WSIFProductRemote stub = (WSIFProductRemote)
service.getStub(WSIFProductRemote.class);
// do the invocation
// args[1] is the zip code
String zipInfo = stub.getValues(al,"hello");
System.out.println(zipInfo);
} catch (WSIFException we) {
System.out.println(
"Error while executing sample, received an exception
from WSIF; details:");
we.printStackTrace();
} catch (RemoteException re) {
System.out.println(
"Error while executing sample, received an exception
due to remote invocation; details:");
re.printStackTrace();
} catch (Exception e) {
System.out.println("Exception E == > "+ e );
}
}

}
 
GeeCON Prague 2014
 
subject: Problem while calling methods