Forum Discussion
larmib_53479
Nimbostratus
Mar 26, 2008iControl.LocalLBPoolMember.set_monitor_association
Can anyone tell me why I get the following error msg:
System.Net.WebException: The remote name could not be resolved: 'url_to_service'
at System.Net.HttpWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at iControl.LocalLBPoolMember.set_monitor_association(
String[] pool_names, LocalLBPoolMemberMemberMonitorAssociation[][] monitor_associations)
in D:\src\perforce\DevCentral\DC4\Labs\iControlAssembly\dotnet\iControl\Interfaces\LocalLB\LocalLBPoolMember.cs:line 461
Here's the code I'm using. The whole point to this big mess is to assign the member's of a Pool their own (yes I know it's the same one right now but it will be dynamic in the future) Health Monitor .
If LB_Interfaces.initialize(ip_address, username, password) = True Then
Dim pool_members As iControl.CommonIPPortDefinition()() = LB_Interfaces.LocalLBPool.get_member(pools)
Dim pool_member_def As iControl.LocalLBMonitorIPPort = New iControl.LocalLBMonitorIPPort
Dim monitor_rule As iControl.LocalLBMonitorRule = New iControl.LocalLBMonitorRule
Dim poolmember As iControl.LocalLBPoolMember = New iControl.LocalLBPoolMember
Dim pool_member As iControl.LocalLBPoolMemberMemberMonitorAssociation()() =
New iControl.LocalLBPoolMemberMemberMonitorAssociation(0)() {}
For j As Integer = 0 To pool_members.Length - 1
Dim pool_member2 As iControl.LocalLBPoolMemberMemberMonitorAssociation() = Nothing
ReDim pool_member2(pool_members(j).Length - 1)
For i As Integer = 0 To pool_members(j).Length - 1
pool_member_def.ipport = pool_members(j)(i)
monitor_rule.type = LocalLBMonitorRuleType.MONITOR_RULE_TYPE_SINGLE
monitor_rule.monitor_templates = New String() {"keepalivetemplate"}
pool_member2(i) = New iControl.LocalLBPoolMemberMemberMonitorAssociation()
pool_member2(i).member = pool_member_def
pool_member2(i).monitor_rule = monitor_rule
Next
pool_member(0) = pool_member2
poolmember.set_monitor_association(pools, pool_member)
Next
End If
One of the things I noticed but I'm not sure how the iControl Assembly works with this but if you use the wsdl.exe app to extract them the default for the function new is https://url_to_service like the below:
Public Sub New()
MyBase.New
Me.Url = "https://url_to_service"
End Sub4 Replies
- You are right in the fact that the WSDL files contain the url of "https://url_to_service" and that is what is set in the interface classes by default. If you use the interfaces through the iControl.Interfaces class, they will all be initialized by the initialize method. In your code, you are accessing the PoolMember interface directly bypassing the iControl.Interfaces object (in your case LB_Interfaces). You'll need to remove the creation of your own PoolMember object and access the set_monitor_association the same way you are with the LocallBPool.get_member() method above.
... LB_Interfaces.LocalLBPoolMember.set_monitor_association(pools, pool_member)
If you really want to bypass the iControl.Interfaces wrapper class, then you can, but you'll need to manually setup the Url member, as well as the credentials and the ssl cert validation. I would suggest using the Interfaces class as that does all the hard work for you.
Let me know if this gets you on the right path.
-Joe - larmib_53479
Nimbostratus
Got anything for this error:System.Web.Services.Protocols.SoapHeaderException: Exception caught in LocalLB:oolMember::set_monitor_association() Exception: Common:perationFailed primary_error_code : 17236003 (0x01070023) secondary_error_code : 0 error_string : 01070023:3: The monitor rule rule address type is out of range. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse( SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at iControl.LocalLBPoolMember.set_monitor_association( String[] pool_names, LocalLBPoolMemberMemberMonitorAssociation[][] monitor_associations) in D:\src\perforce\DevCentral\DC4\Labs\iControlAssembly\dotnet\iControl\Interfaces\LocalLB\LocalLBPoolMember.cs:line 461
At least the other issue is fixed, Updated code:If LB_Interfaces.initialize(ip_address, username, password) = True Then Dim pool_members As iControl.CommonIPPortDefinition()() = LB_Interfaces.LocalLBPool.get_member(pools) Dim pool_member_def As iControl.LocalLBMonitorIPPort = New iControl.LocalLBMonitorIPPort Dim monitor_rule As iControl.LocalLBMonitorRule = New iControl.LocalLBMonitorRule Dim poolmember As iControl.LocalLBPoolMember = New iControl.LocalLBPoolMember Dim pool_member As iControl.LocalLBPoolMemberMemberMonitorAssociation()() = New iControl.LocalLBPoolMemberMemberMonitorAssociation(pool_members.Length - 1)() {} Dim pool_member2 As iControl.LocalLBPoolMemberMemberMonitorAssociation() = Nothing For j As Integer = 0 To pool_members.Length - 1 ReDim pool_member2(pool_members(j).Length - 1) For i As Integer = 0 To pool_members(j).Length - 1 pool_member_def.ipport = pool_members(j)(i) monitor_rule.type = LocalLBMonitorRuleType.MONITOR_RULE_TYPE_UNDEFINED monitor_rule.monitor_templates = New String() {"keepalivetemplate"} pool_member2(i) = New iControl.LocalLBPoolMemberMemberMonitorAssociation() pool_member2(i).member = pool_member_def pool_member2(i).monitor_rule = monitor_rule pool_member(j) = pool_member2 Next Next LB_Interfaces.LocalLBPoolMember.set_monitor_association(pools, pool_member) End If
I'm sure there's something I'm not doing right here. - larmib_53479
Nimbostratus
Never mind I figured it out ;-)
pool_member_def was missing the pool_member_def.address_type = LocalLBAddressType.ATYPE_EXPLICIT_ADDRESS
Thanks! - Glad to help! Let me know if anything else comes up.
-Joe
Recent Discussions
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
