|
Yes, I have added a reference to the web service and it works.
BUT, now I would like to get access to the xml it returns
|
|
|
|
|
arkiboys wrote: BUT, now I would like to get access to the xml it returns
Why? I'm unclear as to why you would want to do this, because you have got the results back put into a valid context.
|
|
|
|
|
I think he is dealing with those pass an xml string, get an xml string type webservices...
|
|
|
|
|
When I browse to the web service .asmx and manually place the parameters in the textboxes(Where parameters are required for testing) then click on the invokle button, then I get the result as xml. In that xml there is something called Result="Success" and this is what I would like to pull out.
Not sure how to do this though.
Thanks
|
|
|
|
|
I solved it.
The trick was to make sure the DefaultCredential is used.
Thanks.
|
|
|
|
|
But that's calling the asmx directly. If you use the proxy then you don't need to do this.
|
|
|
|
|
Hi all. I just got assigned a project that involves me interfacing with a scanner. Does anyone know how to do this using c#. I've been reading up on it and there are ways of doing it in c++ using TWAIN but I haven't found a way of doing it in c#. Does anyone know how
Thanks
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Stephen Lintott wrote: I've been reading up on it and there are ways of doing it in c++ using TWAIN but I haven't found a way of doing it in c#. Does anyone know how
Exactly the same. There is an article on CP that helped me when I needed to interface with a scanner. Have fun with the TWAIN spec...
|
|
|
|
|
Thanks
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Hi friends
I have a raw bytes data array. I send these bytes using socket send command, with out using encoding. But i am receiving junk data in other side. How can i solve this problem
thanks in advance
-RisKhan-
|
|
|
|
|
With the debugger.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi Guys,
I have a quick question. I googled for this but can't get a satisfactory answer. I need to know how to TrimEnd a specified number of characters. i.e I have a value like this 00000000123450000000 . I need to trim the last six zero's off the value. Now, I have written the below which removes all 7 zero's whereas I only want to remove the last 6 zero's.
char[] myChar = { '0' };
string cls = imp.Cls_Units_1.TrimEnd(myChar);
The above piece of code removes all trailing zeros but I need only remove the last six zero's. Does anybody know how I can get this done?
Cheers
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Have you thought of a for loop
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Not sure how a for loop is going to help here as the TrimEnd method itself removes any instances of the specified char[]. Can you show me what you mean please?
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Forget about the trimEnd method and do the following.
char [] chars = YourText.ToCharArray();
for (int i=startIndex;i<chars.length;i++)>
chars[i]='\0';
Where startIndex is equal to the first character you want to remove.
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Use the Substring method intead:
if (s.EndsWith("000000")) {
s = s.SubString(0, s.Length - 6);
} else {
' does not end with zeroes.
}
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa. How would you handle the following calculation? Just for interest sake.
I have an amount, which I can now correct get using the suggested method of SubString. I need to multiply that amount by 2.3 and then multiply the result by a further 9262.608696. Net amount I get and I do a Math.Round(netamnt, 2) to get the amount rounded to 2 decimal places. I would ideally want the netamnt without the decimal place. For example.
16436 * 2.3 * 9262.608696
The above gives me the following:
16436 * 2.3 = 37802.8
37802.8 * 9262.608696 = 350152544.0131488.
I would like to have my result as 35015254401.
What would be the best way of doing this?
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Just multiply the value by 100.0 and round to zero decimal places.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
HI ,
I am trying to impement object pooling.Where the object are remote objects.
Using this remote object i am calling a class in which i am having a method with while loop which runs for 1 min.
I found that after some time my remote object are lost.
it means if i have 10 object
Then for all the 10 object the method is called a part of the code is excuted but after that we don't know where that object goes .As at last we are updating a log file which is not getting updated so we concluded that remote object gets lost ...
Please help us on thiss...
The sample code is as
public class CallingClass : MarshalByRefObject, IBusinessComponent
{
[System.Runtime.Remoting.Messaging.OneWay()]
void IBusinessComponent.ProcessRequestOW1(Int32 hashCode,string URI)
{
CretaeLOG("Start")
ProcessRequest(hashCode);
CretaeLOG("END")
}
}
public void ProcessRequest(Int32 hashCode)
{
int dtStart = DateTime.Now.Minute;
int initialMinute = dtStart;
while (dtStart < initialMinute + 1)
{
dtStart = DateTime.Now.Minute;
}
}
Singleton class is as follow:
public sealed class ObjInstance
{
private Int32 m_Hashcode;
private string m_URI;
public Int32 Hashcode
{
get { return m_Hashcode; }
set { m_Hashcode = value; }
}
public string URI
{
get { return m_URI; }
set { m_URI = value; }
}
public PIMS.Interfaces.IBusinessComponent IBusinessObject;
}
internal sealed class PoolObject
{
private static PoolObject poolInstance = null;
private static object syncRoot = new object();
public Hashtable objectPool = new Hashtable();
Int32 maxPoolSize = 5;
public Hashtable usedObject = new Hashtable();
public Hashtable usedObjectHashCode = new Hashtable();
//Timer poolTimer = new Timer();
private PoolObject()
{
//When pool timer's timeout occures call MoveToPool function to get available objects
// poolTimer.Elapsed += new ElapsedEventHandler(MovetoPool);
//poolTimer.Tick += new EventHandler(poolTimer_Tick);
// poolTimer.Interval = 60;
// poolTimer.Start();
CreatePool();
}
public static PoolObject Instance
{
get
{
if (poolInstance == null)
{
lock (syncRoot)
{
poolInstance = new PoolObject();
}
}
return poolInstance;
}
}
public void CreatePool()
{
.... Some code here.........
}
public PIMS.Interfaces.IBusinessComponent GetObjectFromPool(string URI, ref Int32 hashCode)
{
.... Some code here.........
}
public void MovetoPool()
{
.... Some code here.........
}
}
|
|
|
|
|
Override GetLifetimeService() InitializeLifetimeService() to return an ILease object, by default it returns a lease of 5 minutes (IIRC).
[update] oops, pasted wrong method [update]
|
|
|
|
|
Falguni Joshi wrote: Objects getting lost in .Net remoting object pooling.......Plz help us its an urgent...We r facing the issue in production
You should have learnt how to use .NET Remoting before throwing it into production...
|
|
|
|
|
It's urgent! It's production dammit!
Blog link to be reinstated at a later date.
|
|
|
|
|
I dropped my boredom for a little while
|
|
|
|
|
I urgently ignored it. I find it saves me having to ignore it later.
|
|
|
|
|
Hi Everyone!
I want to use FolderBrowserDialog Component in my web application?
How can I do? In my application, that component is disable.
I want to enable that components. I try to add References>Add References>System.Windows.Forms but still disable.
Any alternative way?
Thanks in advance for your help!
|
|
|
|