I want to create an Axis client for a web service with local wsdl, without knowing the wsdl's url. I've tried the Dynamic Invocation Interface method as in this tutorial http://www.ibm.com/developerworks/webservices/library/ws-javaclient/index.html but I get the following error:
AxisFault faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode: faultString: No client
transport named 'null' found!
faultActor: faultNode: faultDetail:
{http://xml.apache.org/axis/}stackTrace:No
client transport named 'null' found!
at
org.apache.axis.client.AxisClient.invoke(AxisClient.java:170)
My code is:
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(new QName("http://j2ee.netbeans.org/wsdl/CompositionBpelModule/ComposedWebServiceService","ComposedWebServiceServiceService"));
Call call = service.createCall();
call.setPortTypeName(new QName("http://j2ee.netbeans.org/wsdl/CompositionBpelModule/ComposedWebServiceService","ComposedWebServiceServicePortType"));
call.setProperty(Call.OPERATION_STYLE_PROPERTY, "wrapped");
call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY, "");
call.setReturnType(XMLType.XSD_STRING);
call.setOperationName(new QName("http://j2ee.netbeans.org/wsdl/CompositionBpelModule/ComposedWebServiceService", "ComposedWebServiceServiceOperation"));
call.addParameter("input1", XMLType.XSD_STRING, ParameterMode.IN);
String[] params = {input};
response = (String)call.invoke(params);
Thank you
Best Solution
I had the same problem as yours. After digging for hours, it seems like I've almost solved this problem. This exception occurs because of missing set target endpoint address Here is my code
The value of targetEndpoint agument is the value of location attribute of address element inside port element. Here is an example
You can get this value by retrieving wsdl document using some wsdlParser (I use Axis's WSDL4J) (Note that in the code example above, I have hardcoded the targetEndpoint value)
Moreover, I set
OPERATION_STYLE_PROPERTY
to rpc style andENCODINGSTYLE_URI_PROPERTY
to http://schemas.xmlsoap.org/soap/encoding/ (this is default value) Here is the document I found to solve this problemHope that help you! Sorry for my bad English.