* ProtocolImporter.cs, HttpSimpleProtocolImporter.cs,
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Description / HttpSimpleProtocolImporter.cs
index 5b282d40323c09db819ebc9cc0eba2ae273ccf6e..86a0f63cc584ee3423cbceb5a751c5a699e79222 100644 (file)
@@ -72,20 +72,14 @@ namespace System.Web.Services.Description
                        CodeTypeDeclaration codeClass = new CodeTypeDeclaration (ClassName);
 
                        string location = null;
-                       string url = null;
                        if (Port != null) {
                                HttpAddressBinding sab = (HttpAddressBinding) Port.Extensions.Find (typeof(HttpAddressBinding));
                                if (sab != null) location = sab.Location;
-                               url = GetServiceUrl (location); 
                        }
                        
                        CodeConstructor cc = new CodeConstructor ();
                        cc.Attributes = MemberAttributes.Public;
-                       if (url != null) {
-                               CodeExpression ce = new CodeFieldReferenceExpression (new CodeThisReferenceExpression(), "Url");
-                               CodeAssignStatement cas = new CodeAssignStatement (ce, new CodePrimitiveExpression (url));
-                               cc.Statements.Add (cas);
-                       }
+                       GenerateServiceUrl (location, cc.Statements);
                        codeClass.Members.Add (cc);
                        
                        memberIds = new CodeIdentifiers ();