[JBossWS] - ant tests errors: SOAP request exception
by soch
Ran the ant tests on the native jaxws installation.
Saw following errors on the JBOSS AS. Is this normal.
C:\jbossws-3.0.1-native-2.0.4.GA\jbossws-native-dist>ant tests
...
15:03:10,254 INFO [WSDLFilePublisher] WSDL published to: file:/C:/jboss-4.2.2.GA/server/default/data/wsdl/jaxws-samples-exception.w
ar/ExceptionEndpointImplService41482.wsdl
15:03:11,364 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
java.lang.RuntimeException: oh no, a runtime exception occured.
at org.jboss.test.ws.jaxws.samples.exception.server.ExceptionEndpointImpl.throwRuntimeException(ExceptionEndpointImpl.java:3
9)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
...
15:03:11,770 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
javax.xml.ws.soap.SOAPFaultException: this is a fault string!
at org.jboss.test.ws.jaxws.samples.exception.server.ExceptionEndpointImpl.throwSoapFaultException(ExceptionEndpointImpl.java
:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
...
& some more simillar SOAP exceptions.
On the client side the ant tests threw following failures:
[junit] Corrupt JPEG data: 1 extraneous bytes before marker 0xc4
[junit] Test org.jboss.test.ws.jaxws.samples.xop.doclit.XOPBareTestCase FAILED
[junit] Running org.jboss.test.ws.jaxws.samples.xop.doclit.XOPHandlerTestCase
[junit] Tests run: 7, Failures: 1, Errors: 0, Time elapsed: 4.313 sec
15:05:00,791 INFO [TestEndpointImpl] echo: Hello
15:05:00,838 INFO [TestEndpointImpl] echo: Hello
15:05:00,854 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
org.jboss.ws.core.CommonSOAPFaultException: Endpoint {http://webmethod.samples.jaxws.ws.test.jboss.org/}TestEndpointPort does not co
ntain operation meta data for: {http://webmethod.samples.jaxws.ws.test.jboss.org/}noWebMethod
at org.jboss.ws.core.server.ServiceEndpointInvoker.getDispatchDestination(ServiceEndpointInvoker.java:468)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147674#4147674
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147674
16 years, 10 months
[JBossWS] - Exception making a Webservice call
by amit.sfbay
I am calling a Webservice from the JBoss web container and I am getting the exception given below. The Webservice is deployed in a Websphere server on another box, but this looks like a client side exception to me. What I did was - I used wsconsume to generate the client side stubs from the WSDL and put the jar in web-inf/lib and used it from a servlet.
Any help will be appreciated.
Caused by: javax.xml.ws.soap.SOAPFaultException: Transport level information does not match with SOAP Message namespace URI
at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SOAPFaultHelperJAXWS.java:69)
at org.jboss.ws.core.jaxws.binding.SOAP12BindingJAXWS.throwFaultException(SOAP12BindingJAXWS.java:117)
at org.jboss.ws.core.CommonSOAPBinding.unbindResponseMessage(CommonSOAPBinding.java:553)
at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:371)
at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:243)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:164)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147670#4147670
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147670
16 years, 10 months
[JBossWS] - Java to XML for web services
by AceFrehley
Hi. I have a java pojo that I am converting to an XML string and then returning from a web service (JAXB). I have to make sure that the data is returned in a CDATA block, so I used XMLSerializer from this example as a guide:
|
| https://jaxb.dev.java.net/faq/JaxbCDATASample.java
|
|
Everything works fine, but I have read that in Xerces 2.9.0, the XMLSerializer and OutputFormat classes are deprecated. What is the equivalent (non-deprecated) code for transforming a Java pojo to XML? I cannot find any examples online that do the equivalent type of this transformation using STAX or DOM.If anybody could share an example or their approach to doing this, that would be great.
Also, I am using the Marshaller from JAXB, but just to reiterate, I also need the XMLSerializer functionality which prevents <> characters from being returned as HTML < and > tags to the client.
Also, how can I find out what version of Xerces is used for a particular version of JBoss AS? I would like to know the Xerces version for JBoss AS 4.2.2 and 5.0. I checked inside the xercesimpl.jar in the lib/endorsed directory, but the manifest file said Xerces version 1.2? Am I reading that correctly?
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147635#4147635
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147635
16 years, 10 months
[JBossWS] - Re: Newbee Q: Returning hashmaps
by soch
"mikkus" wrote : toString() outputs the contents of the HashMap only if the class generated is actually a HashMap, otherwise it outputs the java class instance name.
|
| Most probably, wsconsume generated a class named HashMap, instead of using java.util.HashMap. This class is not actually a hashmap but a representation of the web service return data. Most probably, you'll need to convert that data to an actual hashmap.
|
| I notice you commented out the cast to java.util.HashMap, probably you got a ClassCastException here? Seeing the class generated by wsconsume and related wsdl would help.
|
| Your web.xml file should not be the problem. It just exposes the webservice, and since you're able to invoke it, it is doing its job.
Thanks mikkus. Yes, wsconsume creates it's own HashMap which inherits from it's own AbstractMap.
How do I convert the wsconsume generated HashMap to java.util.HashMap? I believe this needs to be done at the client side.
Data below:
C:\..\test\webservices> wsconsume -k http://localhost:8080/getpm/GetPM?wsdl
JBossWS-Native stack deployed
parsing WSDL...
generating code...
getpm\AbstractMap.java
getpm\GetPM.java
getpm\GetPMResponse.java
getpm\GetPMService.java
getpm\GetPM_Type.java
getpm\HashMap.java
getpm\ObjectFactory.java
getpm\package-info.java
HashMap.java:
| package getpm;
|
| import javax.xml.bind.annotation.XmlAccessType;
| import javax.xml.bind.annotation.XmlAccessorType;
| import javax.xml.bind.annotation.XmlType;
|
|
| /**
| * <p>Java class for hashMap complex type.
| *
| * <p>The following schema fragment specifies the expected content contained within this class.
| *
| * <pre>
| * <complexType name="hashMap">
| * <complexContent>
| * <extension base="{http://getpm/}abstractMap">
| * <sequence>
| * </sequence>
| * </extension>
| * </complexContent>
| * </complexType>
| * </pre>
| *
| *
| */
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "hashMap")
| public class HashMap
| extends AbstractMap
| {
|
|
| }
AbstractMap.java:
package getpm;
|
| import javax.xml.bind.annotation.XmlAccessType;
| import javax.xml.bind.annotation.XmlAccessorType;
| import javax.xml.bind.annotation.XmlType;
|
|
| /**
| * <p>Java class for abstractMap complex type.
| *
| * <p>The following schema fragment specifies the expected content contained within this class.
| *
| * <pre>
| * <complexType name="abstractMap">
| * <complexContent>
| * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
| * <sequence>
| * </sequence>
| * </restriction>
| * </complexContent>
| * </complexType>
| * </pre>
| *
| *
| */
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "abstractMap")
| public abstract class AbstractMap {
|
|
| }
The generated service WSDL under C:\jboss-4.2.2.GA\server\default\data\wsdl\getpm.war
GetPMService31986.wsdl:
<?xml version="1.0" encoding="UTF-8"?>
| <definitions name="GetPMService" targetNamespace="http://getpm/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://getpm/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
| <types>
| <xs:schema targetNamespace="http://getpm/" version="1.0" xmlns:tns="http://getpm/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
| <xs:element name="getPM" type="tns:getPM"/>
| <xs:element name="getPMResponse" type="tns:getPMResponse"/>
| <xs:complexType name="getPM">
| <xs:sequence/>
| </xs:complexType>
| <xs:complexType name="getPMResponse">
| <xs:sequence>
| <xs:element minOccurs="0" name="return" type="tns:hashMap"/>
| </xs:sequence>
| </xs:complexType>
| <xs:complexType name="hashMap">
| <xs:complexContent>
| <xs:extension base="tns:abstractMap">
| <xs:sequence/>
| </xs:extension>
| </xs:complexContent>
| </xs:complexType>
| <xs:complexType abstract="true" name="abstractMap">
| <xs:sequence/>
| </xs:complexType>
| </xs:schema>
| </types>
| <message name="GetPM_getPMResponse">
| <part name="getPMResponse" element="tns:getPMResponse">
| </part>
| </message>
| <message name="GetPM_getPM">
| <part name="getPM" element="tns:getPM">
| </part>
| </message>
| <portType name="GetPM">
| <operation name="getPM" parameterOrder="getPM">
| <input message="tns:GetPM_getPM">
| </input>
| <output message="tns:GetPM_getPMResponse">
| </output>
| </operation>
| </portType>
| <binding name="GetPMBinding" type="tns:GetPM">
| <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
| <operation name="getPM">
| <soap:operation soapAction=""/>
| <input>
| <soap:body use="literal"/>
| </input>
| <output>
| <soap:body use="literal"/>
| </output>
| </operation>
| </binding>
| <service name="GetPMService">
| <port name="GetPMPort" binding="tns:GetPMBinding">
| <soap:address location="http://127.0.0.1:8080/getpm/GetPM"/>
| </port>
| </service>
| </definitions>
I tried the convertion but got errors:
C:\Documents and Settings\jaina\My Documents\Work\CODE\test\webservices\getpm\output>wsrunclient GetPMclient
log4j:WARN No appenders could be found for logger (org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder).
log4j:WARN Please initialize the log4j system properly.
getpm.HashMap@1a0b53e
C:\Documents and Settings\jaina\My Documents\Work\CODE\test\webservices\getpm\output>javac GetPMclient.java
GetPMclient.java:13: inconvertible types
found : getpm.HashMap
required: java.util.HashMap
java.util.HashMap hm = (java.util.HashMap) pm.getPM();
^
1 error
import getpm.*;
|
| import java.util.HashMap;
|
| public class GetPMclient
| {
| public static void main(String args[])
| {
|
| GetPMService service = new GetPMService();
| GetPM pm = service.getGetPMPort();
| //System.out.println("Server said: " + pm.getPM());
| java.util.HashMap hm = (java.util.HashMap) pm.getPM();
| System.out.println(hm.toString());
|
|
|
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147520#4147520
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147520
16 years, 10 months
[JBossWS] - Error deploying EJB 3 Webservice on Jboss 5.0.0 Beta 4
by felle82
Hi all,
When I deploy my ear containig a Webservice implementation I have a Nested Exeption:
15:52:40,102 ERROR [AbstractKernelController] Error installing to Real: name=vfsfile:/D:/DEV/jboss-5.0.0.Beta4/server/default/deploy/SII_PublishSubscribeEAR.ear state=PostClassLoader mo
| de=Manual requiredState=Real
| org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/D:/DEV/jboss-5.0.0.Beta4/server/default/deploy/SII_PublishSubscribeEAR.ear/SII_PublishSubscribe.jar
| at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:175)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:906)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:246)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:131)
| at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:408)
| at org.jboss.Main.boot(Main.java:208)
| at org.jboss.Main$1.run(Main.java:534)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jboss.wsf.spi.deployment.WSFDeploymentException: javax.xml.ws.WebServiceException: org.dom4j.DocumentException: java.sun.com Nested exception: java.sun.com
| at org.jboss.wsf.spi.deployment.WSFDeploymentException.rethrow(WSFDeploymentException.java:54)
| at org.jboss.wsf.container.jboss50.WebAppDeploymentAspect.create(WebAppDeploymentAspect.java:87)
| at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:115)
| at org.jboss.wsf.container.jboss50.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:95)
| at org.jboss.wsf.container.jboss50.AbstractWebServiceDeployer.internalDeploy(AbstractWebServiceDeployer.java:63)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
| ... 18 more
| Caused by: javax.xml.ws.WebServiceException: org.dom4j.DocumentException: java.sun.com Nested exception: java.sun.com
| at org.jboss.wsf.container.jboss50.WebXMLRewriterImpl.rewriteWebXml(WebXMLRewriterImpl.java:92)
| at org.jboss.wsf.container.jboss50.WebAppDeploymentAspect.create(WebAppDeploymentAspect.java:74)
| ... 23 more
| Caused by: org.dom4j.DocumentException: java.sun.com Nested exception: java.sun.com
| at org.dom4j.io.SAXReader.read(SAXReader.java:484)
| at org.dom4j.io.SAXReader.read(SAXReader.java:343)
| at org.jboss.wsf.container.jboss50.WebXMLRewriterImpl.rewriteWebXml(WebXMLRewriterImpl.java:111)
| at org.jboss.wsf.container.jboss50.WebXMLRewriterImpl.rewriteWebXml(WebXMLRewriterImpl.java:84)
| ... 24 more
| 15:52:40,350 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
|
| *** CONTEXTS IN ERROR: Name -> Error
|
| vfsfile:/D:/DEV/jboss-5.0.0.Beta4/server/default/deploy/SII_PublishSubscribeEAR.ear -> org.dom4j.DocumentException: java.sun.com Nested exception: java.sun.com
My java Class and Interface look as follows:/**
| *
| */
| package com.test.sii.pubsub;
|
| import java.util.ArrayList;
| import java.util.Date;
|
| import javax.ejb.EJB;
| import javax.ejb.Stateless;
| import javax.jws.WebService;
|
| import com.test.sii.pubsub.entity.Subscriber;
|
| /**
| *
|
| * @author I052946
| *
| */
| @WebService(serviceName="PublishSubscribeService", endpointInterface="com.test.sii.pubsub.PublishSubscribeRemote", portName="PublishSubscribeBeanPort", targetNamespace="http://test.com/sii/pubsub/")
| @Stateless
| public class PublishSubscribeBean implements PublishSubscribeRemote{
|
| @EJB
| private SubscriptionManagerLocal subscriptionManagerLocal;
|
| public String notify(String topic,String Message) {
| ArrayList<Subscriber> subscribers = subscriptionManagerLocal.getSubscriberForTopics(topic);
| for (Subscriber subscriber : subscribers) {
| notifySubscriber(subscriber);
| }
| return "Notified";
| }
|
| public String subscribe(String topic, String endpoint, Date duration) {
| Subscriber subscriper = new Subscriber();
| subscriper.setEndpoint(endpoint);
| int id = subscriptionManagerLocal.registerSubscription(topic, subscriper, duration);
| return "Subscription with id "+ id+" was registered at "+duration;
| }
|
|
| private void notifySubscriber(Subscriber subscriber){
|
| }
| }
|
/**
| *
| */
| package com.test.sii.pubsub;
|
| import java.util.Date;
|
| import javax.ejb.Remote;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.WebParam;
|
| /**
| * @author I052946
| *
| */
| @WebService(name="PublishSubscribeRemote", targetNamespace="http://test.com/sii/pubsub/")
| @Remote
| public interface PublishSubscribeRemote {
|
|
| @WebMethod(operationName="notify")
| public String notify(@WebParam(name="topic")
| String topic,@WebParam(name="message")
| String message);
|
| @WebMethod(operationName="subscribe")
| public String subscribe(@WebParam(name="topic")
| String topic,@WebParam(name="endpoint")
| String endpoint, @WebParam(name="duration")
| Date duration);
|
| }
|
Any hints?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147517#4147517
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147517
16 years, 10 months