[JBossWS] - Troubles with JBossWS and Persistence
by dpocock
Hi,
I use hibernate generated objects throughout much of my application.
I can successfully use these with Java RMI, however, I am facing many challenges with web services.
a) is it necessary for me to rewrite all the classes using arrays instead of the collections that are created by HibernateTool?
b) when and why is it necessary to encapsulate an array in an object? I've seen this design pattern in some examples in the forums and elsewhere.
c) Is JBossWS eventually going to allow Hibernate style object graphs to be transferred seamlessly over a web services endpoint as an argument or return type?
d) I've created an EJB3 class annotated @Stateless and @WebService. The @PersistenceContext annotation is ignored and the entity manager is not injected. I've seen this issue documented elsewhere, but without a clear solution. Is this issue fixed in the current release? For the moment, I've had to write a wrapper bean to lookup the real bean with JNDI and proxy the function calls.
At present, I'm using Jboss 4.0.4.GA installed by JEMS installer with the EJB3 profile.
Regards,
Daniel
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987829#3987829
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987829
18 years, 1 month
[JBossWS] - Rewriting of soap address in JBoss 4.0.5/JBossWS 1.0.3
by wpfeiffe
When using JBossWS 1.0 with JBoss 4.0.4.GA, I modified the jbossws14.sar/meta-inf/jboss-service.xml to change the WebServiceHost attribute of the ServiceEnpointManager mbean to use the hard coded URL of my production web site (rather than use the machine name which is not exposed externally).
How is this accomplished in the new jbossws 1.0.3 and JBoss 4.0.5? I haven't seen anything in the change log that discusses this. The Wiki mentions a jbossws.beans/jboss-beans.xml which I can't seem to locate. I tried declaring the mbean in the 4.0.5 jbossws jboss-service.xml file, but, as I suspected, it is now being loaded from another config file and my entry errors out as a duplicate mbean.
Any ideas on how to accomplish the rewrite of the soap address in the new release?
Thanks,
Bill Pfeiffer
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987732#3987732
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987732
18 years, 1 month
[JBossWS] - Error With WSDL Generation For JSR-181 EJB Endpoint With Hea
by mjrother
I am try to add headers to existing web services curently deployed as a stateless session EJB with JSR-181. The WSDL generated names the body part of the message is "parameters" instead of the supplied name. This results in a invalid WSDL that must be hand edited for it to work.
| @WebService(name = "test", targetNamespace = "http://com.test", serviceName = "test")
| @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
| @Stateless
| public class SecureService {
|
| @WebMethod
| public void logout(@WebParam(name="logoutRequest") LogoutRequest request, @WebParam(name="SecHeader", header=true) String headerValue ){
| }
|
| @WebMethod
| public void logout2(@WebParam(name="SecHeader2", header=true) String headerValue, @WebParam(name="test") String request){
| }
| }
|
The resulting WSDL is :
| <definitions name="test" targetNamespace="http://com.test" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://com.test" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
| <types>
| <schema elementFormDefault="qualified" targetNamespace="http://com.test" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://com.test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
| <complexType name="LogoutRequest">
| <sequence>
| <element name="customerId" nillable="true" type="string"/>
| </sequence>
| </complexType>
| <element name="SecHeader" type="string"/>
| <element name="SecHeader2" type="string"/>
| <element name="logoutRequest" type="tns:LogoutRequest"/>
| <element name="test" type="string"/>
| </schema>
| </types>
| <message name="test_logout2">
| <part element="tns:SecHeader2" name="SecHeader2"/>
| <part element="tns:test" name="parameters"/>
| </message>
| <message name="test_logout2Response"/>
| <message name="test_logoutResponse"/>
| <message name="test_logout">
| <part element="tns:logoutRequest" name="parameters"/>
| <part element="tns:SecHeader" name="SecHeader"/>
| </message>
| <portType name="test">
| <operation name="logout">
| <input message="tns:test_logout"/>
| <output message="tns:test_logoutResponse"/>
| </operation>
| <operation name="logout2">
| <input message="tns:test_logout2"/>
| <output message="tns:test_logout2Response"/>
| </operation>
| </portType>
| <binding name="testBinding" type="tns:test">
| <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
| <operation name="logout">
| <soap:operation soapAction=""/>
| <input>
| <soap:header message="tns:test_logout" part="SecHeader" use="literal"/>
| <soap:body parts="logoutRequest" use="literal"/>
| </input>
| <output>
| <soap:body use="literal"/>
| </output>
| </operation>
| <operation name="logout2">
| <soap:operation soapAction=""/>
| <input>
| <soap:header message="tns:test_logout2" part="SecHeader2" use="literal"/>
| <soap:body parts="test" use="literal"/>
| </input>
| <output>
| <soap:body use="literal"/>
| </output>
| </operation>
| </binding>
| <service name="test">
| <port binding="tns:testBinding" name="testPort">
| <soap:address location="http://QUANDARY:8080/ipm-ejb/SecureService"/>
| </port>
| </service>
| </definitions>
|
The problem is in the message definition where the name of "parameters" is used. If I hand edit the WSDL to the following it works as planned:
| <definitions name="test" targetNamespace="http://com.test" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://com.test" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
| <types>
| <schema elementFormDefault="qualified" targetNamespace="http://com.test" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://com.test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
| <complexType name="LogoutRequest">
| <sequence>
| <element name="customerId" nillable="true" type="string"/>
| </sequence>
| </complexType>
| <element name="SecHeader" type="string"/>
| <element name="SecHeader2" type="string"/>
| <element name="logoutRequest" type="tns:LogoutRequest"/>
| <element name="test" type="string"/>
| </schema>
| </types>
| <message name="test_logout2">
| <part element="tns:SecHeader2" name="SecHeader2"/>
| <part element="tns:test" name="test"/>
| </message>
| <message name="test_logout2Response"/>
| <message name="test_logoutResponse"/>
| <message name="test_logout">
| <part element="tns:logoutRequest" name="logoutRequest"/>
| <part element="tns:SecHeader" name="SecHeader"/>
| </message>
| <portType name="test">
| <operation name="logout">
| <input message="tns:test_logout"/>
| <output message="tns:test_logoutResponse"/>
| </operation>
| <operation name="logout2">
| <input message="tns:test_logout2"/>
| <output message="tns:test_logout2Response"/>
| </operation>
| </portType>
| <binding name="testBinding" type="tns:test">
| <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
| <operation name="logout">
| <soap:operation soapAction=""/>
| <input>
| <soap:header message="tns:test_logout" part="SecHeader" use="literal"/>
| <soap:body parts="logoutRequest" use="literal"/>
| </input>
| <output>
| <soap:body use="literal"/>
| </output>
| </operation>
| <operation name="logout2">
| <soap:operation soapAction=""/>
| <input>
| <soap:header message="tns:test_logout2" part="SecHeader2" use="literal"/>
| <soap:body parts="test" use="literal"/>
| </input>
| <output>
| <soap:body use="literal"/>
| </output>
| </operation>
| </binding>
| <service name="test">
| <port binding="tns:testBinding" name="testPort">
| <soap:address location="http://QUANDARY:8080/ipm-ejb/SecureService"/>
| </port>
| </service>
| </definitions>
|
Am I doing something wrong or is there a work around?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987722#3987722
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987722
18 years, 1 month
[JBossWS] - "Port" does not contain operation meta data for "Envelope"
by darlan
I?ve been getting the exception javax.xml.rpc.soap.SOAPFaultException: Endpoint {http://org.jboss.ws/samples/jsr109ejb}JaxRpcTestServicePort does not contain operation meta data for: {http://schemas.xmlsoap.org/soap/envelope/}Envelope when i use a web service proxy generated by Wscompile tool on JBossWS 1.0.3SP1 (jbossws14.sar) bundled in JBossAS 4.0.5GA.
Below the exception that I got:
ERROR [org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper] SOAP request exception
| javax.xml.rpc.soap.SOAPFaultException: Endpoint {http://org.jboss.ws/samples/jsr109ejb}JaxRpcTestServicePort does not contain operation meta data for: {http://schemas.xmlsoap.org/soap/envelope/}Envelope
| at org.jboss.ws.server.ServiceEndpointInvoker.getDispatchDestination(ServiceEndpointInvoker.java:181)
| at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:107)
| at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:209)
| at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:355)
| at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:115)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:76)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at sun.reflect.GeneratedMethodAccessor134.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
| at java.security.AccessController.doPrivileged(Native Method)
| at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
| at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
| at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
| at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at sun.reflect.GeneratedMethodAccessor133.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
| at java.security.AccessController.doPrivileged(Native Method)
| at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
| at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
| at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:217)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197)
| at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
| at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
|
When I tried to access my web service with the below implementation it went all right:
private void testEchoString() {
| try {
| final String TARGET_ENDPOINT_ADDRESS = "http://localhost:8080/jbossws-samples-jsr109ejb-doc";
| final String TARGET_NAMESPACE = "http://org.jboss.ws/samples/jsr109ejb/types";
| final QName TYPE_LITERAL_STRING = new QName(
| "http://www.w3.org/2001/XMLSchema", "string");
|
| ServiceFactory factory = ServiceFactory.newInstance();
| Service service = factory.createService(new QName(
| "ANY_SERVICE_NAME"));
|
| Call call = service.createCall();
| call.setOperationName(new QName(TARGET_NAMESPACE, "echoString"));
| call.addParameter("String_1", TYPE_LITERAL_STRING, ParameterMode.IN);
| call.addParameter("String_2", TYPE_LITERAL_STRING, ParameterMode.IN);
| call.setReturnType(TYPE_LITERAL_STRING);
|
| call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS);
|
| String text = "text";
| System.out.println("Send...: " + text);
| Object retObj = call.invoke(new Object[] { getInputText1Value(),
| getInputText1Value() });
| text = (String) retObj;
| System.out.println("Recevie: " + text);
| } catch (Throwable t) {
| t.printStackTrace();
| }
| }
|
With JBossAS 4.0.3 SP1 both of them are work fine, but with JBossAS 4.0.5GA not. What the difference between those implementations? What am I doing wrong?
--
Darlan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987686#3987686
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987686
18 years, 1 month