I am trying to invoke a .Net webservice using WSIF but encountered a "Method was not found" error below:
=============================================================
F:\Apache\wsif-2.0>java org.tempuri.Run
- 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/'
Error while executing sample, received an exception from WSIF; details:
org.apache.wsif.WSIFException: Method getServiceDtls(class java.lang.String) was not found in portType {http://tempuri.org/}ServiceSoap
at org.apache.wsif.base.WSIFClientProxy.findMatchingOperation(Unknown Source)
at org.apache.wsif.base.WSIFClientProxy.invoke(Unknown Source)
at $Proxy0.getServiceDtls(Unknown Source)
at org.tempuri.Run.main(Run.java:52)
=============================================================
Not sure if you could help but to give you some background, I have extracted some code from my application in the sections below.
My Run.java is written similar to the SimpleSoap.java sample in the WSIF website as follows:
=============================================================
package org.tempuri;
import org.apache.wsif.WSIFService; import org.apache.wsif.WSIFServiceFactory; import org.apache.wsif.WSIFException; import java.rmi.RemoteException;
import org.tempuri.ServiceSoap;
public class Run {
public static void main(String[] args) {
try { // create a service factory
WSIFServiceFactory factory = WSIFServiceFactory.newInstance();// parse WSDL
WSIFService service =
factory.getService( "http://ma4is_win2003/niftyws/service.asmx?WSDL",
null,
null,
"http://tempuri.org/",
"ServiceSoap");
// create the stub
ServiceSoap stub =
(ServiceSoap) service.getStub(
ServiceSoap.class); // do the invocation
ServiceDtlsResult ret = stub.getServiceDtls("91234567");} 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();
}
}
=============================================================
The interface file ServiceSoap.java generated by Axis WSDL2Java is as follows:
=============================================================
/**
* ServiceSoap.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package org.tempuri;
public interface ServiceSoap extends java.rmi.Remote {
public org.tempuri.ServiceDtlsResult getServiceDtls(java.lang.String sService) throws java.rmi.RemoteException;
public org.tempuri.ServiceComponentResult getServiceComponents(java.lang.String sService) throws java.rmi.RemoteException;
public org.tempuri.StandardStringResult validateCustIdNDOBWithService(java.lang.String sService, java.lang.String sCustID, java.lang.String sCustIDType, java.lang.String sDOB) throws java.rmi.RemoteException;
}
=============================================================
The webservice's sample SOAP request is as follows: ============================================================= POST /niftyws/service.asmx HTTP/1.1 Host: ma4is_win2003 Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://tempuri.org/GetServiceDtls"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetServiceDtls xmlns="http://tempuri.org/">
<sService>string</sService>
</GetServiceDtls>
</soap:Body>
</soap:Envelope>
=============================================================
A discrepancy I see is that the first letter for the method getServiceDtls(class java.lang.String), i.e. 'g', is different from that of the tag <GetServiceDtls xmlns="http://tempuri.org/">, i.e. 'G', in the soap request document.
I'm not sure if this is the problem.
Appreciate any advice.
Regards, Fabian Chew.
_________________________________________________________________
Keep track of Singapore & Malaysia stock prices. http://www.msn.com.sg/money/
