wood burning stoves 2.0*
The moose likes Web Services and the fly likes WSIFException : invoking web service mthod Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "WSIFException : invoking web service mthod" Watch "WSIFException : invoking web service mthod" New topic
Author

WSIFException : invoking web service mthod

Rizwan Patel
Ranch Hand

Joined: Jan 03, 2008
Posts: 59
Hi I am new to this concept. I written the below client code to invoke the web service method provided at my localhost:8080 Only one method is being provided currently.

ClientCode
package clientsidecode.HelloClient;

import java.util.Iterator;
import org.apache.wsif.WSIFMessage;
import org.apache.wsif.WSIFOperation;
import org.apache.wsif.WSIFPort;
import org.apache.wsif.WSIFService;
import org.apache.wsif.WSIFServiceFactory;

import javax.xml.namespace.QName;
public class HelloWorld {

/**
* @param args
*
*/

public static void main(String[] args) throws Exception {
System.out.println("Start -- 1");
String str1="Rizwan";



WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
String wsdlloc="http://localhost:8080/axis2/services/HelloWorld?wsdl";
System.out.println(" -- 2 --");
WSIFService service = factory.getService(wsdlloc,null,null ,"http://hello","HelloWorldPortType");
service.mapType(new QName("http://hello/xsd","HelloWorld"),Class.forName("clientsidecode.HelloClient.HelloWorld"));
WSIFPort port = service.getPort("HelloWorldSOAP11port_http");
System.out.println("-- 3--");
WSIFOperation operation=port.createOperation("sayHello");
WSIFMessage input = operation.createInputMessage("str_1");
WSIFMessage output =operation.createOutputMessage();
WSIFMessage fault = operation.createFaultMessage();
input.setObjectPart("str_1",str1);
String str_2="Hi";
System.out.println("Input Message"+input);
System.out.println("Input parts : "+input.getObjectPart("str_1"));
//input.setObjectPart("part1",str_2);

if(operation.executeRequestResponseOperation(input,output,fault))
{
System.out.println("Result : "+output.getIntPart("return"));
}
// TODO Auto-generated method stub
System.out.println("End");

}

}


Output Error :

Start -- 1
Exception in thread "main" org.apache.wsif.WSIFException: exception on AXIS invoke: Exception occurred while trying to invoke service method sayHello; nested exception is:
Exception occurred while trying to invoke service method sayHello
at org.apache.wsif.providers.soap.apacheaxis.WSIFOperation_ApacheAxis.invokeAXISDocStyle(Unknown Source)
-- 2 --
- WSIF0006W: Multiple WSIFProvider found supporting the same namespace URI 'http://schemas.xmlsoap.org/wsdl/soap/'. Found ('org.apache.wsif.providers.soap.apacheaxis.WSIFDynamicProvider_ApacheAxis, org.apache.wsif.providers.soap.apachesoap.WSIFDynamicProvider_ApacheSOAP')
- WSIF0007I: Using WSIFProvider 'org.apache.wsif.providers.soap.apacheaxis.WSIFDynamicProvider_ApacheAxis' for namespaceURI 'http://schemas.xmlsoap.org/wsdl/soap/'
-- 3--
Input Messageorg.apache.wsif.base.WSIFDefaultMessage@c2a132 name:str_1
Input parts : Rizwan
at org.apache.wsif.providers.soap.apacheaxis.WSIFOperation_ApacheAxis.invokeRequestResponseOperation(Unknown Source)
at org.apache.wsif.providers.soap.apacheaxis.WSIFOperation_ApacheAxis.executeRequestResponseOperation(Unknown Source)
at clientsidecode.HelloClient.HelloWorld.main(HelloWorld.java:41)
Caused by: Exception occurred while trying to invoke service method sayHello
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:135)
at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:942)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1528)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:232)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:546)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:377)
at org.apache.axis.client.Call.invokeEngine(Call.java:2132)
at org.apache.axis.client.Call.invoke(Call.java:2102)
at org.apache.axis.client.Call.invoke(Call.java:1851)
at org.apache.axis.client.Call.invoke(Call.java:1777)
at org.apache.axis.client.Call.invoke(Call.java:1315)
... 4 more


scjp 1.5, OCPJWSD 5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WSIFException : invoking web service mthod
 
Similar Threads
JAXRPCTIE01: caught exception while handling request
WSIFException : invoking service method
ClassCastException with EJB access ...
Exception while calling the _call.invoke(), please Help
AXIS Stubs Problem and unable to consume EJB web service