Hai
Thanks for the Reply,
Since we are implementing WSIF in existing framework i
can't change the parameter type from ArrayList to an
Array.
I fixed that problem and i am facing a new problem
now.While i am trying to execute the method getValues
it throws an exception
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.
Please help me to resolve this.
=======================================================
--- Aleksander Slominski <[EMAIL PROTECTED]>
wrote: > hi,
>
> please post a complete example so exact problem can
> be reproduced.
>
> also generally speaking ArrayList (List) and
> Hashtable (Map) are Java
> specific types and it is better to use native java
> arrays as they better
> map to interoperable XML.
>
> alek
>
> T Gopalakrishnan wrote:
>
> >Hai Friends
> >
> >I am very new to WSIF. I created an .wsdl file
> using
> >AXIS and i created an client file to call the
> >webservice.
> >
> >my method definition is like this
> >
> >public Hashtable getValues(ArrayList al, String
> arg1)
> >
> >I have few doubts over it..
> >how we can map the java.util.Arraylist to
> WSIFService.
> >
> >In examples Apache provides there are ways to map
> the
> >complex objects but not ArrayList or Hashtable.
> >
> >I declared the following Mapping
> >
> >service.mapType(
> > new
>
>QName("http://localhost:7001/axis/services/GetValues",
> >"java.util.ArrayList"),
> > Class.forName(java.util.ArrayList"));
> >
> >And i tried to get the Stub using the following
> >command
> > ProductRemote stub = (ProductRemote)
> >service.getStub(ProductRemote.class);
> >
> >It throws the following exception
> >
> >org.apache.wsif.WSIFException: Method toString is
> not
> >in interface ProductRemote
> >java.lang.reflect.UndeclaredThrowableException
> > at $Proxy0.toString(Unknown Source)
> > at java.lang.String.valueOf(Unknown Source)
> > at java.lang.StringBuffer.append(Unknown Source)
> > at Run.main(Run.java:51)
> >Caused by: org.apache.wsif.WSIFException: Method
> >toString is not in interface ProductRemote
> > at
>
>org.apache.wsif.base.WSIFClientProxy.findMatchingOperation(Unknown
> >Source)
> > at
> >org.apache.wsif.base.WSIFClientProxy.invoke(Unknown
> >Source)
> > ... 4 more
> >
> >Can any one help me to resolve this issue
> >
> >=====
> >Thanks and Regards
> >T.Gopalakrishnan
> >
> >=====
> >Thanks and Regards
> >T.Gopalakrishnan
> >
> >
> >
> >
> >
>
>____________________________________________________________
> >Yahoo! Messenger - Communicate instantly..."Ping"
> >your friends today! Download Messenger Now
> >http://uk.messenger.yahoo.com/download/index.html
> >
> >
>
>
> --
> The best way to predict the future is to invent it -
> Alan Kay
>
=====
Thanks and Regards
T.Gopalakrishnan
____________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.htmlMY WSDL FILE
============
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions 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:part name="getValuesReturn" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getValuesRequest">
<wsdl:part name="in0" type="tns1:java.util.ArrayList"/>
<wsdl:part name="in1" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="WSIFProductRemote">
<wsdl:operation name="getValues" parameterOrder="in0 in1">
<wsdl:input message="impl:getValuesRequest" name="getValuesRequest"/>
<wsdl:output message="impl:getValuesResponse" name="getValuesResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WSIFProdcutSoapBinding" type="impl:WSIFProductRemote">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getValues">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getValuesRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://DefaultNamespace" use="encoded"/>
</wsdl:input>
<wsdl:output name="getValuesResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost:7001/axis/services/WSIFProdcut" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="WSIFProductRemoteService">
<wsdl:port binding="impl:WSIFProdcutSoapBinding" name="WSIFProdcut">
<wsdlsoap:address location="http://localhost:7001/axis/services/WSIFProdcut"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
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 );
}
}
}