[JBossWS] - Problems with Web Services on JBoss 4.2.1
by chui
Hi there!
I'm trying to run my application with JBoss AS 4.2.1, but I found some strange differences between 4.2.1 and 4.0.5 (which I was using before). It seems like JBoss 4.2.1 uses default values or default manners of naming everything!! Examples:
1-) With 4.0.5 I was using the namespace http://endpoints/jaws/ and everything was ok. But with 4.2.1, the operations' namespace comes from the package where the classes are. If I put my endpoint interfaces in a package "endpoints.jaws", I just can't call the service's methods because the operations' namespace becomes "http://jaws.endpoints". I avoided this error by changing my namespace to a simple "http://endpoints/" and putting the interfaces in the package "endpoints"... (But I'd like to know if it's possible to keep using http://endpoints/jaws, or JBoss 4.0.5 won't allow the deployment of these services anymore... =/)
2-) Well, when I changed the namespace, the webservices were available on JBossWS... and I got stuck. This is the error I receive:
2007-07-25 15:29:25,046 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception
| org.jboss.ws.WSException: Cannot find child element: arg0
| at org.jboss.ws.core.CommonSOAPBinding.getParameterFromMessage(CommonSOAPBinding.java:866)
| at org.jboss.ws.core.CommonSOAPBinding.unbindRequestMessage(CommonSOAPBinding.java:325)
| at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:187)
| at org.jboss.ws.core.server.ServiceEndpoint.processRequest(ServiceEndpoint.java:212)
| at org.jboss.ws.core.server.ServiceEndpointManager.processRequest(ServiceEndpointManager.java:448)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
As you can see, my WSDL file doesn't have this part name "arg0":
<?xml version="1.0" encoding="UTF-8"?>
| <definitions name='Commands' targetNamespace='http://endpoints/' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://endpoints/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
| <types/>
| <message name='Commands_execute'>
| <part name='String_1' type='xsd:string'/>
| </message>
| <message name='Commands_executeResponse'>
| <part name='result' type='xsd:string'/>
| </message>
| <portType name='Commands'>
| <operation name='execute' parameterOrder='String_1'>
| <input message='tns:Commands_execute'/>
| <output message='tns:Commands_executeResponse'/>
| </operation>
| </portType>
| <binding name='CommandsBinding' type='tns:Commands'>
| <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
| <operation name='execute'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body namespace='http://endpoints/' use='literal'/>
| </input>
| <output>
| <soap:body namespace='http://endpoints/' use='literal'/>
| </output>
| </operation>
| </binding>
| <service name='Commands'>
| <port binding='tns:CommandsBinding' name='CommandsPort'>
| <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
| </port>
| </service>
| </definitions>
Even if I replace the String_1 occurences by arg0 I get the error above. I don't know what to do, could anyone help me please??? Why does JBoss use this values instead of the WSDL values?!
Thanks...
Chui
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067567#4067567
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067567
17 years, 5 months
[JBossWS] - Re: trying to access a webservice - not working from either
by PeterJ
I must say that your WSDL file looks very strange. It appears that for some reason that the method names are being treated as types. More on that in a second.
The first thing I noticed was that JBossWS did not like List as a return type. When i deployed the web service I got this error:
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of
| IllegalAnnotationExceptions
| java.util.List is an interface, and JAXB can't handle interfaces.
| this problem is related to the following location:
| at java.util.List
When I changed the return types to ArrayList, the error went away and the web service deployed just fine.
Looking at my WSDL, one of the methods is defined by:
<message name="POAddressManagerWS_getAddressByPostCode">
| <part name="arg0" type="xsd:string"/>
| </message>
| <message name="POAddressManagerWS_getAddressByPostCodeResponse">
| <part name="return" type="tns:arrayList"/>
| </message>
while for you it is defined as:
<message name="POAddressManagerWS_getAddressByPostCode">
| <part element="tns:getAddressByPostCode" name="getAddressByPostCode" />
| </message>
| - <message name="POAddressManagerWS_getAddressByText">
| <part element="tns:getAddressByText" name="getAddressByText" />
| </message>
This explains the error you are getting:
anonymous wrote : Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://session.address.cmmgroup.com/}getAddressByPostCode
because there is no such type, hence no type mapping.
Unfortunately, I don't know what to tell you to do to correct this. As I said, your WSDL looks way different from mine. And other than changing the return types to ArrayList, the only other thing I did differently was I did not code up the entity bean (I hard-coded the return of a ArrayList containing two strings). Also, I did not try the client.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067515#4067515
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067515
17 years, 5 months