[JBossWS] - .NET client calling Java web-service (SOAPFaultException)
by cowsudders
Hi all
We are replacing a set of .NET web-services with a set of Java ones (deployed into JBoss 4.0.5). All is fine with building/deploying/calling the web-services from .NET - however, I'm having some trouble with regards exceptions.
The .NET client code (which we cannot change), has the following code:
| try {
| doWebServiceCall()
| }
| catch(SoapException se)
| {
| MessageBox.Show("Soap Exception Received! " + se.Message);
| outXmlBrowser.Navigate( WriteToTempFile(se.Detail.InnerXml), ref n_pointer, ref n_pointer, ref n_pointer, ref n_pointer);
| }
The problem is highlighted in bold - I cannot seem to fill the Detail object being returned in the SOAPFaultException I throw in the web-service code. I'm throwing a simple SOAPFaultException as follows:
| try {
| String strXML = MyObject.getXML();
| Detail faultDetail = SOAPFactory.newInstance().createDetail();
| faultDetail.addChildElement("SoapErrorDetail").addChildElement(strXML);
| }
| catch(Exception e) {
| logit(e);
| }
|
The following snippet shows the JBoss log file after the above code executes:
| 2007-07-09 17:46:07,709 DEBUG [javax.xml.rpc.soap.SOAPFaultException] new SOAPFaultException [code={http://schemas.xmlsoap.org/soap/envelope/}Client,string=<?xml version="1.0" encoding="ISO-8859-1"?>
| <SoapErrorDetail xmlns="my.name.space.here" ResultCode="11400" ResultID="InternalError" ResultMessage="Internal error occured "/>
| ,actor=null,detail=null]
|
As can be seen in bold, the Detail object is null....
I have a few questions:
i) How can I create the SOAPFaultException so that the Detail object is not null when it is pushed out of JBoss?
ii) As seen above, I am pushing an XML string into the Detail object. However, I also have this XML document as an org.w3c.dom.Element object. Therefore, it is possible to push the XML document in this form into the Detail object in order to stop it being null? If so, how do I convert an org.w3c.dom.Element object into javax.xml.soap.SOAPElement object in order to add it to the Detail object set within the SOAPFaultException object.
Is it possible to return a Detail object from JBoss?
Thanks in advance for all your help,
Thanks
Kind regards
Dave
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062081#4062081
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4062081
18Â years, 9Â months
[JBossWS] - Re: setHeader and setServerURL, using javax.xml.ws.Service?
by ericï¼ attask.com
That seems to reset the URL:
SforceService service = new SforceService(urlToWSDL, q);
| Soap soapBinding = service.getSoap();
| LoginResult lr = soapBinding.login("username", password");
| ((BindingProvider)soapBinding).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, lr.getServerUrl());
|
That works perfectly, with JBoss 1.2.1 sp1
I still haven't figured out how to set the sessionID. I've tried:
SessionHeader session = new SessionHeader();
| session.setSessionId(lr.getSessionId());
| ((BindingProvider)soapBinding).getRequestContext().put("SessionHeader", session);
|
but I still get the following error:
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SOAPFaultHelperJAXWS.java:56)
at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.throwFaultException(SOAP11BindingJAXWS.java:111)
at org.jboss.ws.core.CommonSOAPBinding.unbindResponseMessage(CommonSOAPBinding.java:460)
at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:333)
at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:185)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:163)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:149)
at $Proxy22.query(Unknown Source)
THIS IS HOW YOU SET THE SESSION HEADER IN AXIS:
SoapBindingStub service; // public class SoapBindingStub extends org.apache.axis.client.Stub implements com.sforce.soap.partner.Soap
SessionHeader sessionHeader = new SessionHeader();
| sessionHeader.setSessionId(sessionID);
|
| String sforceURI = new SforceServiceLocator().getServiceName().getNamespaceURI();
| service.setHeader(sforceURI, "SessionHeader", sessionHeader);
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062080#4062080
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4062080
18Â years, 9Â months
[JBoss Seam] - Re: Problems with seam and icefaces (sending emails)
by kosl
Hi,
I think I managed to do what you asked me to do.
Again the mail example is working, but when I add icefaces to the project I get the following exception:
| 19:25:33,375 ERROR [MailExample] Error sending mail
| java.lang.UnsupportedOperationException
| at javax.faces.context.ExternalContext.getResponseContentType(ExternalContext.java:749)
| at com.sun.faces.renderkit.RenderKitImpl.createResponseWriter(RenderKitImpl.java:183)
| at org.jboss.seam.ui.facelet.FaceletsRenderer$Context.wrap(FaceletsRenderer.java:67)
| at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:109)
| at org.jboss.seam.example.mail.MailExample.sendTemplate(MailExample.java:80)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:43)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
| at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
| at org.jboss.seam.example.mail.MailExample_$$_javassist_15.sendTemplate(MailExample_$$_javassist_15.java)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:325)
| at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:338)
| at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
| at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
| at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
| at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
| at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
| at javax.faces.component.UICommand.broadcast(UICommand.java:383)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
| at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
| at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
| at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:57)
| at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:45)
| at com.icesoft.faces.webapp.http.core.IDVerifier.service(IDVerifier.java:25)
| at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16)
| at com.icesoft.faces.webapp.http.servlet.ViewBoundAdaptingServlet.service(ViewBoundAdaptingServlet.java:44)
| at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
| at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
| at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:97)
| at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:35)
| at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
| at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
| at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:85)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
| at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
| at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:364)
| at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
| at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:54)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
| 19:25:33,468 INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
| sourceId=null[severity=(INFO 0), summary=(Email sending failed: null), detail=(Email sending failed: null)]
|
I was using Jboss 4.2 GA the standard installation - configuration "all"
I'm not sure if its the same problem but I think that probably yes. I've put the ear online www.mimuw.edu.pl/~barter/earseam2.zip
I hope this might help.
Kind Regards,
Karol Oslowski
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062079#4062079
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4062079
18Â years, 9Â months