|
NEW!!! TOOOO Many results in general search?!! Try this customized search engine for searching online books
|
|
JAX-WS + Tomcat 5.5 + JDK 1.6 Hi,
My sample web service works fine from standalone application under Java 6. However, when I tried to deploy it under Tomcat 5.5, there are no erros, but no WSDL is being generated either. Here is what I have done: 1) Coded/compiled Web Service classes. 2) Generated artifacts with wsgen (from Java classes) 3) Put lib/*.jar from JAXWS-RI 2.0 to shared/lib on Tomcat (I used 2.0 instead of 2.1 to avoid conflict with JAXB 2.0 under Java 6, and skip copying to endorsed directory, etc). 4) Deployed Web App under Tomcat. NO errors whatsoever.
Here is the catalina.log: Feb 2, 2007 12:40:40 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized INFO: WSSERVLET12: JAX-WS context listener initializing Feb 2, 2007 12:40:40 PM com.sun.xml.ws.transport.http.servlet.RuntimeEndpointInfoParser processWsdlLocation INFO: wsdl cannot be found from DD or annotation. Will generate and publish a new WSDL for SEI endpoints. Feb 2, 2007 12:40:41 PM com.sun.xml.ws.transport.http.servlet.WSServletDelegate init INFO: WSSERVLET14: JAX-WS servlet initializing
Furthermore, I used System.out.println() in @PostConstruct method of my web service, and saw it printing in Tomcat's stdout.log -- this proves that my Web Servive class is being successfully called.
All looks great, but I can't find generated WSDL, and when I try to access the service (http://localhost:8080/calc-ws?wsdl) I get 404 error (resource not available).
Here is the sun-jaxws.xml: <?xml version="1.0" encoding="UTF-8"?> <endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0"> <endpoint name="CalcWS" implementation="ws2.server.impl.Calculator" url-pattern="/calc-ws" /> </endpoints>
Here is web.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd"> <web-app> <listener> <listener-class> com.sun.xml.ws.transport.http.servlet.WSServletContextListener </listener-class> </listener> <servlet> <servlet-name>CalcWS</servlet-name> <servlet-class> com.sun.xml.ws.transport.http.servlet.WSServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>CalcWS</servlet-name> <url-pattern>/calc-ws</url-pattern> </servlet-mapping> <session-config> <session-timeout>60</session-timeout> </session-config> </web-app>
WAR deployed under webapps/calcws (shouldn't matter because the URL pattern is /calc-ws).
So what am I doint wrong? What should be the URL for accessing my Web Service (e.g. requesting WSDL)?
Thanks |
Re: Malformed WSDL or wsimport error? No. I just relealized that the .NET application is producing bad wsdl. It is using the parameter name in the ref argument. That isn't correct.
Thanks. |
|
|
JAX-WS socket problems I was able to successfully deploy a JAX-WS based WebService on Tomcat 5.5.20. The WebService is basically a kind of proxy. It gets information from a client via SOAP, uses this information to make a socket connection to another server (referred to as Server B) which performs some operation based on the information and then returns back the result to the client.
This works perfectly when there is only one client. During the process of stress testing, I noticed that when one client was making repeated calls to the service successfully, if I had another client also call this service, the WebService had socket problems (connect used to happen, but when operation was performed - exception with not connected was observed). To verify that this was not a problem with the Server B, I tried to directly have multiple clients connect to it - which worked without any issues. So this seems to be something going on at the WebService stack or probably related to Tomcat.
Any ideas as to settings with Tomcat/JAXWS or anything I might be doing wrong would be appreciated.
Unfortunately I cannot deploy Server B as a WebService directly, since I don't have the source for this / access to it.
TIA, Vijay |
Re: Malformed WSDL or wsimport error? Is q1:items defined as a global element? |
Re: Malformed WSDL or wsimport error? I have a similar error but sort of the opposite results. If I return a dataset from the .NET webservice everything is fine on the client, except that I cannot pass up a dataset because of the diffgram schema.
However, now I'm trying to be "Java Safe" in my .NET web service so I am returning a class that represents a strong typed xml document and the wsdl gets generated as follows:
<s:element minOccurs="0" maxOccurs="1" xmlns:q1="http://convergencedata.net/NGItems.xsd" ref="q1:items" />
obviously q1 is a valid namespace it is being defined right there. But I get the error:
warning: src-resolve: Cannot resolve the name 'q1:items' to a(n) 'element declaration' component. line 0 of file:/C:/Documents%20and%20Settings/Chris%20Holt/TestWebService/xml-resources/web-service-references/NGDfrApi.asmx/wsdl/localhost_1724/NGAPI/NGDfrApi.asmx.wsdl#types?schema1 |
Namespace problem starting from WSDL Hi I need to write a webservice starting from a WSDL file that is provided to me. I'm using JAX-WS 2.0 (from Sun's Appserver 9) wsimport to generate the skeleton: <wsimport wsdl="${basedir}/src/conf/webinf/wsdl/HarvestTokenRequest.wsdl" destdir="${build.dir}/classes" sourcedestdir="${src.dir}/generated" keep="true" verbose="true" > </wsimport>
This gives me an interface called net.sourceforge.limbs.wsdl.harvesttokenrequest.HarvestTokenRequestPortType
I create an implementation class that implements that interface called net.sourceforge.limbs.wsdl.HarvestTokenRequestImpl
I then package everything into a war file and deploy it to my Application Server.
Here's my sun-jaxws.xml file: <?xml version="1.0" encoding="UTF-8"?> <endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0"> <endpoint name="HarvestTokenRequest" interface="net.sourceforge.limbs.wsdl.harvesttokenrequest.HarvestTokenRequestPortType" implementation="net.sourceforge.limbs.wsdl.HarvestTokenRequestImpl" <!-- wsdl="WEB-INF/wsdl/HarvestTokenRequest.wsdl" --> url-pattern="/htrs" /> </endpoints>
Using it like this works fine, the service deploys fine, and using the AS9 admin interface, I can test it. The problem is that it appears with the name of the Implementation class.
If I remove the comments around the wsdl="WEB..." line, then I get an exception during deployment: [#|2007-02-02T16:22:05.719+0100|SEVERE|sun-appserver-pe9.0|javax.enterprise.resource.webservices.jaxws.server.http|_ThreadID=64;_ThreadName=Thread-123;_RequestID=e41c07ef-1205-47b8-bd4e-43068dcd781b;|WSSERVLET11: failed to parse runtime descriptor: could not get binding from WSDL! service: {http://wsdl.limbs.sourceforge.net/}HarvestTokenRequestImplService or port {http://wsdl.limbs.sourceforge.net/}HarvestTokenRequestImplPort not found in the WSDL jndi:/server/HarvestTokenRequest/WEB-INF/wsdl/HarvestTokenRequest.wsdl
I understand that if I don't mention the wsdl element in the sun-jaxws.xml descriptor, JAX-WS regenerates a wsdl file, which explains while there's no problem deploying the webservice.
However, I don't understand why if I do mention the wsdl location, it looks for a name based on the Implementation class rather than on the interface ({http://wsdl.limbs.sourceforge.net/}HarvestTokenRequestImplService)
Also, what is strange is that when I don't mention the wsdl attribute, my service is deployed and can be reached at two locations:
The location I define in my deployment descriptor (web.xml): http://localhost:9080/HarvestTokenRequest/htrs?wsdl
and a location based on the name of the implementation class
http://localhost:9080/HarvestTokenRequest/HarvestTokenRequestImplService?wsdl
Could someone please explain what i'm doing wrong? Basically, what I need to do is: 1. Create skeleton classes from WSDL file 2. Implement the service interface in a class 3. Package and deploy the service, making sure that when clients want to access the WSDL file, they get the one that I used to build my service and not one that is generated by JAX-WS
Thanks a lot
Jean-Noel Colin |
Re: Namespace problem with jaxb2 I did succeed in removing the UnmarshallerHandler and the SAXParserFactory, simplifying the code to:
JAXBContext jc = JAXBContext.newInstance("decs2.process_definition"); Unmarshaller u = jc.createUnmarshaller(); XMLReader xmlReader = XMLReaderFactory.createXMLReader(); xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", Boolean.TRUE); SAXSource src = new SAXSource(xmlReader, new InputSource(in)); ProcessDefinitionType definition = (ProcessDefinitionType)((JAXBElement)u.unmarshal(src)).getValue(); |
|
|
when configuring JBoss with JWSDP 2.0 Hi,
I want to configure My JBoss Application server with the JWSDP 2.0.
Since JBoss application server is not in the list which is displayed at the time of installing JWSDP 2.0, i marked no container option.
i have set AS_HOME as the application server i.e. C:\jboss-5.0.0.Beta1
and PATH variable as the ant with JWSDP 2.0. i.e. C:\Sun\jwsdp-2.0\apache-ant
but when i am executing the command ant server from C:\Sun\jwsdp-2.0\jaxws\samples\fromjava then it is giving me the following error
BUILD FAILED C:\Sun\jwsdp-2.0\jaxws\samples\fromjava\build.xml :56 C:\Sun\jwsdp-2.0\jaxws\samples\fromjava\lib not found
so if any more settings i need to perform then plz let me know
Thank You |
Re: Handling strong typed datasets Here is how I was able to do this:
JAXBContext jc = JAXBContext.newInstance( "net.convergencedata.ngitems" ); Unmarshaller u = jc.createUnmarshaller(); net.convergencedata.ngitems.NGItems items = (net.convergencedata.ngitems.NGItems)u.unmarshal(((Node)results.value.getAny()).getFirstChild()); |
WSE 3.0 Support? Does WSIT only support working with the WCF web services? I have a .NET 2.0 web services that is secured using WSE 3.0. Do I have a chance? |
|
|
|
ONLINE FORUM
|
|
|