|
Hi Mike. Thanks for replying. I am using Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1, Microsoft Visual Basic .NET, ASP .NET.
Marcy
|
|
|
|
|
using System.Net;
System.Net.IPHostEntry hostent = Dns.GetHostEntry("localhost");
foreach (IPAddress addr in hostent.AddressList)
{
Debug.WriteLine(String.Format("{0}:{1}", addr.Address, addr.ToString()));
}
led mike
|
|
|
|
|
Thanks Mike. I will try that. The server IP address I am trying to capture is a client's. This client is using our web service. We want to allow only a certain range of IP addresses access to the web service.
Marcy
|
|
|
|
|
dove11 wrote: The server IP address I am trying to capture is a client's.
That is new information and not what I gave you. From your perspective the Server "is" a client. The client IP is in the HTTP Header. However the server is likely behind a firewall in which case you will only get the firewalls IP and there is nothing you can do to see behind the firewall.
dove11 wrote: We want to allow only a certain range of IP addresses access to the web service.
This is likely based "per company"? If so the firewall IP should work fine for you.
http://msdn2.microsoft.com/en-us/library/system.web.httprequest.userhostaddress.aspx[^]
dove11 wrote: but we wanted to capture the client's server IP address
I missed that... my bad. In the future post ASP.NET questions in the ASP.NET forum[^], this would have been answered in about 10 minutes over there.
led mike
|
|
|
|
|
Sorry, I wasn't sure, since it was regarding a web service and SOAP Header. I thought it would go in the XML forum. Thanks for the information. I really appreciate it.
|
|
|
|
|
Hi,
can I use a variable in xmlns?
like -> <xsl:stylesheet version="1.0" xmlns:foo="$var">
Thanks
|
|
|
|
|
|
I would say no! The variable would have to be declared before the xsl:stylsheet element which would not be in the scope of the stylesheet. However, you can create a stylesheet with a stylesheet, and, then, you can have variable content in the stylesheet element. By the way, the proper way to embedded a variable value in an attribute is:
<foo value="{$var}"/>
George
|
|
|
|
|
sorry, ignore my post. I did not read the question correctly.
led mike
|
|
|
|
|
, I have been doing that same thing a lot lately. However, I thought your post was useful.
|
|
|
|
|
how can get the value from a database by using XPath or XQuery
What is XSDL
-
|
|
|
|
|
Based on your array of questions in multiple forums it sure seems like you are needing help on your homework.
|
|
|
|
|
When the xml file is large, it takes sometime to load the file and display it into the browser.
During this time, your browser seems to be stand still. If other people dont know, they might think that there is some problem with your web site and then leave.
Can I display a message like "Loading...", to the browser while waiting for xml file to be loaded?
|
|
|
|
|
I would use javascript to handle this task and is accpeted by all browsers
something like the below is easy to implement
============================================================
INSTRUCTIONS.
This is a MUTI-PART Script.
============================================================
PART I.
Copy code below into <HEAD> section of your HTML pages
============================================================
<SCRIPT TYPE="text/javascript" LANGUAGE="javascript">
<!-- PreLoad Wait - Script -->
<!-- This script and more from http://www.rainbow.arch.scriptmania.com
function waitPreloadPage() { //DOM
if (document.getElementById){
document.getElementById('prepage').style.visibility='hidden';
}else{
if (document.layers){ //NS4
document.prepage.visibility = 'hidden';
}
else { //IE4
document.all.prepage.style.visibility = 'hidden';
}
}
}
// End -->
</SCRIPT>
============================================================
PART II.
Add the onLoad event, as shown below, to your <BODY> tag:
============================================================
<BODY onLoad="waitPreloadPage();">
============================================================
PART III.
Copy codes below to immediately after <BODY> tag.
============================================================
<DIV id="prepage" style="position:absolute; font-family:arial; font-size:16; left:0px; top:0px; background-color:white; layer-background-color:white; height:100%; width:100%;">
<TABLE width=100%><TR><TD><B>Loading ... ... Please wait!</B></TD></TR></TABLE>
</DIV>
|
|
|
|
|
Hi I am tring to read a xml in vs2005
my code keeps raising the following exception: "illegal characters in path"
here is the vb.net code:
Dim ds As New DataSet
ds.ReadXml(xmlout)
ds.WriteXml("C:\Query.xml")
here is the xml doc i am reading:
<?xml version="1.0" encoding="Windows-1252"?>
<InvQuery Language='05' CssStyle='' DecFormat='1' DateFormat='01' Role='01' Version='6.0.015'>
<StockItem>
<StockCode>R00001</StockCode>
<Description>POLYCARBONATE</Description>
<LongDesc>POLYCARBONATE RAW</LongDesc>
<AlternateKey1/>
<AlternateKey2/>
<Version/>
<Release/>
<StockUom>KG</StockUom>
<AlternateUom>GM</AlternateUom>
<ConvFactAltUom> 1000.000000</ConvFactAltUom>
<ConvMulDiv>D</ConvMulDiv>
<OtherUom>KG</OtherUom>
<ConvFactOthUom> 1.000000</ConvFactOthUom>
<MulDiv>M</MulDiv>
<StockAndAltUm>N</StockAndAltUm>
<PartCategory>B</PartCategory>
<Supplier/>
<ProductClass>POLY</ProductClass>
<Buyer/>
<Planner/>
<TraceableType>N</TraceableType>
<MpsFlag>N</MpsFlag>
<SupercessionDate/>
<DrawOfficeNum/>
<Ebq> 1.000</Ebq>
<DockToStock> 0</DockToStock>
<ManufLeadTime> 0</ManufLeadTime>
<TariffCode/>
<UserField1/>
<UserField2> 0.00000</UserField2>
<UserField3/>
<UserField4/>
<UserField5/>
<LeadTime> 5</LeadTime>
<WarehouseToUse>B2</WarehouseToUse>
<GrossReqRule>I</GrossReqRule>
<EccUser/>
<Mass> 0.000000</Mass>
<Volume> 0.000000</Volume>
<PriceCategory>A</PriceCategory>
<PriceMethod>C</PriceMethod>
<CycleCount> 0</CycleCount>
<TaxCode>B</TaxCode>
<OtherTaxCode/>
<ListPriceCode/>
<SerialMethod>N</SerialMethod>
<KitType>N</KitType>
<BulkIssueFlag>N</BulkIssueFlag>
<AbcClass/>
<StockMovementReq>Y</StockMovementReq>
<ClearingFlag>N</ClearingFlag>
<AbcAnalysisReq>Y</AbcAnalysisReq>
<AbcCostingReq/>
<CostUom>KG</CostUom>
<StockOnHold/>
<StockOnHoldReason/>
</StockItem>
<WarehouseItem>
<Warehouse>B2</Warehouse>
<Description>BRAESIDE RAW MATERIALS</Description>
<QtyOnHand> 14320.580</QtyOnHand>
<AvailableQty> 14320.580</AvailableQty>
<QtyOnOrder> 333500.000</QtyOnOrder>
<QtyInInspection> 0.000</QtyInInspection>
<MinimumQty> 0.000</MinimumQty>
<MaximumQty> 0.000</MaximumQty>
<QtyOnBackOrder> 0.000</QtyOnBackOrder>
<QtyAllocated> 0.000</QtyAllocated>
<MtdQtyReceived> 15000.000</MtdQtyReceived>
<MtdQtyAdjusted> -4418.896</MtdQtyAdjusted>
<MtdQtyIssued> 19229.420</MtdQtyIssued>
<YtdQtySold> 0.000</YtdQtySold>
<PrevYearQtySold> 209807.530</PrevYearQtySold>
<QtyInTransit> 0.000</QtyInTransit>
<QtyAllocatedWip> 83114.600</QtyAllocatedWip>
<MtdQtySold Height='000' Top=' 25535'> 0.000</MtdQtySold>
<MtdQtyTrf> 0.000</MtdQtyTrf>
<UserField1/>
<UserField2/>
<UserField3/>
<DefaultBin/>
<UnitCost> 4.96228</UnitCost>
<SalesQtyByMonth>
<SalesQty1 Height='061'> 15575.800</SalesQty1>
<SalesQty2 Height='062'> 15755.304</SalesQty2>
<SalesQty3 Height='065'> 16712.316</SalesQty3>
<SalesQty4 Height='063'> 16025.252</SalesQty4>
<SalesQty5 Height='061'> 15491.400</SalesQty5>
<SalesQty6 Height='072'> 18400.806</SalesQty6>
<SalesQty7 Height='067'> 17022.060</SalesQty7>
<SalesQty8 Height='044'> 11324.508</SalesQty8>
<SalesQty9 Height='052'> 13304.464</SalesQty9>
<SalesQty10 Height='100'> 25535.280</SalesQty10>
<SalesQty11 Height='095'> 24366.672</SalesQty11>
<SalesQty12 Height='091'> 23143.720</SalesQty12>
</SalesQtyByMonth>
</WarehouseItem>
<WarehouseItem>
<Warehouse>N2</Warehouse>
<Description>NORTHMEAD RAW MATERIALS</Description>
<QtyOnHand> 36998.000</QtyOnHand>
<AvailableQty> 36998.000</AvailableQty>
<QtyOnOrder> 148500.000</QtyOnOrder>
<QtyInInspection> 0.000</QtyInInspection>
<MinimumQty> 0.000</MinimumQty>
<MaximumQty> 0.000</MaximumQty>
<QtyOnBackOrder> 0.000</QtyOnBackOrder>
<QtyAllocated> 0.000</QtyAllocated>
<MtdQtyReceived> 35500.000</MtdQtyReceived>
<MtdQtyAdjusted> 825.408</MtdQtyAdjusted>
<MtdQtyIssued> 52752.000</MtdQtyIssued>
<YtdQtySold> 0.000</YtdQtySold>
<PrevYearQtySold> 406309.904</PrevYearQtySold>
<QtyInTransit> 0.000</QtyInTransit>
<QtyAllocatedWip> -46109.144</QtyAllocatedWip>
<MtdQtySold Height='000' Top=' 55367'> 0.000</MtdQtySold>
<MtdQtyTrf> 0.000</MtdQtyTrf>
<UserField1/>
<UserField2/>
<UserField3/>
<DefaultBin/>
<UnitCost> 5.01040</UnitCost>
<SalesQtyByMonth>
<SalesQty1 Height='074'> 41175.410</SalesQty1>
<SalesQty2 Height='100'> 55367.712</SalesQty2>
<SalesQty3 Height='055'> 30331.044</SalesQty3>
<SalesQty4 Height='058'> 32120.580</SalesQty4>
<SalesQty5 Height='044'> 24530.728</SalesQty5>
<SalesQty6 Height='067'> 37250.100</SalesQty6>
<SalesQty7 Height='063'> 34816.440</SalesQty7>
<SalesQty8 Height='063'> 35081.756</SalesQty8>
<SalesQty9 Height='058'> 32207.516</SalesQty9>
<SalesQty10 Height='073'> 40260.420</SalesQty10>
<SalesQty11 Height='065'> 36142.216</SalesQty11>
<SalesQty12 Height='064'> 35711.832</SalesQty12>
</SalesQtyByMonth>
</WarehouseItem>
</InvQuery>
Any help would be appreciated
Cheers
|
|
|
|
|
encoding="Windows-1252" might be the problem. I am not absolutely sure but I think System.Xml is expecting UTF-8 or UTF-16 encoding by default. You may need to read in the XML like the following:
StreamReader reader = new StreamReader(filename, Encoding.GetEncoding(1252));
This might help: http://support.microsoft.com/default.aspx?scid=kb;en-us;308061[^]
-- modified at 21:55 Thursday 28th September, 2006
|
|
|
|
|
Thanks George just tried no good.
I have made a small breathru if I remove the attributes on this line
<InvQuery Language='05' CssStyle='' DecFormat='1' DateFormat='01' Role='01' Version='6.0.015'>
to
<InvQuery>
It works perfectly.
The only problem is i make a call out to receive the xml from a extrenal program and am not sure how to remove those attributes prior to any processing in my code..
Can anyone help with my new problem >?
Cheers
One Big Problem!
|
|
|
|
|
Read the file into a stream reader
Read the streamreader into an XmlTextReader
Ds.Get(xsmltextreader)
that should format your string to Xml that the dataset can read
Hope this helped!
|
|
|
|
|
I have the schema as follows, but i can't seem to work out how to get attributes checked.
<?xml version="1.0"?><br />
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"<br />
targetNamespace="http://www.w3schools.com"<br />
xmlns="http://www.w3schools.com"<br />
elementFormDefault="qualified"><br />
<br />
<xs:element name="note"><br />
<xs:complexType><br />
<xs:sequence><br />
<xs:element name="Type" type="xs:string" default="FreeSpace"/><br />
<xs:element name="Obstical" type="xs:integer"/><br />
</xs:sequence><br />
<xs:attribute name="Type" type="xs:string" default="Debris"/><br />
</xs:complexType><br />
</xs:element><br />
</xs:schema>
doing it this way makes it put the attribute under the parent, if i try to put it in the element XMLspy say it is not valid.
i want Obstical to have a string type attribute, which defaults to debris
How would i define attributes for elements? all the tutotials give the attribute line eg
<xs:attribute name="Type" type="xs:string" default="Debris"/>
but not where i am supposed to put it in my schema.
|
|
|
|
|
check your post and Code Project guidlines for posting data with < and > characters
led mike
|
|
|
|
|
Hi,
I want to delete nodes in XML the problem is I'm using deleteSelf() but only a few nodes are deleted and not all here is the code:
foreach (XPathNavigator nav in navigator.Select("//book[@title='"+title+"']"))
{
nav.DeleteSelf();
}
doc.Save(filename);
|
|
|
|
|
I don't have time to work up your approach but why are you using XPathNavigator rather than the DOM?
"When your argument falls apart...resort to name-calling." Red Stateler aka (D)espeir in the Soapbox
Whereas "liberal" is just a moron. Red Stateler aka (D)espeir in the Soapbox
led mike
|
|
|
|
|
I tried with DOM also
node.ParentNode.removeChildNode(node);
still not deleting everything, somehow it skips some nodes
|
|
|
|
|
So you did this:
XmlNodeList list = doc.SelectNodes("//book[@title='test']");
foreach (XmlNode node in list)
node.ParentNode.RemoveChild(node);
doc.Save("myfile.xml");
and stepped through the loop in debug mode watching all the nodes get deleted but then after the file was saved some of the nodes where still there? I would need to see that happen to believe it.
led mike
|
|
|
|
|
Recently I made a project,in the project I need to transfer a big string(about 80MB) in WebService,but it give an exception,the message in the application log is:
"aspnet_wp.exe (PID: 3324) was recycled because memory consumption exceeded the 287 MB (60 percent of available RAM)."
How to fix the problem?
many thanx!
Bright Zhang
|
|
|
|