This content has been marked as final.
Show 3 replies
-
1. Re: Fail to access the servlet-style web service
xiaoqj Jun 11, 2006 8:38 AM (in response to xiaoqj)all the jar files are copied from jboss client folder including:
jbossall-client.jar
axis-ws4ee.jar
common-discovery.jar
common-logging.jar
wsdl4j.jar
xercesImpl.jar is from the lib\endorsed
client-config.wsdd is a rename of \server\default\deploy\jboss-ws4ee.sar\META-INF\axis-client-config.xml -
2. Re: Fail to access the servlet-style web service
xiaoqj Jun 11, 2006 10:07 AM (in response to xiaoqj)The wsdl file seems to be fine, which is generated by sun's jwsdp 2.0
<?xml version="1.0" encoding="UTF-8"?> <definitions name="HelloService" targetNamespace="http://hello.ws.jboss.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://hello.ws.jboss.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <message name="Hello_hello"> <part name="String_1" type="xsd:string"/> </message> <message name="Hello_helloResponse"> <part name="result" type="xsd:string"/> </message> <portType name="Hello"> <operation name="hello" parameterOrder="String_1"> <input message="tns:Hello_hello"/> <output message="tns:Hello_helloResponse"/> </operation> </portType> <binding name="HelloBinding" type="tns:Hello"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="hello"> <soap:operation soapAction=""/> <input> <soap:body namespace="http://hello.ws.jboss.org/" use="literal"/> </input> <output> <soap:body namespace="http://hello.ws.jboss.org/" use="literal"/> </output> </operation> </binding> <service name="HelloService"> <port binding="tns:HelloBinding" name="HelloPort"> <soap:address location="REPLACE_WITH_ACTUAL_URL"/> </port> </service> </definitions>
-
3. Re: Fail to access the servlet-style web service
yogendra_g Jun 21, 2006 4:32 AM (in response to xiaoqj)Following is the code for accessing the servlet-web service.
public class WebServiceStandaloneClient { /** * @param args */ public static void main(String[] args) { try { String endPoint = "http://localhost:8080/age/Age?wsdl"; URL url = new URL(endPoint); ServiceFactory sf = ServiceFactory.newInstance(); QName serviceQname = new QName("http://age.webservices.javasrc.com/","AgeService"); Service s = sf.createService(url,serviceQname); Age age = (Age) s.getPort(Age.class); System.out.println("got output " + age.age("name",new Integer(26))); } catch (MalformedURLException e) { e.printStackTrace(); } catch (ServiceException e) { e.printStackTrace(); } catch (RemoteException e) { e.printStackTrace(); } } }
You need to create following classes : I generated it using the Eclipse Web Service Client.package com.javasrc.webservices.age; public interface AgeService extends javax.xml.rpc.Service { public java.lang.String getAgePortAddress(); public com.javasrc.webservices.age.Age getAgePort() throws javax.xml.rpc.ServiceException; public com.javasrc.webservices.age.Age getAgePort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; }
There are jaxr,jaxrp,saaj,xml-api.jar, axis.jar, commons-loggin,commons-discovery,log4j and wsdl4j.jar files in the class path of the client.