S Mithal

Greenhorn
+ Follow
since Mar 17, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by S Mithal

I am trying to display some information about a file on my local directory in an html page using javascript. Is there a way to do so without using ActiveXObject objects as this solution is browser specific. I am using this for now:

function getFileSize()
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
fileObj = fso.GetFile("myFile");
return fileObj.Size;
}

TIA
Thanks for your post. I read the same while trying to explore this issue, but wanted to confirm if there was an alternative to <redirect:write>.
Hi,

I am trying to split an xml using xslt. For this I am using <redirect:write> which is Xalan specific. Is there an alternative tag I can use and get the same functionality?

This is an example xml file:

<?xml version="1.0" encoding="UTF-8"?>
<MyFType>
<MyRType>
<MCode>
<ID>1</ID>
<Title>ABC</Title>
<ShortSummary>EFG</ShortSummary>
</MCode>
</MyRType>
<MyRType>
<MCode>
<ID>2</ID>
<Title>WER</Title>
<ShortSummary>EFG</ShortSummary>
</MCode>
</MyRType>
</MyFType>

This is the xslt which will split the above into 1.xml and 2.xml

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
extension-element-prefixes="redirect"
version="1.0"
>
<xsl utput method="xml"/>

<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>

<xsl:template match="MyFType">
<xsl:apply-templates />
</xsl:template>

<xsl:template match="MyRType">
<xsl:variable name="filename" select="concat(MCode/ID,'.xml')" />
<redirect:write select="$filename">
<MyRType>
<xsl:apply-templates />
</MyRType>
</redirect:write>
</xsl:template>

<xsl:template match="MCode">
<xsl:copy-of select="." />
</xsl:template>

</xsl:stylesheet>
On the same lines, I have a SOAP message to which I want to add a tag.
However, the message is output as is without the tag.

Here is the xsl:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl utput method="xml" />
<xsl:template match="/">
<xsl:copy-of select="." />
</xsl:template>
<xsl:template match="po">
<xsl:copy>
<Id>a new id</Id>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>


This is the message:

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsse:Security
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext">
</wsse:Security>
<Action>transfer</Action>
</soapenv:Header>
<soapenv:Body>
<ns1 oSubmit
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn o-submit">
<po xsi:type="xsd:string">
<PORequest>
<testNum>3</testNum>
<priceList>953</priceList>
<quantity>1</quantity>
<PONumber></PONumber>
<CreditCardNos>4178908723456781</CreditCardNos>
<Amount>56091.23</Amount>
<RequestedShipDate>020606</RequestedShipDate>
</PORequest>
</po>
</ns1 oSubmit>
</soapenv:Body>
</soapenv:Envelope>

Requirement is the below to add a tag called Id:


<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsse:Security
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext">
</wsse:Security>
<Action>transfer</Action>
</soapenv:Header>
<soapenv:Body>
<ns1 oSubmit
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn o-submit">
<po xsi:type="xsd:string">
<Id>a new id</Id>
<PORequest>
<testNum>3</testNum>
<priceList>953</priceList>
<quantity>1</quantity>
<PONumber></PONumber>
<CreditCardNos>4178908723456781</CreditCardNos>
<Amount>56091.23</Amount>
<RequestedShipDate>020606</RequestedShipDate>
</PORequest>
</po>
</ns1 oSubmit>
</soapenv:Body>
</soapenv:Envelope>

Thanks
Hi,

I have an xml document. I want to write an xsl to add a tag to the xml doc to add a tag as:

OLD FILE :
----------
<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
.
.
.
</catalog>

NEW FILE:
---------

<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
<newtag>myTag</newtag>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
.
.
.
</catalog>

TIA
Hi,

I am writing a JAVAMail client to send an email to xyz@yahoo.com from abc@yahoo.com . Both are legal mail addresses.

This is how I set the server name
props.put("mail.smtp.host", "smarthost.yahoo.com");

My code compiles butI get an error while executing:

javax.mail.SendFailedException: Sending failed;
nested exception is: javax.mail.MessagingException: Could not connect to SMTP host: smarthost.yahoo.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at Mail.postMail(Mail.java:41)
at Mail.main(Mail.java:49)

I have enabled the port 25 explicitly.

TIA
S Mithal
18 years ago
Hi Jayant,

Please refer to 'Mastering EJB' by Ed Roman Edition III.

http://www.theserverside.com/books/wiley/masteringEJB/index.tss

Chapter 5 for a detailed description/examples on How to expose EJBs as web services.

S Mithal
18 years ago
Do you have activation.jar in ur classpath ?
18 years ago
Check out
http://www-128.ibm.com/developerworks/webservices/library/ws-whichwsdl/

It will tell you how to write your WSDL for literal\encoded AND rpc\document.

Thanks
S Mithal
18 years ago
How do I deal with datatypes like an ArrayList in a .NET / J2EE environment? If I am passing an arraylist of user defined data type <say author> from a J2EE client to a .NET Service, the Microsoft environment does not have a corresponding data structure to ArrayList. How will it handle the array list ?

TIA
S Mithal
18 years ago
I figured it out...

Thx
18 years ago
Hi,

I have a HelloWorld web service deployed on a Weblogic server. I want to call it from a .net client. So, I do the following:

1. use wsdl.exe to generate the proxy .cs class from the HelloWorld.wsdl
2. compile the .cs class to create the proxy dll and move it to wwwroot/bin

Now when I try to run the client from the ASP .NET Web Matrix, I do not get any response. However, I am able to execute a .net webservice from the same environment.

Is there a step I am missing?

TIA
S Mithal
18 years ago
Hi Avijit,

I am not proficient at web Services... started learning it just sometime back. Also, I have never worked on Websphere or Rational. Sorry, but I will be unable to help you.
18 years ago
Hi Balaji,

No offense and definitely no point of contention too ... but the policy says "You can even use initials for the first name if you like." Please tell me what part of the policy I do not comply with and I'll gladly change my display name.

And thanks for all your help to the questions I posted above.

S Mithal
18 years ago
Hi,

I am comfortable with the J2EE Web Service Soup but am now trying to install the .NET environment to be able to run some webservice on it.

I installed the .NET Redistribution framework and the .NET SDK. Do I need any other component?

Do I need the IIS Server ? If yes, then it is not supported on my XP home Platform. What do I do?

What is a good starting point to learn writing a service in the Microsoft environment.

TIA
S Mithal
18 years ago