Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplDoc.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplDoc.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplDoc.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplDoc.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,31 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebService; + + +@WebService(serviceName = "SOAPService2", + portName = "SoapPort2", + endpointInterface = "org.apache.hello_world_doc_lit.Greeter", + targetNamespace = "http://apache.org/hello_world_doc_lit", + wsdlLocation = "testutils/hello_world_doc_lit.wsdl") +public class GreeterImplDoc extends GreeterImplDocBase { + +}
Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplDocBase.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplDocBase.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplDocBase.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplDocBase.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,48 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import org.apache.hello_world_doc_lit.Greeter; +import org.apache.hello_world_doc_lit.PingMeFault; +import org.apache.hello_world_doc_lit.types.FaultDetail; + +public class GreeterImplDocBase implements Greeter { + + public String sayHi() { + System.out.println("Call sayHi here "); + return "Bonjour"; + } + + public String greetMe(String requestType) { + System.out.println("Reached here :" + requestType); + return "Hello " + requestType; + } + + public void greetMeOneWay(String requestType) { + System.out.println("********* greetMeOneWay: " + requestType); + } + + public void pingMe() throws PingMeFault { + FaultDetail faultDetail = new FaultDetail(); + faultDetail.setMajor((short)2); + faultDetail.setMinor((short)1); + throw new PingMeFault("PingMeFault raised by server", faultDetail); + + } +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueDecoupledOneWays.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueDecoupledOneWays.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueDecoupledOneWays.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueDecoupledOneWays.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,175 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import java.net.URL; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import javax.annotation.Resource; +import javax.jws.WebService; +import javax.xml.namespace.QName; +import javax.xml.ws.WebServiceContext; + +import org.apache.cxf.hello_world_jms.HelloWorldOneWayPort; +import org.apache.cxf.hello_world_jms.HelloWorldQueueDecoupledOneWaysService; +import org.apache.cxf.transport.jms.JMSConstants; +import org.apache.cxf.transport.jms.JMSMessageHeadersType; + + + +@WebService(serviceName = "HelloWorldQueueDecoupledOneWaysService", + portName = "HelloWorldQueueDecoupledOneWaysPort", + endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldOneWayPort", + targetNamespace = "http://cxf.apache.org/hello_world_jms", + wsdlLocation = "testutils/jms_test.wsdl") +public class GreeterImplQueueDecoupledOneWays implements HelloWorldOneWayPort { + + @Resource + private WebServiceContext context; + private Throwable asyncEx; + private String request; + private String reply; + private CountDownLatch latch = new CountDownLatch(1); + private boolean specCompliant; + + public GreeterImplQueueDecoupledOneWays() { + } + + public GreeterImplQueueDecoupledOneWays(boolean specCompliant) { + this.specCompliant = specCompliant; + } + + public void greetMeOneWay(String value) { + synchronized (this) { + request = value; + notifyAll(); + } + try { + if (!latch.await(2000, TimeUnit.MILLISECONDS)) { + synchronized (this) { + asyncEx = new Exception("Time out while waiting for command to send reply"); + notifyAll(); + } + return; + } + } catch (InterruptedException e) { + synchronized (this) { + asyncEx = e; + notifyAll(); + } + return; + } + sendReply(); + } + + protected void sendReply() { + JMSMessageHeadersType headers = + (JMSMessageHeadersType)context.getMessageContext().get(JMSConstants.JMS_SERVER_REQUEST_HEADERS); + if (headers == null || headers.getJMSReplyTo() == null) { + synchronized (this) { + if (!specCompliant) { + asyncEx = new Exception("ReplyTo header in the server Request context was null"); + } + notifyAll(); + } + return; + } else if (headers != null && headers.getJMSReplyTo() != null && specCompliant) { + synchronized (this) { + asyncEx = new Exception("ReplyTo header in the server Request context was not null"); + notifyAll(); + } + return; + } + + QName serviceName = new QName("http://cxf.apache.org/hello_world_jms", + "HelloWorldQueueDecoupledOneWaysService"); + QName portName = new QName("http://cxf.apache.org/hello_world_jms", + "HelloWorldQueueDecoupledOneWaysReplyPort"); + Throwable e = null; + + try { + URL wsdl = getClass().getResource("/wsdl/jms_test.wsdl"); + HelloWorldQueueDecoupledOneWaysService service = + new HelloWorldQueueDecoupledOneWaysService(wsdl, serviceName); + HelloWorldOneWayPort greeter = service.getPort(portName, HelloWorldOneWayPort.class); + reply = "Re:" + request; + greeter.greetMeOneWay(reply); + } catch (Throwable t) { + e = t; + } + synchronized (this) { + asyncEx = e; + notifyAll(); + } + + } + + public void proceedWithReply() { + latch.countDown(); + } + + public String ackRequestReceived(long timeout) { + synchronized (this) { + if (request != null) { + return request; + } + try { + wait(timeout); + } catch (InterruptedException e) { + asyncEx = e; + return null; + } + } + return request; + } + + public String ackReplySent(long timeout) { + synchronized (this) { + if (asyncEx != null) { + return null; + } + try { + wait(timeout); + } catch (InterruptedException e) { + asyncEx = e; + return null; + } + } + return reply; + } + + public boolean ackNoReplySent(long timeout) { + synchronized (this) { + if (asyncEx != null) { + return false; + } + try { + wait(timeout); + } catch (InterruptedException e) { + asyncEx = e; + } + } + return asyncEx == null; + } + + public Throwable getException() { + return asyncEx; + } +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueDecoupledOneWaysDeferredReply.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueDecoupledOneWaysDeferredReply.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueDecoupledOneWaysDeferredReply.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueDecoupledOneWaysDeferredReply.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,59 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebService; + +import org.apache.cxf.hello_world_jms.HelloWorldOneWayPort; + + + +@WebService(serviceName = "HelloWorldQueueDecoupledOneWaysService", + portName = "HelloWorldQueueDecoupledOneWaysReplyPort", + endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldOneWayPort", + targetNamespace = "http://cxf.apache.org/hello_world_jms", + wsdlLocation = "testutils/jms_test.wsdl") +public class GreeterImplQueueDecoupledOneWaysDeferredReply implements HelloWorldOneWayPort { + + private String request; + private Throwable asyncEx; + + public void greetMeOneWay(String value) { + synchronized (this) { + request = value; + notifyAll(); + } + + } + public String ackRequest(long timeout) { + synchronized (this) { + try { + wait(timeout); + } catch (InterruptedException e) { + asyncEx = e; + return null; + } + } + return request; + } + + public Throwable getException() { + return asyncEx; + } +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueOneWay.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueOneWay.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueOneWay.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplQueueOneWay.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,38 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebService; + +import org.apache.cxf.hello_world_jms.HelloWorldOneWayPort; + + + +@WebService(serviceName = "HelloWorldOneWayQueueService", + portName = "HelloWorldOneWayQueuePort", + endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldOneWayPort", + targetNamespace = "http://cxf.apache.org/hello_world_jms", + wsdlLocation = "testutils/jms_test.wsdl") +public class GreeterImplQueueOneWay implements HelloWorldOneWayPort { + + public void greetMeOneWay(String stringParam0) { + System.out.println("********* greetMeOneWay: " + stringParam0); + + } +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTopicOneWay.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTopicOneWay.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTopicOneWay.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTopicOneWay.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,35 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebService; + +import org.apache.cxf.hello_world_jms.HelloWorldPubSubPort; + +@WebService(serviceName = "HelloWorldPubSubService", + portName = "HelloWorldPubSubPort", + endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPubSubPort", + targetNamespace = "http://cxf.apache.org/hello_world_jms", + wsdlLocation = "testutils/jms_test.wsdl") +public class GreeterImplTopicOneWay implements HelloWorldPubSubPort { + + public void greetMeOneWay(String stringParam0) { + System.out.println("********* greetMeOneWay: " + stringParam0); + } +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMS.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMS.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMS.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMS.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebService; + + + +@WebService(serviceName = "HelloWorldService", + portName = "HelloWorldPort", + endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType", + targetNamespace = "http://cxf.apache.org/hello_world_jms", + wsdlLocation = "testutils/jms_test.wsdl") +public class GreeterImplTwoWayJMS extends TwoWayJMSImplBase { + +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDEng.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDEng.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDEng.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDEng.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebService; + + + +@WebService(serviceName = "HelloWorldServiceAppCorrelationID", + portName = "HelloWorldPortAppCorrelationIDEng", + endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType", + targetNamespace = "http://cxf.apache.org/hello_world_jms", + wsdlLocation = "testutils/jms_test.wsdl") +public class GreeterImplTwoWayJMSAppCorrelationIDEng extends TwoWayJMSImplBase { + +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDNoPrefix.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDNoPrefix.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDNoPrefix.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDNoPrefix.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebService; + + + +@WebService(serviceName = "HelloWorldServiceAppCorrelationIDNoPrefix", + portName = "HelloWorldPortAppCorrelationIDNoPrefix", + endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType", + targetNamespace = "http://cxf.apache.org/hello_world_jms", + wsdlLocation = "testutils/jms_test.wsdl") +public class GreeterImplTwoWayJMSAppCorrelationIDNoPrefix extends TwoWayJMSImplBase { + +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDSales.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDSales.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDSales.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDSales.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebService; + + + +@WebService(serviceName = "HelloWorldServiceAppCorrelationID", + portName = "HelloWorldPortAppCorrelationIDSales", + endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType", + targetNamespace = "http://cxf.apache.org/hello_world_jms", + wsdlLocation = "testutils/jms_test.wsdl") +public class GreeterImplTwoWayJMSAppCorrelationIDSales extends TwoWayJMSImplBase { + +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebService; + + + +@WebService(serviceName = "HelloWorldServiceAppCorrelationIDStaticPrefix", + portName = "HelloWorldPortAppCorrelationIDStaticPrefixEng", + endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType", + targetNamespace = "http://cxf.apache.org/hello_world_jms", + wsdlLocation = "testutils/jms_test.wsdl") +public class GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixEng extends TwoWayJMSImplBase { + +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebService; + + + +@WebService(serviceName = "HelloWorldServiceAppCorrelationIDStaticPrefix", + portName = "HelloWorldPortAppCorrelationIDStaticPrefixSales", + endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType", + targetNamespace = "http://cxf.apache.org/hello_world_jms", + wsdlLocation = "testutils/jms_test.wsdl") +public class GreeterImplTwoWayJMSAppCorrelationIDStaticPrefixSales extends TwoWayJMSImplBase { + +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebService; + + + +@WebService(serviceName = "HelloWorldServiceRuntimeCorrelationIDDynamicPrefix", + portName = "HelloWorldPortRuntimeCorrelationIDDynamicPrefix", + endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType", + targetNamespace = "http://cxf.apache.org/hello_world_jms", + wsdlLocation = "testutils/jms_test.wsdl") +public class GreeterImplTwoWayJMSRuntimeCorrelationIDDynamicPrefix extends TwoWayJMSImplBase { + +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebService; + + + +@WebService(serviceName = "HelloWorldServiceRuntimeCorrelationIDStaticPrefix", + portName = "HelloWorldPortRuntimeCorrelationIDStaticPrefixEng", + endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType", + targetNamespace = "http://cxf.apache.org/hello_world_jms", + wsdlLocation = "testutils/jms_test.wsdl") +public class GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixEng extends TwoWayJMSImplBase { + +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebService; + + + +@WebService(serviceName = "HelloWorldServiceRuntimeCorrelationIDStaticPrefix", + portName = "HelloWorldPortRuntimeCorrelationIDStaticPrefixSales", + endpointInterface = "org.apache.cxf.hello_world_jms.HelloWorldPortType", + targetNamespace = "http://cxf.apache.org/hello_world_jms", + wsdlLocation = "testutils/jms_test.wsdl") +public class GreeterImplTwoWayJMSRuntimeCorrelationIDStaticPrefixSales extends TwoWayJMSImplBase { + +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterSpecImpl.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterSpecImpl.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterSpecImpl.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterSpecImpl.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,44 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import org.apache.cxf.jms_greeter.JMSGreeterPortType; + [email protected](portName = "GreeterPort", + serviceName = "JMSGreeterService", + targetNamespace = "http://cxf.apache.org/jms_greeter", + endpointInterface = "org.apache.cxf.jms_greeter.JMSGreeterPortType") +public class GreeterSpecImpl implements JMSGreeterPortType { + + public String greetMe(String me) { + System.out.println("Executing operation greetMe"); + System.out.println("Message received: " + me + "\n"); + return "Hello " + me; + } + + public String sayHi() { + System.out.println("Executing operation sayHi" + "\n"); + return "Bonjour"; + } + + public void greetMeOneWay(String me) { + System.out.println("Executing operation greetMeOneWay\n"); + System.out.println("Hello there " + me); + } +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterSpecWithPortError.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterSpecWithPortError.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterSpecWithPortError.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GreeterSpecWithPortError.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,45 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import org.apache.cxf.jms_greeter.JMSGreeterPortType; + [email protected](portName = "GreeterPort2", + serviceName = "JMSGreeterService2", + targetNamespace = "http://cxf.apache.org/jms_greeter", + endpointInterface = "org.apache.cxf.jms_greeter.JMSGreeterPortType", + wsdlLocation = "testutils/jms_spec_test.wsdl") +public class GreeterSpecWithPortError implements JMSGreeterPortType { + + public String greetMe(String me) { + System.out.println("Executing operation greetMe"); + System.out.println("Message received: " + me + "\n"); + return "Hello " + me; + } + + public String sayHi() { + System.out.println("Executing operation sayHi" + "\n"); + return "Bonjour"; + } + + public void greetMeOneWay(String me) { + System.out.println("Executing operation greetMeOneWay\n"); + System.out.println("Hello there " + me); + } +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GzipServer.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GzipServer.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GzipServer.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/GzipServer.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,54 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.xml.ws.Endpoint; + +import org.apache.cxf.Bus; +import org.apache.cxf.BusFactory; +import org.apache.cxf.bus.spring.SpringBusFactory; +import org.apache.cxf.testutil.common.AbstractBusTestServerBase; +import org.apache.cxf.testutil.common.EmbeddedJMSBrokerLauncher; + + +public class GzipServer extends AbstractBusTestServerBase { + public static final String PORT = "9000"; //allocatePort(GzipServer.class); + + protected void run() { + Object impleDoc = new GreeterImplDoc(); + SpringBusFactory bf = new SpringBusFactory(); + Bus bus = bf.createBus("org/apache/cxf/systest/jms/gzipBus.xml"); + BusFactory.setDefaultBus(bus); + EmbeddedJMSBrokerLauncher.updateWsdlExtensors(bus, "testutils/hello_world_doc_lit.wsdl"); + Endpoint.publish(null, impleDoc); + } + + + public static void main(String[] args) { + try { + GzipServer s = new GzipServer(); + s.start(); + } catch (Exception ex) { + ex.printStackTrace(); + System.exit(-1); + } finally { + System.out.println("done!"); + } + } +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/Hello.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/Hello.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/Hello.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/Hello.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,31 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import javax.jws.WebMethod; +import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; + +@SOAPBinding(use = SOAPBinding.Use.LITERAL) +@WebService(name = "Hello", targetNamespace = "http://cxf.apache.org/systest/jaxws/") +public interface Hello { + @SOAPBinding(style = SOAPBinding.Style.RPC) + @WebMethod(operationName = "sayHi", exclude = false) + String sayHi(String value); +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/HelloImpl.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/HelloImpl.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/HelloImpl.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/HelloImpl.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,31 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; +import javax.jws.WebService; + + +@WebService(name = "Hello", serviceName = "HelloService", portName = "HelloPort", + targetNamespace = "http://cxf.apache.org/systest/jaxws/", + endpointInterface = "org.apache.cxf.systest.jms.Hello") +public class HelloImpl implements Hello { + public String sayHi(String arg0) { + return "get" + arg0; + } + +} Added: cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java?rev=1089887&view=auto ============================================================================== --- cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java (added) +++ cxf/trunk/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerGzipTest.java Thu Apr 7 14:11:51 2011 @@ -0,0 +1,140 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jms; + +import java.lang.reflect.UndeclaredThrowableException; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; + + +import javax.xml.namespace.QName; + +import org.apache.cxf.Bus; +import org.apache.cxf.BusFactory; +import org.apache.cxf.bus.spring.SpringBusFactory; +import org.apache.cxf.endpoint.Client; +import org.apache.cxf.frontend.ClientProxy; +import org.apache.cxf.service.model.EndpointInfo; +import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase; +import org.apache.cxf.testutil.common.EmbeddedJMSBrokerLauncher; +import org.apache.cxf.transport.jms.AddressType; +import org.apache.cxf.transport.jms.JMSNamingPropertyType; +import org.apache.hello_world_doc_lit.Greeter; +import org.apache.hello_world_doc_lit.PingMeFault; +import org.apache.hello_world_doc_lit.SOAPService2; + +import org.junit.BeforeClass; +import org.junit.Test; + +public class JMSClientServerGzipTest extends AbstractBusClientServerTestBase { + static final String JMS_PORT = EmbeddedJMSBrokerLauncher.PORT; + static final String PORT = GzipServer.PORT; + + private String wsdlString; + + @BeforeClass + public static void startServers() throws Exception { + Map<String, String> props = new HashMap<String, String>(); + if (System.getProperty("org.apache.activemq.default.directory.prefix") != null) { + props.put("org.apache.activemq.default.directory.prefix", + System.getProperty("org.apache.activemq.default.directory.prefix")); + } + props.put("java.util.logging.config.file", + System.getProperty("java.util.logging.config.file")); + + assertTrue("server did not launch correctly", + launchServer(EmbeddedJMSBrokerLauncher.class, props, null)); + + assertTrue("server did not launch correctly", + launchServer(GzipServer.class)); + + } + + public URL getWSDLURL(String s) throws Exception { + URL u = getClass().getResource(s); + wsdlString = u.toString().intern(); + EmbeddedJMSBrokerLauncher.updateWsdlExtensors(getBus(), wsdlString); + System.gc(); + System.gc(); + return u; + } + public QName getServiceName(QName q) { + return q; + } + public QName getPortName(QName q) { + return q; + } + + @Test + public void testGzipEncodingWithJms() throws Exception { + SpringBusFactory bf = new SpringBusFactory(); + Bus bus = bf.createBus("org/apache/cxf/systest/jms/gzipBus.xml"); + BusFactory.setDefaultBus(bus); + QName serviceName = getServiceName(new QName("http://apache.org/hello_world_doc_lit", + "SOAPService2")); + QName portName = getPortName(new QName("http://apache.org/hello_world_doc_lit", "SoapPort2")); + URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl"); + assertNotNull(wsdl); + + SOAPService2 service = new SOAPService2(wsdl, serviceName); + assertNotNull(service); + + String response1 = new String("Hello Milestone-"); + String response2 = new String("Bonjour"); + try { + Greeter greeter = service.getPort(portName, Greeter.class); + + Client client = ClientProxy.getClient(greeter); + EndpointInfo ei = client.getEndpoint().getEndpointInfo(); + AddressType address = ei.getTraversedExtensor(new AddressType(), AddressType.class); + JMSNamingPropertyType name = new JMSNamingPropertyType(); + JMSNamingPropertyType password = new JMSNamingPropertyType(); + name.setName("java.naming.security.principal"); + name.setValue("ivan"); + password.setName("java.naming.security.credentials"); + password.setValue("the-terrible"); + address.getJMSNamingProperty().add(name); + address.getJMSNamingProperty().add(password); + for (int idx = 0; idx < 5; idx++) { + + greeter.greetMeOneWay("test String"); + + String greeting = greeter.greetMe("Milestone-" + idx); + assertNotNull("no response received from service", greeting); + String exResponse = response1 + idx; + assertEquals(exResponse, greeting); + + String reply = greeter.sayHi(); + assertNotNull("no response received from service", reply); + assertEquals(response2, reply); + + try { + greeter.pingMe(); + fail("Should have thrown FaultException"); + } catch (PingMeFault ex) { + assertNotNull(ex.getFaultInfo()); + } + + } + } catch (UndeclaredThrowableException ex) { + throw (Exception)ex.getCause(); + } + } +}
