KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > providers > soap > WsdlUrlEndpointBuilder


1 /*
2  * $Id: WsdlUrlEndpointBuilder.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.providers.soap;
12
13 import org.mule.impl.endpoint.AbstractEndpointBuilder;
14 import org.mule.umo.endpoint.MalformedEndpointException;
15
16 import java.net.URI JavaDoc;
17 import java.util.Properties JavaDoc;
18
19 /**
20  * The same as the UrlEndpointbuilder except that all parameters except the first are
21  * set as properties on the endpoint and stripped from the endpoint Uri
22  *
23  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
24  * @version $Revision: 3798 $
25  */

26 public class WsdlUrlEndpointBuilder extends AbstractEndpointBuilder
27 {
28
29     protected void setEndpoint(URI JavaDoc uri, Properties JavaDoc props) throws MalformedEndpointException
30     {
31         address = "";
32         if (uri.getHost() != null)
33         {
34             // set the endpointUri to be a proper url if host and port are set
35
this.address = uri.getScheme() + "://" + uri.getHost();
36             if (uri.getPort() != -1)
37             {
38                 address += ":" + uri.getPort();
39             }
40         }
41         if (uri.getPath() != null)
42         {
43             address += uri.getPath();
44         }
45         String JavaDoc query = uri.getQuery();
46         if (query != null)
47         {
48             int i = query.indexOf("&");
49             if (i > -1)
50             {
51                 address += "?" + query.substring(0, i);
52
53             }
54             else
55             {
56                 address += "?" + query;
57             }
58         }
59     }
60 }
61
Popular Tags