|
Member 7881518 wrote: Is it a packet format issue or anything else?
My guess would be a firewall. What do the routers do to other (similar) tools?
Bastard Programmer from Hell
|
|
|
|
|
it return the value corresponding to specified Oid from router's mib
|
|
|
|
|
Member 7881518 wrote: am using Snmp version1 packet
That doesn't mean much. It is somewhat similar to saying that you are using http (but not specifying anything about the server/client.)
Member 7881518 wrote: I tested it on localhost and windows server in the network,
First that doesn't mean anything unless you are actually testing it against routers.
Second it would need to be tested against the same routers and with the same installed software on them.
Member 7881518 wrote: But it is not working
Meaning what exactly? If you are getting an alarm or not getting a comm error on a query/update then (if you have not suppressed something) then there is no other conclusion but that your test environment and real enviroment are using different SNMP data.
Only way to debug this sort of thing long term it to provide a way to write the raw data to a file so you can look at it.
|
|
|
|
|
Thanks Eddy Vluggen and jschell for your replies.
Actually, this was some authentication issue that has been resolved. The community string they had provided me was not correct.
But now i have a new problem. I am not able to read large data send by router. Actually I am not clear about the concept that how snmp protocol send(response from router) data.
Suppose if the snmp query is to diplay all mib values, then how the router is going to send the result, I mean it will
1)send datagrams packets
2)use stream of data
3)or anything else??
|
|
|
|
|
I am building a C# windows application. I want it so whenever I click the update button in my form the application will Start looking for whether there is a new version avaliable on my Server.
If there is then proceed to update the Software.
How is this usually handled?
|
|
|
|
|
|
So basically the code below just creates an XML document in memory and then parses it and spits the values back out. The question I have is about the IEnumerable<xelement> statements. I never implemented a class that uses the interface, but yet it still works in this code. Does the compiler automagically create a container or something? How does this work? Does this work for all interfaces?
class Program
{
static void Main(string[] args)
{
XDocument employeeDoc =
new XDocument(
new XElement("Employees",
new XElement("Employee",
new XElement("Name" , "Bob Smith"),
new XElement("Phone" , "408-555-1000"),
new XElement("Phone" , "408-555-1001")),
new XElement("Employee",
new XElement("Name", "Sally Jones"),
new XElement("Phone", "415-555-2000"),
new XElement("Phone", "415-555-2001"))
)
);
XElement root = employeeDoc.Element("Employees");
IEnumerable<XElement> employees = root.Elements();
foreach (XElement emp in employees)
{
XElement empNameNode = emp.Element("Name");
Console.WriteLine(empNameNode.Value);
IEnumerable<XElement> empPhones = emp.Elements("Phone");
foreach (XElement phone in empPhones)
{
Console.WriteLine(" {0}", phone.Value);
}
}
}
}
|
|
|
|
|
See these lines..
Quote: IEnumerable<xelement> employees = root.Elements();
foreach (XElement emp in employees)
{
Here you have used foreach loop. SO, the definition says that, you can use foreach loop only on those objects or classes which implement IEnumerable interface. Therefore, in order to loop out all through the elements, you have taken the IEnumerable instance.
hope it helps.
with regards
Karthik Harve
|
|
|
|
|
Karthik, I'm still a little confused. I know that the foreach statement requires a type that has implemented the IEnumerable or IEnumerator interface, what I don't understand is why the line IEnumerable employees = root.Elements() even works. I didn't implement the IEnumerable interface in a class anywhere. I just used that statement. In the book I'm reading it says that interfaces have to be a part of the classes declaration, for instance:
public class Myclass : IEnumerable
Since I didn't do that, does the compiler make an object with the proper code for me, from the first code example?
|
|
|
|
|
|
|
|
|
|
|
Thank you, Wonde Tadesse.
|
|
|
|
|
Have a look at the definition of the XContainer.Elements method[^]. The type that this returns is an IEnumberable collection. This allows you to run a loop over the elements of the employees object you create. It actually has nothing to do with you implementing or not implementing the interface, since the class XContainer / XElement possibly itself takes care of this internally.
|
|
|
|
|
|
Thank you. This cleared up my confusion.
|
|
|
|
|
You are welcome. Vote if it helped.
|
|
|
|
|
Sorry if anyone gets annoyed by this question please don't mind i am just asking how can i provide good articles what should be the way of it & in which manner.
Please Suggest me something.
Thanks.
|
|
|
|
|
|
|
The first thing that you need to note is that a C# question answer forum.
This question is posted in the wrong forum.
Thus you should remember to write a well-formatted article that is properly categorized in its rightful place and has enough material to be classified as an article.
If you feel your article is too small or does not have enough material, write a tip / trick instead of an article.
|
|
|
|
|
here is my sample code
webservice code
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(Name = "TestService", ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WebService : System.Web.Services.WebService {
// Add a member variable of the type deriving from SoapHeader.
public MyHeader timeStamp;
// Apply a SoapHeader attribute.
[WebMethod(Description = "A method that requires authentication")]
[SoapDocumentMethod(Binding = "TestService")]
[SoapHeader("timeStamp", Direction = SoapHeaderDirection.In)]
public string HelloWorld()
{
if (timeStamp == null)
timeStamp = new MyHeader();
timeStamp.MustUnderstand = true;
timeStamp.Expires = 60000;
timeStamp.Created = DateTime.UtcNow;
return "Hello World";
}
}
here is the client code
localhost.MyHeader header = new localhost.MyHeader();
// Populate the values of the SOAP header.
header.Expires = 60000;
header.Created = DateTime.UtcNow;
// Create a new instance of the proxy class.
localhost.WebService proxy = new localhost.WebService();
// Add the MyHeader SOAP header to the SOAP request.
proxy.MyHeaderValue = header;
// Call the method on the proxy class that communicates
// with your XML Web service method.
string results = proxy.HelloWorld();
i am getting result as "Hello World"
But i want it in format as
?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-; xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<MyHeader xmlns="http://tempuri.org/">
<Created>dateTime</Created>
<Expires>long</Expires>
</MyHeader>
</soap:Header>
<soap:Body>
<HelloWorld xmlns="http://tempuri.org/"
</soap:Body>
</soap:Envelope >
|
|
|
|