[JBoss Web Services Users] - JAXB custom type mapping in JBossWS client not working quest
by joseph.miller
Hi, I hope someone on here can help with this one.
I'm trying to use JAXB to map xsd:date and xsd:time types in a WSDL I've been provided with, to a type more sensible than XMLGregorianCalendar, in my case Joda LocalTime and LocalDate types.
I have a binding xml file that looks like:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0" targetNamespace="urn:DefaultNamespace">
| <xs:annotation >
| <xs:appinfo>
| <jaxb:globalBindings>
| <jaxb:javaType name="org.joda.time.LocalDate" xmlType="xs:date"
| parseMethod="bookit.util.DateTimeUtil.parseLocalDate"
| printMethod="bookit.util.DateTimeUtil.printLocalDate"/>
| <jaxb:javaType name="org.joda.time.LocalTime" xmlType="xs:time"
| parseMethod="bookit.util.DateTimeUtil.parseLocalTime"
| printMethod="bookit.util.DateTimeUtil.printLocalTime"/>
| </jaxb:globalBindings>
| </xs:appinfo>
| </xs:annotation>
| </xs:schema>
With my own parse/print static methods defined on my DateTimeUtil class.
I can successfully run the WSDL through wsimport, and this seems to generate the service interface with methods that look like:
@WebService(name = "AppointmentService", targetNamespace = "urn:DefaultNamespace")
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| @XmlSeeAlso({
| ObjectFactory.class
| })
| public interface AppointmentService {
| ...
| @WebMethod(operationName = "GETAPPOINTMENTS")
| @WebResult(name = "GETAPPOINTMENTSReturn", partName = "GETAPPOINTMENTSReturn")
| public XsdAnyTypeArray getappointments(
| @WebParam(name = "ADVISER", partName = "ADVISER")
| String adviser,
| @XmlJavaTypeAdapter(Adapter1 .class)
| @WebParam(name = "STARTDATE", partName = "STARTDATE")
| LocalDate startdate,
| @XmlJavaTypeAdapter(Adapter1 .class)
| @WebParam(name = "ENDDATE", partName = "ENDDATE")
| LocalDate enddate);
| ...
| }
and the generated Adapter classes use my parse/print methods.
However, when I use this as a client, the adapters don't seem to be used, i.e. the SOAP request comes out looking like:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:DefaultNamespace">
| <soapenv:Header/>
| <soapenv:Body>
| <urn:GETAPPOINTMENTS>
| <ADVISER>myuser</ADVISER>
| <STARTDATE/>
| <ENDDATE/>
| </urn:GETAPPOINTMENTS>
| </soapenv:Body>
| </soapenv:Envelope>
Is there something else I need to be doing to make this work?
I'm currently using JDK6, Seam 2.1.2, and JBoss 4.2.2 (with the jboss-jaxws.jar etc in endorsed). I've also tried this on JBoss 5.0, but with the same result.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4260980#4260980
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4260980
15 years, 2 months
Rewriting soap:address location
by tag
Hello,
I am using a load balancer, normally it's fine if the client gets the
WSDL every time it calls it, but some clients cache it, and parse out
the soap:address. This means they will always hit the same server, I
believe.
Is there a simple way to change the following part of the WSDL:
<port binding="ServiceBinding" name="ServicePort">
<soap:address location="http://host.com:8780/service/ServiceService"/>
</port>
Instead of host.com:8780, I would like to set this value on a per
deployment basis and not on the entire instance.
Which file(s) could I modify to accomplish this?
Thanks,
Ben
15 years, 2 months
[JBoss Web Services Users] - Re: java.lang.LinkageError: loader constraint violation:(In
by a.couso
Hello everyone,
I have know the same issue, but I cannot solve because the link wrote by GajananmM doesn't forward to any downloadable file....
I am using Jboss 5.0 AS and I have develop the client using wsconsume.
Here we go...
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:498)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
causa raÃz
javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: when resolving method "javax.xml.ws.Service.(Ljava/net/URL;Ljavax/xml/namespace/QName;)V" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, endpointrecargaremota/RecargaRemotaWSService, and the class loader (instance of ) for resolved class, javax/xml/ws/Service, have different Class objects for the type javax/xml/namespace/QName used in the signature
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:852)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.newuser_jsp._jspService(newuser_jsp.java:151)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
causa raÃz
java.lang.LinkageError: loader constraint violation: when resolving method "javax.xml.ws.Service.(Ljava/net/URL;Ljavax/xml/namespace/QName;)V" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, endpointrecargaremota/RecargaRemotaWSService, and the class loader (instance of ) for resolved class, javax/xml/ws/Service, have different Class objects for the type javax/xml/namespace/QName used in the signature
endpointrecargaremota.RecargaRemotaWSService.(RecargaRemotaWSService.java:45)
org.apache.jsp.newuser_jsp._jspService(newuser_jsp.java:91)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96
Thank you in advance
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4260870#4260870
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4260870
15 years, 2 months
[JBoss Web Services Users] - Re: XOM fails in production but works in dev
by pwnell
Additional info that might help - the SOAP message sent from the client to the server to upload the test file for the local dev scenario (working):
| POST./LicensingWSBeanService/WSServerLargeFileTransferBean.HTTP/1.1
| Soapaction:.""
| Accept:.text/xml,.multipart/related,.text/html,.image/gif,.image/jpeg,.*;.q=.2,.*/*;.q=.2
| Content-type:.multipart/related;start="<rootpart*480a4f5f-b9ea-4c31-b857-3d36f5dca84e(a)example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:480a4f5f-b9ea-4c31-b857-3d36f5dca84e";start-info="text/xml"
| User-Agent:.JAX-WS.RI.2.1.6.in.JDK.6
| Host:.DEV:8080
| Connection:.keep-alive
| Content-Length:.955
|
| --uuid:480a4f5f-b9ea-4c31-b857-3d36f5dca84e
| Content-Id:.<rootpart*480a4f5f-b9ea-4c31-b857-3d36f5dca84e(a)example.jaxws.sun.com>
| Content-Type:.application/xop+xml;charset=utf-8;type="text/xml"
| Content-Transfer-Encoding:.binary
|
| <?xml.version="1.0".?>
| <S:Envelope.xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
| <S:Body>
| <ns2:uploadApplicationUpdates.xmlns:ns2="http://webservice.licensing.sarad.co.za/">
| <arg0>70923672990106339906486742558683167563297568954954</arg0>
| <arg1>2100</arg1>
| <arg2>
| <xop:Include.xmlns:xop="http://www.w3.org/2004/08/xop/include".href="cid:d477c76d-d33f-46d6-92a8-701e2a8d1901@example.jaxws.sun.com"></xop:Include>
| </arg2>
| </ns2:uploadApplicationUpdates>
| </S:Body>
| </S:Envelope>
| --uuid:480a4f5f-b9ea-4c31-b857-3d36f5dca84e
| Content-Id:.<d477c76d-d33f-46d6-92a8-701e2a8d1901(a)example.jaxws.sun.com>
| Content-Type:.application/octet-stream
| Content-Transfer-Encoding:.binary
|
| ..........
| --uuid:480a4f5f-b9ea-4c31-b857-3d36f5dca84e--
|
|
| And for the production scenario (not working):
|
|
| | POST./LicensingWSBeanService/WSServerLargeFileTransferBean.HTTP/1.1
| | SOAPAction:.""
| | Accept:.text/xml,.multipart/related,.text/html,.image/gif,.image/jpeg,.*;.q=.2,.*/*;.q=.2
| | Content-Type:.multipart/related;type="application/xop+xml";boundary="uuid:78c1dc43-5c49-43c5-af8b-1f06fd985e58";start-info="text/xml"
| | User-Agent:.Java/1.6.0_10
| | Host:.PROD:8080
| | Connection:.keep-alive
| | Content-Length:.517
| |
| | --uuid:78c1dc43-5c49-43c5-af8b-1f06fd985e58
| | Content-Type:.application/xop+xml;charset=utf-8;type="text/xml"
| | Content-Transfer-Encoding:.binary
| |
| | <?xml.version="1.0".?>
| | <S:Envelope.xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
| | <S:Body>
| | <ns2:uploadApplicationUpdates.xmlns:ns2="http://webservice.licensing.sarad.co.za/">
| | <arg0>01475913245426691815944254703234806328018572161348</arg0>
| | <arg1>2100</arg1>
| | <arg2></arg2>
| | </ns2:uploadApplicationUpdates>
| | </S:Body>
| | </S:Envelope>
| | --uuid:78c1dc43-5c49-43c5-af8b-1f06fd985e58--
| |
|
| It is interesting to see the User-Agent differ even though both client machines run JDK6. Ignore the periods - most of them represent spaces.
|
| Ideas?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4260856#4260856
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4260856
15 years, 2 months
[JBoss Web Services Users] - XOM fails in production but works in dev
by pwnell
I really need urgent help please. I have implemented a web service using XOM to transfer large files from the client to the web service. In dev this works fine, however in production I see no errors in the log file, yet the inputstream yields 0 bytes when reading the file.
I am using jbossws-3.0.1-native-2.0.4.GA (build=200803312044) on JBoss 4.2.3 GA. Here are the log files:
| 2009-10-17 00:12:44,525 DEBUG [org.jboss.wsf.stack.jbws.RequestHandlerImpl] doPost: /LicensingWSBeanService/WSServerLargeFileTransferBean
| 2009-10-17 00:12:44,525 DEBUG [org.jboss.wsf.stack.jbws.RequestHandlerImpl] handleRequest: jboss.ws:context=LicensingWSBeanService,endpoint=WSServerLargeFileTransferBean
| 2009-10-17 00:12:44,525 DEBUG [org.jboss.ws.core.soap.MessageContextAssociation] pushMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@4964f4eb (Thread http-0.0.0.0-8080-1)
| 2009-10-17 00:12:44,525 DEBUG [org.jboss.wsf.stack.jbws.RequestHandlerImpl] BEGIN handleRequest: jboss.ws:context=LicensingWSBeanService,endpoint=WSServerLargeFileTransferBean
| 2009-10-17 00:12:44,525 DEBUG [org.jboss.ws.core.soap.MessageFactoryImpl] createMessage: [contentType=multipart/related; type="application/xop+xml";
| boundary="uuid:604b4c1b-9578-4a57-897e-fa68d07da32e";
| start-info="text/xml"]
| 2009-10-17 00:12:44,541 DEBUG [org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource] Using memory buffer, size = 325
| 2009-10-17 00:12:44,556 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@2f57d162, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@7b04eff0{ url=null ,addedOrder=0}
| 2009-10-17 00:12:44,583 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: POST
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: PRE
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] addHandler:
| HandlerMetaDataJAXWS:
| type=PRE
| name=Recording Handler
| class=class org.jboss.wsf.framework.invocation.RecordingServerHandler
| params=[]
| protocols=##SOAP11_HTTP
| services=null
| ports=null
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: ENDPOINT
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: POST
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [type=POST,info=[service={http://webservice.licensing.sarad.co.za/}WSServe...]
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.soap.SOAPMessageDispatcher] getDispatchDestination: {http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS] unbindRequestMessage: {http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.EndpointInvocation] setRequestParamValue: [name={http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates,value=org.jboss.ws.core.soap.SOAPBodyElementDoc]
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: ENDPOINT
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [type=ENDPOINT,info=[service={http://webservice.licensing.sarad.co.za/}WSS...]
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: PRE
| 2009-10-17 00:12:44,584 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [type=PRE,info=[service={http://webservice.licensing.sarad.co.za/}WSServer...]
| 2009-10-17 00:12:44,585 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
| 2009-10-17 00:12:44,585 DEBUG [org.jboss.ws.core.EndpointInvocation] getRequestPayload
| 2009-10-17 00:12:44,585 DEBUG [org.jboss.ws.core.EndpointInvocation] getRequestParamValue: {http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates
| 2009-10-17 00:12:44,585 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] -----------------------------------
| 2009-10-17 00:12:44,585 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] Transitioning from XML_VALID to OBJECT_VALID
| 2009-10-17 00:12:44,585 DEBUG [org.jboss.ws.core.soap.XMLContent] getObjectValue [xmlType={http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates,javaType=class za.co.sarad.licensing.webservice.jaxws.UploadApplicationUpdates]
| 2009-10-17 00:12:44,587 DEBUG [org.jboss.ws.core.jaxws.JAXBDeserializer] deserialize: [xmlName={http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates,xmlType={http://webservice.licensing.sarad.co.za/}uploadApplicationUpdates]
| 2009-10-17 00:12:44,588 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@2f57d162, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@3b4768cc{ url=null ,addedOrder=0}
| 2009-10-17 00:12:44,589 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@2f57d162, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@4d31477b{ url=null ,addedOrder=0}
| 2009-10-17 00:12:44,617 DEBUG [org.jboss.ws.core.jaxws.JAXBDeserializer] deserialized: za.co.sarad.licensing.webservice.jaxws.UploadApplicationUpdates
| 2009-10-17 00:12:44,617 DEBUG [org.jboss.ws.core.soap.XMLContent] objectValue: za.co.sarad.licensing.webservice.jaxws.UploadApplicationUpdates
| 2009-10-17 00:12:44,617 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] -----------------------------------
| 2009-10-17 00:12:44,617 DEBUG [org.jboss.ws.core.EndpointInvocation] transformPayloadValue: org.jboss.ws.core.soap.SOAPBodyElementDoc -> za.co.sarad.licensing.webservice.jaxws.UploadApplicationUpdates
| 2009-10-17 00:12:44,619 DEBUG [org.jboss.ws.core.jaxrpc.ParameterWrapping] unwrapRequestParameters: za.co.sarad.licensing.webservice.jaxws.UploadApplicationUpdates
| 2009-10-17 00:12:44,619 DEBUG [org.jboss.wsf.framework.DefaultSPIProvider] provide SPI 'class org.jboss.wsf.spi.invocation.WebServiceContextFactory'
| 2009-10-17 00:12:44,620 DEBUG [org.jboss.wsf.framework.DefaultSPIProvider] class org.jboss.wsf.spi.invocation.WebServiceContextFactory Implementation: org.jboss.wsf.container.jboss42.WebServiceContextFactoryImpl@315a5aff
| 2009-10-17 00:12:44,624 INFO [STDOUT] ..........1
| 2009-10-17 00:12:44,624 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@2f57d162, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@5c4e0c39{ url=null ,addedOrder=0}
| 2009-10-17 00:12:44,625 INFO [STDOUT] ..........2
| 2009-10-17 00:12:44,625 INFO [STDOUT] .........3
| 2009-10-17 00:12:44,625 INFO [STDOUT] tmpfile = /tmp/ws_dump1540207851695323714dump
| 2009-10-17 00:12:54,627 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@2f57d162, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@6808aa2d{ url=null ,addedOrder=0}
| 2009-10-17 00:12:54,628 INFO [STDOUT] vInputStream.available() = >0<
|
|
| Here is the WS code:
|
|
| | @WebService
| | @BindingType(value = SOAPBinding.SOAP11HTTP_MTOM_BINDING)
| | @MTOM(enabled = true)
| | @Stateless
| | @WebContext(contextRoot = "/LicensingWSBeanService")
| | public class WSServerLargeFileTransferBean {
| |
| | @WebMethod
| | public boolean uploadApplicationUpdates(String pKey, int pClientBuildNumber, @XmlMimeType("application/octet-stream") DataHandler pDataHandler) {
| | try {
| | Security.validate(pKey);
| |
| | System.out.println("..........1");
| |
| | Object vDataContent = pDataHandler.getContent();
| | if (!(vDataContent instanceof InputStream))
| | throw new RuntimeFailureException("DataHandler is not an InputStream!");
| |
| | System.out.println("..........2");
| |
| | InputStream vInputStream = (InputStream)vDataContent;
| | BufferedInputStream vBIS = new BufferedInputStream(vInputStream);
| |
| | System.out.println(".........3");
| |
| | File vTmpFile = File.createTempFile("ws_dump", "dump");
| |
| | System.out.println("tmpfile = "+vTmpFile.getCanonicalPath());
| | try {
| | byte[] vBuf = new byte[10240];
| | int vLen;
| | FileOutputStream vFOS = new FileOutputStream(vTmpFile);
| |
| | try {
| | System.out.println("vInputStream.available() = >" + vInputStream.available() + "<");
| | while ((vLen = vBIS.read(vBuf, 0, vBuf.length)) != -1) {
| | System.out.println("vLen = >" + vLen + "<");
| | vFOS.write(vBuf, 0, vLen);
| | }
| | ...
| |
|
| and the client code:
|
|
| | boolean vRes = vWSServerLargeFileTransfer.uploadApplicationUpdates(Security.generateKey(), vClientBuildNumber, new DataHandler(vTestFile, "application/octet-stream"));
| |
|
| Any ideas?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4260849#4260849
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4260849
15 years, 2 months