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 ();