[JBossWS] - Consuming a web service from an EJB3 stateless sb
by aboudank
Hello,
I am new to JBOSSWS. I am using JBoss 4.0.4.GA, EJB3 RC8 and JBoss WS 1.0.1.GA. I wrote and deployed a JSR 180 WS which worked fine. I can access it from a .NET C# app. Now I am trying to consume this WS from a statless EJB3 and I am not able to do it. Here is what I did:
Using WSTOOLS, I generated the client artifacts which generated the mapping.xml file and the client interfaces. Then I added the following EJB-JAR.xml file in the META-INF directory:
| <?xml version="1.0" encoding="UTF-8"?>
| <ejb-jar
| xmlns="http://java.sun.com/xml/ns/j2ee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:GEE="http://www.poseidon.com/webservices/sgee"
| xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd"
| version="2.1"
| >
| <enterprise-beans>
| <session>
| <ejb-name>MembersManagerBean</ejb-name>
| <service-ref>
| <service-ref-name>service/GEEWebService</service-ref-name>
| <service-interface>javax.xml.rpc.Service</service-interface>
| <wsdl-file>META-INF/wsdl/GEEWebService.wsdl</wsdl-file>
| <jaxrpc-mapping-file>META-INF/GEEWS-jaxrpc-mapping.xml</jaxrpc-mapping-file>
| <mapped-name>service/GEEWebService</mapped-name>
| <port-component-ref>
| <service-endpoint-interface>poseidon.com.webservices.sgee.GEEWebService_Service</service-endpoint-interface>
| </port-component-ref>
| </service-ref>
| </session>
| </enterprise-beans>
| </ejb-jar>
|
I have an empty JBOSS.XML file...should it have anything?
I get a message in the log file that says:
| DEBUG [org.jboss.ejb3.EJBContainer] binding enc: env/service/GEEWebService to service/GEEWebService
|
But I do not see the JNDI binding and when I try to access it using:
| ctx.lookup("java:comp/env/service/GEEWebService");
|
or
| ctx.lookup("service/GEEWebService");
|
I get the following error:
| INFO [STDOUT] GHRRulesManagerBean.getGEEWebService exception: env not bound
|
Please help. Thanks.
Regards,
mka
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983189#3983189
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983189
19 years, 5 months
[JBossWS] - Re: Possible JBoss SwA Bug
by rayymlai
We run the JBossWS swa sample codes, and encounter this problem.
If you uncomment out the build.xml the wstool task example, we find this error.
Could any one help to see if this is a bug in JBossWS?
We also find that there are a few JBossWS sample subprojects sharing the same problem.
| 1. In JBossWS 1.0.3 samples, cd to samples\swa.
|
| 2. Uncomment the following in the build.xml.
|
| <!-- samples/swa - ->
|
| <wstools dest="${build.test.dir}/wstools/resources/samples/swa/WEB-INF"
|
| config="${resources.dir}/wstools-config.xml"/>
|
| -->
|
| 3. ant generate-sources
|
| There should be an error:
|
| C:\projects\jbossws-1.0.3.GA\samples\swa>ant generate-sources
|
| Buildfile: build.xml
|
|
|
| init:
|
| [available] DEPRECATED - <available> used to override an existing property.
|
| [available] Build file should not reuse the same property name for different v
|
| alues.
|
| [echo] jboss.home = c:/jboss-4.0.4.ga
|
| [echo] tomcat.home = c:/projects/jbossws-1.0.3.ga/lib/tomcat
|
| [echo] java.home = C:\Java\jdk1.5.0_06\jre
|
| [echo] node0 = MTVL04AL3H1430
|
|
|
|
|
| compile:
|
|
|
| generate-sources:
|
| [wstools] log4j:WARN No appenders could be found for logger (org.jboss.ws.tool
|
| s.WSTools).
|
| [wstools] log4j:WARN Please initialize the log4j system properly.
|
| [wstools] java.io.IOException: Cannot parse config: Failed to parse source: cvc-complex-type.4: Attribute 'name' must appear on element 'operation'. @ *unknow
|
| n*[12,18]
|
| [wstools] at org.jboss.ws.tools.config.ToolsSchemaConfigReader.readConfig(
|
| ToolsSchemaConfigReader.java:141)
|
| [wstools] at org.jboss.ws.tools.WSTools.readToolsConfiguration(WSTools.jav
|
| a:150)
|
| [wstools] at org.jboss.ws.tools.WSTools.generate(WSTools.java:79)
|
| [wstools] at org.jboss.ws.tools.ant.wstools.execute(wstools.java:103)
|
| [wstools] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
|
| va:275)
|
| [wstools] at org.apache.tools.ant.Task.perform(Task.java:364)
|
| [wstools] at org.apache.tools.ant.Target.execute(Target.java:341)
|
| [wstools] at org.apache.tools.ant.Target.performTasks(Target.java:369)
|
| [wstools] at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
|
| a:1216)
|
| [wstools] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
|
|
|
| [wstools] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
|
| faultExecutor.java:40)
|
| [wstools] at org.apache.tools.ant.Project.executeTargets(Project.java:1068
|
| )
|
| [wstools] at org.apache.tools.ant.Main.runBuild(Main.java:668)
|
| [wstools] at org.apache.tools.ant.Main.startAnt(Main.java:187)
|
| [wstools] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
|
| [wstools] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
|
| [wstools] Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse so
|
| urce: cvc-complex-type.4: Attribute 'name' must appear on element 'operation'. @
|
| *unknown*[12,18]
|
| [wstools] at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBo
|
| ssXBParser.java:156)
|
| [wstools] at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerI
|
| mpl.java:169)
|
| [wstools] at org.jboss.ws.tools.config.ToolsSchemaConfigReader.readConfig(
|
| ToolsSchemaConfigReader.java:137)
|
| [wstools] ... 15 more
|
| [wstools] Caused by: org.xml.sax.SAXException: cvc-complex-type.4: Attribute '
|
| name' must appear on element 'operation'. @ *unknown*[12,18]
|
| [wstools] at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErro
|
| rHandler.error(SaxJBossXBParser.java:326)
|
| [wstools] at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Sour
|
| ce)
|
| [wstools] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown S
|
| ource)
|
| [wstools] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown S
|
| ource)
|
| [wstools] at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter
|
| .reportError(Unknown Source)
|
| [wstools] at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaErro
|
| r(Unknown Source)
|
| [wstools] at org.apache.xerces.impl.xs.XMLSchemaValidator.addDefaultAttrib
|
| utes(Unknown Source)
|
| [wstools] at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartEleme
|
| nt(Unknown Source)
|
| [wstools] at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unk
|
| nown Source)
|
| [wstools] at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElem
|
| ent(Unknown Source)
|
| [wstools] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragmen
|
| tContentDispatcher.dispatch(Unknown Source)
|
| [wstools] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDoc
|
| ument(Unknown Source)
|
| [wstools] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown So
|
| urce)
|
| [wstools] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown So
|
| urce)
|
| [wstools] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
|
| [wstools] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Sou
|
| rce)
|
| [wstools] at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBo
|
| ssXBParser.java:152)
|
| [wstools] ... 17 more
|
|
|
| BUILD FAILED
|
|
|
|
thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983141#3983141
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983141
19 years, 5 months
[JBossWS] - org.jboss.util.xml.DOMWriter error
by qiliu
I am using JSR109 client to consume JSR181 web service. Both are on my local machine. I encounted a NoSuchMethodError on DOMWriter.setPrettyprint when executing the code:
Service service = (Service)iniCtx.lookup("authentication-client/service/AuthenticationService");
I am using jboss-common-client.jar built on 10/16/2006, so I think this is not the error mentioned in http://jira.jboss.com/jira/browse/JBAS-2117.
Any help, please.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.eclipse.ve.internal.java.vce.launcher.remotevm.JavaBeansLauncher.main(JavaBeansLauncher.java:86)
Caused by: java.lang.NoSuchMethodError: org.jboss.util.xml.DOMWriter.setPrettyprint(Z)Lorg/jboss/util/xml/DOMWriter;
at org.jboss.ws.metadata.wsdl.WSDL11Reader.processSchemaInclude(WSDL11Reader.java:332)
at org.jboss.ws.metadata.wsdl.WSDL11Reader.processTypes(WSDL11Reader.java:205)
at org.jboss.ws.metadata.wsdl.WSDL11Reader.processDefinition(WSDL11Reader.java:118)
at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:145)
at org.jboss.ws.metadata.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:273)
at org.jboss.ws.metadata.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:106)
at org.jboss.ws.jaxrpc.ServiceImpl.(ServiceImpl.java:112)
at org.jboss.ws.jaxrpc.ServiceObjectFactory.getObjectInstance(ServiceObjectFactory.java:182)
at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125)
at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(Unknown Source)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983099#3983099
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983099
19 years, 5 months
[JBossWS] - Possible JBoss SwA Bug
by malmit
I am trying to build a document literal web service in JBoss 4.0.5 and can't get around this exception:
org.jboss.ws.WSException: Cannot obtain java/xml type mapping for: {http://www.w3.org/2001/XMLSchema}base64Binary
Here's what my wsdl looks like:
<SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http">
<SOAP:operation style="document" soapAction="Ping">
< input>
<mime:multipartRelated>
<mime:part>
<SOAP:body use="literal"/>
</mime:part>
<mime:part>
<mime:content part="data" type="gzip"/>
</mime:part>
</mime:multipartRelated>
</ input>
< output>
<SOAP:body use="literal"/>
</ output>
</SOAP:operation>
</SOAP:binding>
In my mapping.xml file that wscompile generated, this mapping was generated for the data mime:content:
<variable-mapping>
<java-variable-name>data</java-variable-name>
<xml-element-name>data</xml-element-name>
</variable-mapping>
My ultimate goal is to allow a web service request containing parameters passed via a normal web service request and allow an attachment of a base64 encoded binary file. Is this a bug in JBoss 4.0.5 or did I do something wrong?
Thanks in advanced,
Tim
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983077#3983077
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983077
19 years, 5 months