You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by Scott Nichol <sn...@scottnichol.com> on 2002/10/02 05:07:14 UTC
Re: Extra line appearing in Apache Response
> In order to fix the problem for myself, I had to download Apache SOAP
> sources and edit class org.apache.soap.util.StringUtils, replacing
>
> public static final String lineSeparator =
> System.getProperty("line.separator", "\n");
>
> with an easy
>
> public static final String lineSeparator = "";
>
> Then I had to recomplie SOAP lib, and use custom buit jar. This solved
my
> problem completely. Now I wonder, what is the specific reason to
insert new
> lines?
It is just for readability, which means it is only useful when you have
to debug.
Scott Nichol
Building a DOC style service
Posted by Eric Lo <ec...@csis.hku.hk>.
Hello,
I use the following code to write a Document style service, trying to
transform(by XSLT) an incoming document(well-formed) via SOAP:
public class MessageService {
public void processMessage (Envelope env, SOAPContext requestContext,
SOAPContext resultContext)
throws java.io.IOException, javax.mail.MessagingException
{
try{
TransformerFactory tfactory = TransformerFactory.newInstance();
Transformer transformer =
tfactory.newTransformer(newStreamSource("my_XSL.xsl"));
/* problem 1: extracting well-form document from requestContext */
transformer.transform(Source xmlSource, Result outputTarget);
}catch (Exception e) {}
/* problem 2: returning a well-formed document */
resultContext.setRootPart();
}
}
My question is:
1)How can I extract the XML wrapped inside the SOAPContext? As I cannot
find any useful function call except getBodyPart(int index);
2)How can I send back a well-form document thru
SOAPcontext.setRootPart()? Seems setRootPart don't expect me to send a
well-formed document but a string only
Thanks,
eric
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Building a DOC style service
Posted by Eric Lo <ec...@csis.hku.hk>.
Hello,
I use the following code to write a Document style service, trying to
transform(by XSLT) an incoming document(well-formed) via SOAP:
public class MessageService {
public void processMessage (Envelope env, SOAPContext requestContext,
SOAPContext resultContext)
throws java.io.IOException, javax.mail.MessagingException
{
try{
TransformerFactory tfactory = TransformerFactory.newInstance();
Transformer transformer =
tfactory.newTransformer(newStreamSource("my_XSL.xsl"));
/* problem 1: extracting well-form document from requestContext */
transformer.transform(Source xmlSource, Result outputTarget);
}catch (Exception e) {}
/* problem 2: returning a well-formed document */
resultContext.setRootPart();
}
}
My question is:
1)How can I extract the XML wrapped inside the SOAPContext? As I cannot
find any useful function call except getBodyPart(int index);
2)How can I send back a well-form document thru
SOAPcontext.setRootPart()? Seems setRootPart don't expect me to send a
well-formed document but a string only
Thanks,
eric