KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > wsdl > BindingOperationTest


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.wsdl;
18
19 import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
20
21 import javax.xml.namespace.QName JavaDoc;
22 import java.io.FileInputStream JavaDoc;
23 import java.io.InputStream JavaDoc;
24
25 /**
26  * @author chathura@opensource.lk
27  *
28  */

29 public class BindingOperationTest extends AbstractTestCase {
30
31     public BindingOperationTest(String JavaDoc arg) {
32         super(arg);
33     }
34
35     /**
36      * The WSDL should be passed properly and the WOM should be built if
37      * everything is allright
38      * @throws Exception
39      */

40     public void testBindingOperation() throws Exception JavaDoc {
41         WSDLDescription womDescription;
42
43         InputStream JavaDoc in = new FileInputStream JavaDoc(
44                 getTestResourceFile("BookQuote.wsdl"));
45         womDescription = WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11)
46                 .build(in).getDescription();
47         
48         assertNotNull(womDescription);
49         if(null !=womDescription){
50             String JavaDoc ns = "http://www.Monson-Haefel.com/jwsbook/BookQuote";
51             WSDLBinding binding = womDescription.getBinding(new QName JavaDoc(ns,"BookQuoteBinding"));
52             WSDLBindingOperation bindingOperation = binding.getBindingOperation(new QName JavaDoc(ns, "getBookPrice"));
53             assertNotNull(bindingOperation.getInput());
54             assertNull(bindingOperation.getOutput());
55         }
56
57     }
58 }
Popular Tags