01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.axis2.jaxws.client.soapaction;
20:
21: import java.io.File;
22: import java.net.MalformedURLException;
23: import java.net.URL;
24:
25: import javax.xml.namespace.QName;
26: import javax.xml.ws.Service;
27: import javax.xml.ws.WebEndpoint;
28: import javax.xml.ws.WebServiceClient;
29:
30: @WebServiceClient(name="BookStoreService",targetNamespace="http://jaxws.axis2.apache.org/client/soapaction",wsdlLocation="SOAPActionTest.wsdl")
31: public class BookStoreService extends Service {
32:
33: private static URL BOOKSTORESERVICE_WSDL_LOCATION;
34: private static String wsdlLocation = "/target/test-classes/services/BookStoreService/META-INF/SOAPActionTest.wsdl";
35: static {
36: URL url = null;
37: try {
38: try {
39: String baseDir = new File(System.getProperty("basedir",
40: ".")).getCanonicalPath();
41: wsdlLocation = new File(baseDir + wsdlLocation)
42: .getAbsolutePath();
43: } catch (Exception e) {
44: e.printStackTrace();
45: }
46: File file = new File(wsdlLocation);
47: url = file.toURL();
48: } catch (MalformedURLException e) {
49: e.printStackTrace();
50: }
51: BOOKSTORESERVICE_WSDL_LOCATION = url;
52: }
53:
54: public BookStoreService(URL wsdlLocation, QName serviceName) {
55: super (wsdlLocation, serviceName);
56: }
57:
58: public BookStoreService() {
59: super (BOOKSTORESERVICE_WSDL_LOCATION, new QName(
60: "http://jaxws.axis2.apache.org/client/soapaction",
61: "BookStoreService"));
62: }
63:
64: /**
65: *
66: * @return
67: * returns BookStore
68: */
69: @WebEndpoint(name="BookStorePort")
70: public BookStore getBookStorePort() {
71: return (BookStore) super .getPort(new QName(
72: "http://jaxws.axis2.apache.org/client/soapaction",
73: "BookStorePort"), BookStore.class);
74: }
75:
76: }
|