[JBossWS] - Maven2, XDoclet and JBossWS (no webservices shown)
by Schludi
Hello I have a question. I only want to deploy an EJB written in XDoclet (i know about annotations, but need to publish webservices of an existing project written with XDoclet) which is displayed under http://localhost:8080/jbossws/services
I am using Maven2 and XDoclet.
I will post the POM.XML of the EJB-Project an the EJB's Java-Code.
First the EJB-Code with XDoclet:
| package com.bbraun.bbmag.test;
|
| import java.rmi.RemoteException;
|
| import java.math.*;
| import javax.ejb.SessionBean;
| import javax.ejb.SessionContext;
| import java.math.*;
|
| /**
| * Trade Session EJB manages all Trading services
| *
| * @ejb.bean name="FirstEJBBean"
| * display-name="FirstEJBBean"
| * description="A simple hello world bean."
| * jndi-name="FirstEJBBean"
| * type=stateless
| * view-type="service-endpoint"
| *
| * @ejb.interface
| * service-endpoint-class="com.bbraun.bbmag.test.StatlessEJBEndpoint"
| *
| * @wsee.port-component
| * name="StatlessEJBEndpointPort"
| */
| public class StatlessEjbBean implements SessionBean
| {
|
| BigDecimal yenRate = new BigDecimal("121.6000");
|
| BigDecimal euroRate = new BigDecimal("0.0077");
|
| /**
| * @ejb.interface-method view-type="service-endpoint"
| */
| public BigDecimal dollarToYen(BigDecimal dollars) {
| BigDecimal result = dollars.multiply(yenRate);
| return result.setScale(2, BigDecimal.ROUND_UP);
| }
|
| /**
| * @ejb.interface-method view-type="service-endpoint"
| */
| public BigDecimal yenToEuro(BigDecimal yen) {
| BigDecimal result = yen.multiply(euroRate);
| return result.setScale(2, BigDecimal.ROUND_UP);
| }
|
| public StatlessEjbBean() {
| }
|
| public void ejbCreate() {
| }
|
| public void ejbRemove() {
| }
|
| public void ejbActivate() {
| }
|
| public void ejbPassivate() {
| }
|
| public void setSessionContext(SessionContext sc) {
| }
| }
|
Here is the POM.XML of the EJB-Project:
| <project>
| <modelVersion>4.0.0</modelVersion>
| <parent>
| <groupId>com.bbraun.bbmag.test</groupId>
| <artifactId>FirstEJB</artifactId>
| <version>0.1</version>
| </parent>
| <artifactId>FirstEJB-ejb</artifactId>
| <packaging>ejb</packaging>
| <name>FirstEJBejb</name>
| <description>Eine EJB</description>
|
|
| <dependencies>
| <dependency>
| <groupId>org.apache.geronimo.specs</groupId>
| <artifactId>geronimo-j2ee_1.4_spec</artifactId>
| <version>1.0</version>
| <scope>provided</scope>
| </dependency>
| <dependency>
| <groupId>commons-logging</groupId>
| <artifactId>commons-logging</artifactId>
| <version>1.0.3</version>
| <scope>provided</scope>
| </dependency>
| <dependency>
| <groupId>axis</groupId>
| <artifactId>axis</artifactId>
| <version>1.2</version>
| <scope>provided</scope>
| </dependency>
| <dependency>
| <groupId>axis</groupId>
| <artifactId>axis-jaxrpc</artifactId>
| <version>1.2</version>
| <scope>provided</scope>
| </dependency>
| </dependencies>
| <build>
| <testSourceDirectory>src/test</testSourceDirectory>
| <plugins>
| <plugin>
| <groupId>org.codehaus.mojo</groupId>
| <artifactId>xdoclet-maven-plugin</artifactId>
| <executions>
| <execution>
| <id>ejb</id>
| <phase>generate-sources</phase>
| <goals>
| <goal>xdoclet</goal>
| </goals>
| <configuration>
| <tasks>
| <ejbdoclet
| verbose="true"
| force="true"
| ejbSpec="2.1"
| destDir="${project.build.directory}/generated-sources/xdoclet">
| <fileset
| dir="${project.build.sourceDirectory}">
| <include name="**/*Bean.java"></include>
| <include name="**/*MDB.java"></include>
| </fileset>
| <homeinterface />
| <remoteinterface />
| <localhomeinterface />
| <localinterface />
| <service-endpoint/>
| <utilobject localProxies="true"/>
| <deploymentdescriptor destDir="${project.build.outputDirectory}/META-INF"/>
| </ejbdoclet>
| </tasks>
| </configuration>
| </execution>
| </executions>
| </plugin>
| <plugin>
| <groupId>org.apache.maven.plugins</groupId>
| <artifactId>maven-ejb-plugin</artifactId>
| <configuration>
| <generateClient>true</generateClient>
| <clientExcludes>
| <clientExclude>
| **/ejb/*Bean.class
| </clientExclude>
| </clientExcludes>
| </configuration>
| </plugin>
| </plugins>
| </build>
| </project>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036310#4036310
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036310
17 years, 8 months
[JBossWS] - JSR-109Client, Mapping problem and trying to connect to a .N
by d_pavel
Hi All,
I developed a JAX-RPC web service client in order to connect to a .NET webservice. I am using jdk1.5.0_09, JBoss AS 4.0.5.GA and jbossws-1.2.0.GA. I set properly the java.endorsed.dirs.
Here is the config file:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <!-- top~down or wsdl~to~java JAX-RPC config file -->
| <configuration xmlns="http://www.jboss.org/jbossws-tools"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
|
| <wsdl-java file="META-INF/Vax.wsdl">
| <mapping file="jaxrpc-mapping.xml" />
| </wsdl-java>
|
| </configuration>
|
Using wstools I was able to generate the related artifacts (the jaxrpc-mapping.xml file and all the related stubs and the required Service Endpoint Interface (SEI).
The target namespace it will be similar with: "https://www.acompany.com/VaxHttp/Vax"
The important code in my client looks like this:
| String feedback = "";
| try
| {
| URL url = null;
| //wsdl location
| try
| {
| url = new URL(urlstr);
| }
| catch (MalformedURLException e)
| {
| e.printStackTrace();
| }
|
| QName qName = new QName("https://www.acompany.com/VaxHttp/Vax.asmx?wsdl", "Vax");
|
| System.out.println("############ local part = "+qName.getLocalPart());
| System.out.println("############ namespace URI = "+qName.getNamespaceURI());
|
| //set jboss ServiceFactory
| System.setProperty( "javax.xml.rpc.ServiceFactory",
| "org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl" );
|
| //have to have only one instance of the ServiceFactory
| ServiceFactoryImpl serviceFactory = (ServiceFactoryImpl)ServiceFactory.newInstance();
| File mapping = new File("WebRoot/WEB-INF/jaxrpc-mapping.xml");
| URL mappingURL = null;
| try
| {
| mappingURL = mapping.toURL();
| }
| catch (MalformedURLException e)
| {
| e.printStackTrace();
| }
|
| ServiceImpl service = (ServiceImpl)serviceFactory.createService(url, qName, mappingURL);
|
| //get stub or dynamic proxy that supports the specified service endpoint interface
| VaxSoap port = (VaxSoap) service.getPort(VaxSoap.class);
|
| //create PutOrder object
| PutOrder po = new PutOrder(...);
|
| //using SOAP 1.1 and calling the related method on the service endpoint interface
| PutOrderResponse status = port.putOrder(po);
|
| feedback = status.getPutOrderResult();
| //check the PurchaseOrder status
| System.out.println("output order response:" + feedback);
|
| }
| catch(ServiceException se)
| {
| System.out.println("Service Exception from executePutPurchaseOrder() = "+se.getMessage());
| }
|
| return feedback;
|
Now when I try to run the client passing the valid parameters, I get the following mapping exception from the Client:
anonymous wrote :
| Could not update IN parameter to be INOUT, as indicated in the mapping: parameters
|
In the generated jaxrpc-mapping.xml (after the wsdl available) all the ~SoapIn wsdl-message from within the related wsdl-message-mapping have this
anonymous wrote :
| <parameter-mode>INOUT</parameter-mode>
|
parameter mode defined.
I want to metion that is no denial of traffic and the network is good.
Now this param can be IN, OUT, or INOUT. I should not have to modify this generated xml file! However if I modify it and put "IN" instead of "INOUT" I am able to go further (but this in fact is not correct because the called method has to return a PutOrderResponse object so we need the INOUT isn't it ?). Anyway using a modified jaxrpc-mapping.xml as I said before I am able to make the invokation to the remote web service but it barfs here:
anonymous wrote :
| org.jboss.remoting.CannotConnectException: Can not connect http client invoker.
|
This exception is generated when the remoting layer cannot connect to
the remote server . It means that the client cannot send the request to
the server. Well it's normal I think when the remote side is on .NET and the JBoss TransporterClient(InvokerLocator locator, String targetSubsystem) it's trying to use a org.jboss.remoting.InvokerLocator which will work as it is only between JBOSS application servers (correct me if I'm wrong please). The JBossWS fails to create properly the org.jboss.remoting.Client remoteClient instance.
How can one explicitly set the transport protocol to be "http" (and not "socket" as for the JBoss AS) ?
I mean the InvokerLocator has to take that into consideration when trying to connect to .NET webservices right ?
There is some documentation or useful links related to how to connect to .NET webservices ? I will have also my own JBoss webservices which will have to be accessible from any endpoint (well .NET is the one I'm afraid off and it's causing me grief).
Did I missed something ? I mean the client description is pretty straight forward in the user guide...
Aside: when the "JBoss Remoting" comes in to play ? For what is recommended especially ?If one doesn't use transports and data marshallers or push and pull callbacks, then doesn't need "JBoss Remoting" either right?
I hope to get an answer to this post because this is not trivial to debug and fix. Please help.
I would really appreciate an/any answer as soon as possible.
Thank you in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036197#4036197
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036197
17 years, 8 months
[JBossWS] - Re: Problem using wstools
by d_pavel
I should have posted these answers sooner then one month but time flies so here you go (in case somebody will stumble upon same things):
-I solved relatively fast the wstools problem which turned out to be the result of using the full path for the SEI class in the command which I described in point 4 in my first post (as was mentioned in the user guide...). So using a path just to WEB-INF/classes directory solved the problem and the related artifacts are generated correct.
-jbossws14-client.jar is needed for J2EE 1.4, whereas jbossws-client.jar is needed for Java EE; if you keep both jar files order of loading is important depending what you need to use.
-yes I had to get an updated "jboss-xml-binding.jar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036182#4036182
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036182
17 years, 8 months
[JBossWS] - Getting Error
by stattit
We want the web service to publish the user created WSDL instead of the JBOssWS generated WSDL. I followed the instructions as in this post viz.
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031124#4031124
However, I am now getting the following error when I try to deploy the war.
12:19:13,139 ERROR [MainDeployer] Could not create deployment: file:/C:/sofadev/dev-env/jboss-4.0.5.GA/server/flagstar/deploy/fsb-MortgageService.war
org.jboss.deployment.DeploymentException: Cannot create service endpoint; - nested throwable: (java.lang.IllegalArgumentException: Illegal schema location map)
at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
at org.jboss.ws.integration.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:83)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy39.create(Unknown Source)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
Caused by: java.lang.IllegalArgumentException: Illegal schema location map
at org.jboss.ws.tools.JavaToXSD.parseSchema(JavaToXSD.java:155)
at org.jboss.ws.tools.wsdl.WSDL11Reader.processTypes(WSDL11Reader.java:278)
at org.jboss.ws.tools.wsdl.WSDL11Reader.processDefinition(WSDL11Reader.java:165)
at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:131)
at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:313)
at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:139)
at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:49)
at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE.buildMetaData(JAXWSMetaDataBuilderJSE.java:68)
at org.jboss.ws.core.server.ServiceEndpointDeployer.create(ServiceEndpointDeployer.java:90)
at org.jboss.ws.integration.jboss42.DeployerInterceptor.createServiceEndpoint(DeployerInterceptor.java:127)
at org.jboss.ws.integration.jboss42.DeployerInterceptorJSE.createServiceEndpoint(DeployerInterceptorJSE.java:132)
at org.jboss.ws.integration.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:78)
... 28 more
The WSDL file does some imports of external schemas which in turn can import other schemas. The .wsdl file has been placed in WEB-INF/wsdl and the schema files have been copied to the same spot too. The relevant section in the .wsdl file is
| <types>
| <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema/">
| <xsd:import namespace="http://com.fsb.sofa/samples/services/mortgageservice/BorrowerRequest/"
| schemaLocation="BorrowerRequest.xsd">
| </xsd:import>
| <xsd:import namespace="http://com.fsb.sofa/samples/services/mortgageservice/MortgageResponse/"
| schemaLocation="MortgageResponse.xsd">
| </xsd:import>
| <xsd:import namespace="http://com.fsb.sofa/samples/services/mortgageservice/InvalidBorrowerExcep..."
| schemaLocation="InvalidBorrowerException.xsd">
| </xsd:import>
| </xsd:schema>
| </types>
|
My question is this: Is this the proper way to refer to external schemas when you want to publish your own WSDL or would you have to refer to them as
schemaLocation="WEB-INF/wsdl/MortgageResponse.xsd"
The example MortgageResponse.xsd file is (note the import)
| <?xml version="1.0" encoding="UTF-8"?>
| <schema targetNamespace="http://com.fsb.sofa/samples/services/mortgageservice/MortgageResponse" elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:Q1="http://www.example.org/Mortgage" xmlns:mortgage="http://com.fsb.sofa/samples/services/mortgageservice/Mortgage" xmlns:mr="http://com.fsb.sofa/samples/services/mortgageservice/MortgageResponse">
|
| <import schemaLocation="Mortgage.xsd" namespace="http://com.fsb.sofa/samples/services/mortgageservice/Mortgage"></import>
|
|
| <complexType name="MortgageResponseType">
| <sequence>
| <element name="mortgage" type="mortgage:MortgageType"></element>
| <element name="borrowerFirstName" type="string"></element>
| <element name="borrowerLastName" type="string"></element>
| </sequence>
| </complexType>
|
| <element name="MortgageResponse" type="mr:MortgageResponseType"></element>
| </schema>
|
Any help in this matter is appreciated. If you need any additional information, I will be glad to provide it.
JBossWS 1.2.0.SP1
JBoss 4.0.5.GA
Regards
Sandesh
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036058#4036058
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036058
17 years, 8 months