[Design of JBoss Web Services] - ESB / WS integration issue on AS5
by alessio.soldano@jboss.com
Daniel Bevenius wrote:
Hi Alession,
hope you don't mind me emailing directly. Kevin Conner gave me your email address and I'd like to ask your advice an issue I'm having.
Background
In the ESB you can specify that a service should be exposed as a WS. Upon deploying the service a web-app will get generated
and deployed. As part of this process a number of files get generated, like the webservice implementation, jaxws handler chain, wsdl file.
In JBoss AS 4.x this was done by actually creating a .war file on the local filesystem, but in AS5 it is done by using a
number of deployers.
This is what I want to achive:
1. Generate a wsdl and add that wsdl to a deployment unit so that it will be available to other deployers, mainly the WS deployer(s).
I'm trying to to add the wsdl to an in-memory VFS, and then add that as a metadata location to the deploymentunit. This is done by the following deployer:
http://anonsvn.jboss.org/repos/labs/labs/jbossesb/workspace/dbevenius/jbo...
I'm currently adding this to the Deployment units metadata locations using deploymentUnit.appendMetaDataLocation(dynamicRoot.getRoot()) which I was advised on doing by Ales. I have previously adding it to the classpath but the classpath gets ignored by the tomcat deployer which can be seen in server.log.
3. Generate a ws provider which sets the 'wsdlLocation' attribute to the wsld generated above. This is done by the following deployer:
http://anonsvn.jboss.org/repos/labs/labs/jbossesb/workspace/dbevenius/jbo...
Upon deployment the following error message is displayed:
| Caused by: java.io.IOException: Child not found WEB-INF/wsdl/ESBServiceSample/HelloWorldPubService.wsdl for
| DelegatingHandler(a)18297205[path=Quickstart_publish_as_webservice.esb context=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/ real=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/Quickstart_publish_as_webservice.esb], available children:
| [ZipEntryHandler(a)32154980[path=Quickstart_publish_as_webservice.esb/.classpath context=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/ real=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/Quickstart_publish_as_webservice.esb/.classpath],
| ZipEntryHandler(a)1067582[path=Quickstart_publish_as_webservice.esb/.project context=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/ real=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/Quickstart_publish_as_webservice.esb/.project],
| ZipEntryHandler(a)24788458[path=Quickstart_publish_as_webservice.esb/META-INF context=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/ real=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/Quickstart_publish_as_webservice.esb/META-INF],
| ZipEntryHandler(a)7797905[path=Quickstart_publish_as_webservice.esb/fault.xsd context=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/ real=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/Quickstart_publish_as_webservice.esb/fault.xsd],
| ZipEntryHandler(a)29339526[path=Quickstart_publish_as_webservice.esb/jbmq-queue-service.xml context=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/ real=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/Quickstart_publish_as_webservice.esb/jbmq-queue-service.xml],
| ZipEntryHandler(a)27043349[path=Quickstart_publish_as_webservice.esb/org context=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/ real=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/Quickstart_publish_as_webservice.esb/org],
| ZipEntryHandler(a)22800383[path=Quickstart_publish_as_webservice.esb/request.xsd context=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/ real=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/Quickstart_publish_as_webservice.esb/request.xsd],
| ZipEntryHandler(a)14430122[path=Quickstart_publish_as_webservice.esb/response.xsd context=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/ real=file:/opt/jboss/as/jboss-5.0.1.GA/server/default/deploy/Quickstart_publish_as_webservice.esb/response.xsd]]
| at org.jboss.virtual.VirtualFile.findChild(VirtualFile.java:461)
| at org.jboss.metadata.serviceref.VirtualFileAdaptor.findChild(VirtualFileAdaptor.java:99)
| at org.jboss.wsf.framework.deployment.ArchiveDeploymentImpl.getMetaDataFileURL(ArchiveDeploymentImpl.java:97)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSProviderMetaDataBuilder.buildProviderMetaData(JAXWSProviderMetaDataBuilder.java:125)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:55)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE.buildMetaData(JAXWSMetaDataBuilderJSE.java:61)
| ... 24 more
|
As far as I can tell the WS deployers do not use the metadata location on the deployment unit. I can't see that deployment unit's metadata location is used when JAXWSProviderMetaDataBuilder tries to locate the wsdl.
When a org.jboss.wsf.framework.deployment.ArchiveDeploymentImpl is created by newDeployment(DeploymentUnit) in AbstractDeployerHook, only the deployment unit's simpleName and classloader are used.
ArchiveDeployerHook which extends AbstractDeployerHook attaches the deployment unit (to the ArchiveDeployment), so it would be available to JAXWSProviderMetaDataBuilder and could potentially be used to search for a wsdl set by an earlier deployer. This would require a code modification though.
In JAXWSProviderMetaDataBuilder, line 121
| // Process WSDL
| String wsdlLocation = anWebServiceProvider.wsdlLocation();
| if (wsdlLocation.length() > 0)
| {
| URL wsdlURL = dep.getMetaDataFileURL(wsdlLocation);
| serviceMetaData.setWsdlLocation(wsdlURL); // This is line 125 if you are following the above stacktrace
| }
|
The field dep is an instance of ArchiveDeplomentImpl and its getMetaDataFileUrl looks like this:
| public URL getMetaDataFileURL(String resourcePath) throws IOException
| {
| URL resourceURL = null;
| if (resourcePath != null && resourcePath.length() > 0)
| {
| if (resourcePath.startsWith("/"))
| resourcePath = resourcePath.substring(1);
|
| try
| {
| // assign an absolute URL
| resourceURL = new URL(resourcePath);
| }
| catch (MalformedURLException ex)
| {
| // ignore
| }
|
| if (resourceURL == null && getRootFile() != null)
| {
| UnifiedVirtualFile vfResource = getRootFile().findChild(resourcePath);
| resourceURL = vfResource.toURL();
| }
| }
|
| return resourceURL;
| }
|
If I modify JAXWSProviderMetaDataBuilder, to something like this (pardon the ugly code here):
| // Process WSDL
| String wsdlLocation = anWebServiceProvider.wsdlLocation();
| if (wsdlLocation.length() > 0)
| {
| URL wsdlURL = null;
| DeploymentUnit deploymentUnit = dep.getAttachment(DeploymentUnit.class);
| if (deploymentUnit instanceof VFSDeploymentUnit)
| {
| VFSDeploymentUnit vfsunit = (VFSDeploymentUnit) deploymentUnit;
| VirtualFile metaDataFile = vfsunit.getMetaDataFile(wsdlLocation);
| if (metaDataFile != null)
| {
| try
| {
| wsdlURL = metaDataFile.toURL();
| }
| catch (URISyntaxException e)
| {
| e.printStackTrace();
| }
| }
| }
| if (wsdlURL == null)
| {
| wsdlURL = dep.getMetaDataFileURL(wsdlLocation);
| }
| serviceMetaData.setWsdlLocation(wsdlURL);
| }
|
I updated the jbossws-native-3.0.5.GA/modules/core/pom.xml, but adding the two following dependencies to get the above code to build:
| <dependency>
| <groupId>org.jboss.deployers</groupId>
| <artifactId>jboss-deployers-structure-spi</artifactId>
| <version>2.0.5.GA</version>
| <scope>provided</scope>
| </dependency>
| <dependency>
| <groupId>org.jboss.deployers</groupId>
| <artifactId>jboss-deployers-vfs-spi</artifactId>
| <version>2.0.5.GA</version>
| <scope>provided</scope>
| </dependency>
|
Using this it works for me but this is sort of a hack and perhaps I'm going about this in the wrong way. Is there a better/different way of achiving this?
Thanks,
/Daniel
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225871#4225871
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225871
15 years, 9 months
[Design of JBoss Web Services] - faultString: Endpoint ... Port does not contain operation me
by gopivm
Hi,
I am facing a problem while invoking the web service method which is exposed from stateless session bean (EJB3) by DII client.
This is my development environment.
Eclipse Version: 3.4.0
Jboss-4.3.2.GA
JRE 1.5.0_15
EJB 3.0
I "googled" a lot, but couldn't find any correct solution which actually works. But, there are a lot of people have faced the same problem.
Can somebody help me?
This is the error that I am getting :
AxisFault
| faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
| faultSubcode:
| faultString: Endpoint {http://woss.appservice.nbric.nbpts.com/}WarehouseServiceBeanPort does not contain operation meta data for: {http://schemas.xmlsoap.org/wsdl/}searchPersonsForWarehouseBatch
| faultActor:
| faultNode:
| faultDetail:
| {http://xml.apache.org/axis/}stackTrace:Endpoint {http://woss.appservice.nbric.nbpts.com/}WarehouseServiceBeanPort does not contain operation meta data for: {http://schemas.xmlsoap.org/wsdl/}searchPersonsForWarehouseBatch
| at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
| at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
| at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
|
My client code DII:
| QName serviceName = new QName(
| "http://localhost:8080/nbric-business-appservices/WarehouseServiceBean?wsdl",
| "WarehouseServiceBeanService");
| ServiceFactory factory = ServiceFactory.newInstance();
| Service service = factory.createService(serviceName);
| Call call = service.createCall();
| QName operationName = new QName(BODY_NAMESPACE_VALUE,
| "searchPersonsForWarehouseBatch");
| call.setOperationName(operationName);
| call.setTargetEndpointAddress(endpoint);
| call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
| // call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
| call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);
| QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
| call.setReturnType(QNAME_TYPE_STRING);
| call.setOperationName(new QName(BODY_NAMESPACE_VALUE,
| "searchPersonsForWarehouseBatch"));
|
| call.addParameter("String_1", QNAME_TYPE_STRING, ParameterMode.IN);
| String[] params = { "DEFAULTS13330" };
| // Invoke the WS operation using the JAX-RPC Call's invoke method
| String result = (String) call.invoke(params);
|
WSDL :
| - <definitions name="WarehouseServiceBeanService" targetNamespace="http://woss.appservice.nbric.nbpts.com/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://woss.appservice.nbric.nbpts.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
| - <types>
| - <xs:schema targetNamespace="http://woss.appservice.nbric.nbpts.com/" version="1.0" xmlns:tns="http://woss.appservice.nbric.nbpts.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
| <xs:element name="NBRICApplicationException" type="tns:NBRICApplicationException" />
| <xs:element name="NBRICSystemException" type="tns:NBRICSystemException" />
| <xs:element name="searchPersonsForWarehouseBatch" type="tns:searchPersonsForWarehouseBatch" />
| <xs:element name="searchPersonsForWarehouseBatchResponse" type="tns:searchPersonsForWarehouseBatchResponse" />
| - <xs:complexType name="searchPersonsForWarehouseBatch">
| - <xs:sequence>
| <xs:element minOccurs="0" name="arg0" type="xs:string" />
| </xs:sequence>
| </xs:complexType>
| - <xs:complexType name="searchPersonsForWarehouseBatchResponse">
| - <xs:sequence>
| <xs:element minOccurs="0" name="return" type="xs:string" />
| </xs:sequence>
| </xs:complexType>
| - <xs:complexType name="NBRICApplicationException">
| - <xs:sequence>
| <xs:element minOccurs="0" name="errorCode" type="xs:string" />
| <xs:element minOccurs="0" name="message" type="xs:string" />
| </xs:sequence>
| </xs:complexType>
| - <xs:complexType name="NBRICSystemException">
| - <xs:sequence>
| <xs:element minOccurs="0" name="errorCode" type="xs:string" />
| <xs:element minOccurs="0" name="message" type="xs:string" />
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
| </types>
| - <message name="NBRICSystemException">
| <part element="tns:NBRICSystemException" name="NBRICSystemException" />
| </message>
| - <message name="NBRICApplicationException">
| <part element="tns:NBRICApplicationException" name="NBRICApplicationException" />
| </message>
| - <message name="WarehouseServiceBean_searchPersonsForWarehouseBatchResponse">
| <part element="tns:searchPersonsForWarehouseBatchResponse" name="searchPersonsForWarehouseBatchResponse" />
| </message>
| - <message name="WarehouseServiceBean_searchPersonsForWarehouseBatch">
| <part element="tns:searchPersonsForWarehouseBatch" name="searchPersonsForWarehouseBatch" />
| </message>
| - <portType name="WarehouseServiceBean">
| - <operation name="searchPersonsForWarehouseBatch" parameterOrder="searchPersonsForWarehouseBatch">
| <input message="tns:WarehouseServiceBean_searchPersonsForWarehouseBatch" />
| <output message="tns:WarehouseServiceBean_searchPersonsForWarehouseBatchResponse" />
| <fault message="tns:NBRICSystemException" name="NBRICSystemException" />
| <fault message="tns:NBRICApplicationException" name="NBRICApplicationException" />
| </operation>
| </portType>
| - <binding name="WarehouseServiceBeanBinding" type="tns:WarehouseServiceBean">
| <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
| - <operation name="searchPersonsForWarehouseBatch">
| <soap:operation soapAction="searchPersonsForWarehouseBatchAction" />
| - <input>
| <soap:body use="literal" />
| </input>
| - <output>
| <soap:body use="literal" />
| </output>
| - <fault name="NBRICSystemException">
| <soap:fault name="NBRICSystemException" use="literal" />
| </fault>
| - <fault name="NBRICApplicationException">
| <soap:fault name="NBRICApplicationException" use="literal" />
| </fault>
| </operation>
| </binding>
| - <service name="WarehouseServiceBeanService">
| - <port binding="tns:WarehouseServiceBeanBinding" name="WarehouseServiceBeanPort">
| <soap:address location="http://127.0.0.1:8080/nbric-business-appservices/WarehouseServiceBean" />
| </port>
| </service>
| </definitions>
|
The EJB 3 service:
| @Stateless(name = "WarehouseServiceBean", mappedName = "WarehouseServiceBean")
| @TransactionManagement(TransactionManagementType.CONTAINER)
| @TransactionAttribute(TransactionAttributeType.REQUIRED)
| @WebService
| public class WarehouseServiceBean implements /*WarehouseServiceInterface,*/ Serializable {
|
|
| /**
| *
| */
| private static final long serialVersionUID = 1L;
|
| public WarehouseServiceBean(){
|
| }
| @WebMethod(action="searchPersonsForWarehouseBatchAction" )
| public String searchPersonsForWarehouseBatch(
| String searchString
| )
| throws NBRICApplicationException, NBRICSystemException {
| List<Person> personList = null;
|
| try {
| /* - Commented the DAO code for time being.
| final PersonDAO dao = DAOFactory.getDAOFactory(
| ApplicationConstants.HIBERNATE_DAO_FACTORY).getPersonDAO();
| // Compass Search * Starts
| //personList = dao.searchPersonCompassPOC(searchString);
| // Compass Search * Ends
|
| // Hibernate search
| personList = dao.searchUserPOC(searchString);
|
| int arrayLength = personList.size();
| Person[] personArray = new Person[arrayLength];
| for (int i = 0; i < personArray.length; i++) {
| personArray = personList.get(i);
| }*/
|
|
| return "hello";
|
| /*} catch (NBRICApplicationException e) {
|
| throw e;
| } catch (NBRICSystemException e) {
| throw e;*/
| } catch (Exception e) {
| throw new NBRICSystemException(e, ErrorCode.S_SERVER_DOWN);
| }
| }
|
| }
|
Any help is really appreciated.
Thanks in advance.
- Gopi
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4223463#4223463
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4223463
15 years, 9 months