[JBossWS] - Re: replacement of REPLACE_WITH_ACTUAL_URL when using annota
by will.tatam
please read http://www.jboss.org/community/docs/DOC-12519 as this is basically the same problem as that of the creation of RMI stubs
This document details the use of these attributes to ensure that jndi returns the correct url for rmi invocations, just in the same way as the wsdl needs to return the correct url for soap invocations
-Djava.rmi.server.hostname=<external_host_name>
-Djava.rmi.server.useLocalHostname=true
In both cases, you are making a call to a given address, which is then forwarded on the the real jboss server, which is on a different address. When jboss is then creating anything that gives any kind or addressing details, by default it guesses it should use it's own address as it's unaware of the publicly accessible address.
The comment about HTTP 1.1 is that jboss should never be guessing the value for url in the first place. when the call for the WSDL is made, the HTTP connection provides the hostname as well as the filepath that was requested, this can then be used to build the response.
i,e
Current model
https://${webServiceHost}:${webServiceSecurePort}/${path.to.sevice}
where webServiceHost and webServiceSecurePort are hard coced values in WSServerConfig
Ideal Model
https://${http.request.hostname}:${http.request.port}/${path.to.sevice}
where the http.request values are populated based on the HTTP headers as part of the call for the WSDL
e.g
if I call https://myserver1.cust1,example.com:8443/myservice?wsl then the soap location should come back as https://myserver1.cust1,example.com:8443/myservice
if i have a dns record so that soap.example.com resolves to a http load balancer the if i call https://soap.example.com/myservice?wsdl then i get back a location of https://soap.example.com/myservice no matter whether it goes to myserver1.cust1,example.com, myserver2.cust1,example.com or even myserver9.cust4,example.com
As i say, this is the ideal. I would be happy with the old method whereby i hard-code the <soap:address location=''/> within the automatically created WSDL
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4188573#4188573
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4188573
16 years, 4 months
[JBossWS] - Re: replacement of REPLACE_WITH_ACTUAL_URL when using annota
by PeterJ
anonymous wrote : There are two totally different setups
|
| 123.123.123.123 is the dummy ip for a server that runs on a global ip address
|
| 192.168.1.123 is the private ip address of a server sitting behind the unspecified ip address of the firewall
This is what I though was the case based on the IP addresses themselves (I recognize the subnet 129.168.1.xxx as being the subnet typically used by routers), but your text seemed to indicate the opposite.
anonymous wrote : If the client accesses a url of
|
| https://456.456.456.456:8443/myapp/mySoapService?wsdl
|
| they the wsdl should list the location as <soap:address location='https://456.456.456.456:8443/myapp/mySoapService'/>
You say that it "should list" that location. What location is it giving instead?
anonymous wrote : ideally it should be HTTP 1.1 compliant, so rather than use a hard coded hostname or ${jboss.bind.address} it builds the url based on the url used for the wsdl request (which is just as simple as stripping the ?wsdl from the end)
I do not know what you are saying here. What does HTTP 1.1 compliance have to do with this? What does the text "${jboss.bind.address}" have to do with this? When you say "it builds the url based on the url used for the wsdl request (which is just as simple as stripping the ?wsdl from the end)" are you saying that the soap location you are getting in the wsdl is:
<soap:address location='https://456.456.456.456:8443/myapp/mySoapService'/>
If so, then I am really confused because you earlier said "the wsdl should list the location as...".
So once again I am not sure what it is you are seeing and what it is that you are expecting. Please understand that I am not trying to give you a hard time, I am simply trying to understand what the problem is that you are having.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4188570#4188570
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4188570
16 years, 4 months
[JBossWS] - NullPointerException on combined EJB3 session bean and JAX-W
by twwwt
Hello,
I'm implementing a class that is both a EJB3 stateless session bean and also exposes itself as a JAX-WS Web service. Below you can see relevant excerpt from the code.
When I want to access the WSDL document from a Web browser I get an NPE, see below. When I remove the EJBContext variable declaration including the @Resource annotiation the exception does not appear.
I'm using JBoss 4.2.3GA and jbossws-cxf-3.0.4.GA.
It seems to me that it is related to CXF but appears only for classes that are both EJBs and JAX-WS Web services. Am I right or did I missed something? Should I try with jbossws-native or jbossws-metro again or would they fail as well?
Regards,
Thorsten
|
| // ...
|
| @Local(BankServiceLocal.class)
| @Remote(BankServiceRemote.class)
| @Stateless
| @TransactionAttribute(TransactionAttributeType.REQUIRED)
| @WebService(name="BankService", targetNamespace="http://myCompany.com")
| public class BankServiceImpl implements BankService
| {
| @PersistenceContext
| protected EntityManager em;
|
| @Resource
| protected EJBContext context;
|
| @WebResult(name = "customer")
| public Customer getCustomerDetails(
| @WebParam(name = "bic") String bic,
| @WebParam(name = "iban") String iban) throws UnknownAccountException
| {
| // ...
| }
|
| // ...
|
| }
|
| 14:35:43,937 INFO [ServerImpl] Setting the server's publish address to be http://127.0.0.1:8080/dis.ws/BankServiceImpl
| 14:35:43,968 ERROR [AnnotationProcessor] an AnnotationVisitor (org.apache.cxf.common.injection.ResourceInjector@151e077) raised an exception on element protected javax.ejb.EJBContext ch.unibas.cs.dbis.dis.jaxws.BankServiceImpl.context.
| java.lang.NullPointerException
| at javax.naming.InitialContext.getURLScheme(InitialContext.java:269)
| at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:318)
| at javax.naming.InitialContext.lookup(InitialContext.java:392)
| at org.apache.cxf.transport.servlet.ServletContextResourceResolver.resolve(ServletContextResourceResolver.java:62)
| at org.apache.cxf.resource.DefaultResourceManager.findResource(DefaultResourceManager.java:99)
| at org.apache.cxf.resource.DefaultResourceManager.resolveResource(DefaultResourceManager.java:55)
| at org.apache.cxf.common.injection.ResourceInjector.resolveResource(ResourceInjector.java:401)
| at org.apache.cxf.common.injection.ResourceInjector.visitField(ResourceInjector.java:164)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.apache.cxf.common.annotation.AnnotationProcessor.visitAnnotatedElement(AnnotationProcessor.java:131)
| at org.apache.cxf.common.annotation.AnnotationProcessor.processFields(AnnotationProcessor.java:110)
| at org.apache.cxf.common.annotation.AnnotationProcessor.accept(AnnotationProcessor.java:89)
| at org.apache.cxf.common.injection.ResourceInjector.inject(ResourceInjector.java:81)
| at org.apache.cxf.common.injection.ResourceInjector.inject(ResourceInjector.java:76)
| at org.apache.cxf.jaxws.JaxWsServerFactoryBean.injectResources(JaxWsServerFactoryBean.java:217)
| at org.apache.cxf.jaxws.JaxWsServerFactoryBean.init(JaxWsServerFactoryBean.java:168)
| at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:161)
| at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:322)
| at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:244)
| at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:194)
| at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:380)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1242)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1208)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
| at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
| at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
| at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
| at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
| at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
| at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
| at org.jboss.wsf.stack.cxf.CXFServletExt.loadAdditionalConfigExt(CXFServletExt.java:141)
| at org.jboss.wsf.stack.cxf.CXFServletExt.loadBus(CXFServletExt.java:118)
| at org.apache.cxf.transport.servlet.AbstractCXFServlet.init(AbstractCXFServlet.java:86)
| at org.jboss.wsf.stack.cxf.CXFServletExt.init(CXFServletExt.java:73)
| at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
| at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| 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:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:619)
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4188463#4188463
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4188463
16 years, 4 months
[JBossWS] - Re: Replacing the logic that returns the corrospoding WS jav
by yanivc24
Thanks for the response.
I will try to rephrase the question. basically I have two Jboss servers. one is used as a frontend which receives all the calls from a web browser client. ( http requests and web service calls) the second server is used as a backend to do some business logic and mainly runs EJB components.
in the current landscape environment the second server is located behind a firewall so that it cannot receive http requests or web service calls. (both are HTTP). the frontend server is used for that purpose.
The web service stack is responsible for the translation web service calls into methods calls to the required objects. what I would like to achieve is that the method calls to the required objects will be done on a remote object located on the backend server I previously described. the same way it is being achieved today on our old axis implementation.
In the current web service engine we have we are using AXIS 1.4 which is old but is quite modular. it allowed us to replace the module which is responsible for retrieving the required objects to execute the web method call. what we actually did is that we simply made a lookup from the frontend server to the remote backend and received a proxy object. the proxy object is then used by axis to make the required method calls. so basically what happens is that the frontend server receives the web service call, it then receives a proxy objects which executes the calls on the remote backend server.
Please let me know if you need some further descriptions.
Regarding the documentation, I took a long look at the documentation including the guided tour( more than a work day) the assumptions that I mentioned were regarding the prior knowledge needed in order to understand the documentation. Even though I understand web services and have experience with implementing and consuming them. I don't understand much of the information provided to a useful degree.
Many Thanks,
Yaniv
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4188406#4188406
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4188406
16 years, 4 months
[JBossWS] - Re: Samples? Tutorials? There is a lack of readable docs!
by alessio.soldano@jboss.com
"eminil" wrote :
| I've tried looking carefully :P
|
| These examples seem to be for EJB3 right with annotations and stuff for webservices?
Yes, those examples are about what JAXWS specs talk about... both EJB3 and POJO web service endpoints are supported.
anonymous wrote : What if we are using older EJB2 beans?
Did you say this before stating that the doc is not readable??
Anyway, you can refer to the legacy JAX-RPC documentation in this case, which is indeed less rich of examples being about something we don't actively work on since a lot of time.
There are anyway tons of jax-rpc examples in the distribution that you can run as junit test and use as a starting point for your development.
http://jbossws.jboss.org/mediawiki/index.php?title=JAX-RPC_User_Guide
anonymous wrote : Also, prefreably we would like all our webservice building to be inside our build ant script. It is possible to get this onto each developers computer's eclipse installation without having to install jboss on every computer? We have a development server running the jboss. I imagine most developers use this approach.
|
Sure that's possible. We even developed a user project generator for getting started easily with your project, but that's for JAX-WS only. See the "Setup your IDE" page on the mediawiki: http://jbossws.jboss.org/mediawiki/index.php?title=Setup_your_IDE
Since you're using old technologies, you'll have to setup your environment on your own, but that almost trivial once you know the libraries you need on client side.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4188378#4188378
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4188378
16 years, 4 months