can anyone help me?
adamzrk May 30, 2006 11:17 AMHi
I have got the question - how to invoke the web service - ( jsr181 ejb3 as endpoint from examples) from standalone client? I tried everything from docs but nothing works. Problem is: i have added one method which param is simple class with two properties and always i have exception:
Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://org.mazurek.ws/jsr181ejb}Param
My client code:
ServiceFactory factory = ServiceFactory.newInstance(); URL wsdlLocation = new URL("http://localhost:8080/jsr181ejb/EJB3Bean?wsdl"); QName serviceName = new QName("http://org.mazurek.ws/jsr181ejb", "MyService"); ServiceImpl service = (ServiceImpl)factory.createService(wsdlLocation, serviceName); Call call = service.createCall(); QName operationName = new QName("http://org.mazurek.ws/jsr181ejb", "echo"); call.setOperationName(operationName); ; String hello = "Hello"; String world = "world!"; Object retObj = call.invoke(new Object[]{hello});
<definitions name="MyService" targetNamespace="http://org.mazurek.ws/jsr181ejb" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://org.mazurek.ws/jsr181ejb" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <types> <schema elementFormDefault="qualified" targetNamespace="http://org.mazurek.ws/jsr181ejb" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://org.mazurek.ws/jsr181ejb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <complexType name="Param"> <sequence> <element name="firstName" nillable="true" type="string"/> <element name="lastName" nillable="true" type="string"/> </sequence> </complexType> </schema> </types> <message name="EndpointInterface_echo"> <part name="String_1" type="xsd:string"/> </message> <message name="EndpointInterface_numOfBooksByAuthor"> <part name="Param_1" type="tns:Param"/> </message> <message name="EndpointInterface_numOfBooksByAuthorResponse"> <part name="result" type="xsd:long"/> </message> <message name="EndpointInterface_echoResponse"> <part name="result" type="xsd:string"/> </message> <portType name="EndpointInterface"> <operation name="echo" parameterOrder="String_1"> <input message="tns:EndpointInterface_echo"/> <output message="tns:EndpointInterface_echoResponse"/> </operation> <operation name="numOfBooksByAuthor" parameterOrder="Param_1"> <input message="tns:EndpointInterface_numOfBooksByAuthor"/> <output message="tns:EndpointInterface_numOfBooksByAuthorResponse"/> </operation> </portType> <binding name="EndpointInterfaceBinding" type="tns:EndpointInterface"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="echo"> <soap:operation soapAction=""/> <input> <soap:body namespace="http://org.mazurek.ws/jsr181ejb" use="literal"/> </input> <output> <soap:body namespace="http://org.mazurek.ws/jsr181ejb" use="literal"/> </output> </operation> <operation name="numOfBooksByAuthor"> <soap:operation soapAction=""/> <input> <soap:body namespace="http://org.mazurek.ws/jsr181ejb" use="literal"/> </input> <output> <soap:body namespace="http://org.mazurek.ws/jsr181ejb" use="literal"/> </output> </operation> </binding> <service name="MyService"> <port binding="tns:EndpointInterfaceBinding" name="EndpointInterfacePort"> <soap:address location="http://adam:8080/jsr181ejb/EJB3Bean"/> </port> </service> </definitions>
I the examples are clients in jar files - for what are them?
I hope someone will help me....
Adam