[JBossWS] - wsprovide & packages with multiple services
by pmckeown
Hi all, I've been searching the forums and not been able to find any posts regarding this issue and I'm new to JBoss so apologies if this has been previously covered.
I'm attempting to expose the business layer of our application as Web Services. As the business layer has already been written, and is used by other parts of the application, one of the requirements of this project is that it doesn't change, so I'm tasked with only using annotations to mark up our code, to create the Web Services.
However, I'm running into an issue when I expose 2 services in the same package. ServiceX and ServiceY both have a create() method that take an XTransferObject and a YTransferObject as parameters. However, when the wsdl and proxy classes are created by wsprovide, the first service's generated code (com.mypackage.jaxws.Create.java) is being overwritten by the second service's generated code as both method's are named the same.
My question is, is there any way to easily alter the code generated by wsprovide, so that it either
a) names the created classes using both the class and method names, i.e.
com.mypackage.jaxws.ServiceX_Create.java and com.mypackage.jaxws.ServiceY_Create.java
or
b) names the package using the annotated class name, such as com.mypackage.servicex instead of com.mypackage.jaxws
or
c) something else....
Any help would be greatly appreciated.
Thanks,
Paul
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218530#4218530
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218530
15 years, 9 months
[JBossWS] - JBoss ws-security client error
by manasamurthy
When I run my web service client war, I get the below error. These are the steps I have followed:
1. Generate code using wsconsume
2. Deploy both client and server (server running locally)
3. Add jboss-wsse-client.xml appropriately
4. On the first call to the server after getting port I get the exception:
[Fatal Error] :-1:-1: Premature end of file.
2009-03-16 00:44:28,298 -0700 ERROR [org.jboss.ws.extensions.security.jaxws.WSSecurityHandler] uniqueId=ec95a826-a291-47ab-abbe-17ecd2435531 hostname=pditvm10286 requestURI=/billing/payment-request/list.url clientIP=127.0.0.1 (abc(a)gmail.com) Cannot handle inbound ws-security
javax.xml.soap.SOAPException: Cannot obtain SOAPHeader from SOAPMessage
at javax.xml.soap.SOAPMessage.getSOAPHeader(SOAPMessage.java:202)
at org.jboss.ws.extensions.security.WSSecurityDispatcher.handleInbound(WSSecurityDispatcher.java:113)
at org.jboss.ws.extensions.security.jaxws.WSSecurityHandler.handleInboundSecurity(WSSecurityHandler.java:78)
at org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient.handleInbound(WSSecurityHandlerClient.java:40)
at org.jboss.ws.core.jaxws.handler.GenericHandler.handleMessage(GenericHandler.java:55)
at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:295)
at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:140)
at org.jboss.ws.core.jaxws.client.ClientImpl.callResponseHandlerChain(ClientImpl.java:168)
at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:363)
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)
at $Proxy304.initializeItemCatalogService(Unknown Source)
My jboss-wsse-client.xml looks like this
<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
</jboss-ws-security>
I have ensured the server code works, by writing a standalone client with the same code and it runs fine. Am I missing anything?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218142#4218142
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218142
15 years, 9 months
[JBossWS] - Casting porblem
by pablinkus
Hi,
I'm quite new with web services, so perhaps it is a stupid question.
I'm working with JBoss 4.2.2 and I've installed JBossws-native 3.0.5.
I've created a simple web service with he method that receive and List of objects.
Something like this:
public long startTramitadorInstance(String processName, List < Product > productList)
Product is a superclass and I've set in it the @XmlSeeAlso tag with the subclasses.
I use the wscompile included in the jbossws-native package tool to generate classese from the WSDL. And if I call this method from a client and the List is formed for several subclasses of the superclass, I always get an Exception:
Caused by: java.lang.ClassCastException: com..beans.product.Product cannot be cast to com..beans.product.Subproduct
Is that normal? Cann't I use superclasses or abstract classes in the methods of the web service? Am I doing something wrong?
Thanks in advance
Pablo
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217622#4217622
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217622
15 years, 9 months
[JBossWS] - Re: How can I print to log file input soap request and respo
by nicvas
Solution for:
server: jbossas 4.2.1.GA
server library: jbossws-1.2
source library: jbossws-src-1.2.1.GA in http://www.jboss.org/jbossws/downloads/
jar_path: jboss/server/default/deploy/jbossws.sar/jbossws-core.jar
package: org.jboss.ws.core.jaxws
class: JAXBDeserializer
method: public Object deserialize(QName xmlName, QName xmlType, Source xmlFragment, SerializationContext serContext) throws BindingException
Must be add the code below:
String sourceString = sourceToString(xmlFragment);
if(log.isDebugEnabled()) log.debug("InputSourceString: "+sourceString);
below the method upgraded:
public Object deserialize(QName xmlName, QName xmlType, Source xmlFragment, SerializationContext serContext) throws BindingException
{
if(log.isDebugEnabled()) log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
Object value = null;
try
{
String sourceString = sourceToString(xmlFragment);
if(log.isDebugEnabled()) log.debug("InputSourceString: "+sourceString);
Class[] javaTypes = (Class[])serContext.getProperty(SerializationContextJAXWS.CONTEXT_TYPES);
TypeMappingImpl typeMapping = serContext.getTypeMapping();
Class javaType = typeMapping.getJavaType(xmlType); // es. javaType: class org.isc.are.ws.jaxws.GetBanner
JAXBContext jaxbContext = getJAXBContext(javaTypes);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
//SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
//Source schemaSource = new StreamSource(new File("/home/jboss/jboss/testdatasource/ARE_GetBannerService.xsd"));
//Schema schema = schemaFactory.newSchema(schemaSource);
//unmarshaller.setSchema(schema);
unmarshaller.setAttachmentUnmarshaller( new AttachmentUnmarshallerImpl());
JAXBElement jbe = unmarshaller.unmarshal(xmlFragment, javaType);
value = jbe.getValue();
if(log.isDebugEnabled()) log.debug("deserialized: " + (value != null ? value.getClass().getName() : null)); //deserialized: org.isc.are.ws.jaxws.GetBanner
}
catch (Exception ex)
{
log.error("error during deserialize.", ex);
handleUnmarshallException(ex);
}
return value;
}
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217571#4217571
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217571
15 years, 9 months