Code:
\documentclass[paper=a4]{scrbook}
\usepackage{pifont}
\usepackage{mathpazo}
\usepackage[scaled=.95]{helvet}
\usepackage{courier}
\usepackage[pdftex]{graphicx}
\usepackage{color}
\definecolor{shadowgray}{gray}{.55}
\usepackage[pdftex]{hyperref}
\hypersetup{colorlinks=true, urlcolor=black, linkcolor=black, citecolor=black, breaklinks=true}
\usepackage{listings}
\lstset{aboveskip=\the\parskip, belowskip=0cm}
\lstloadlanguages{XML, Java}
\lstdefinestyle{XMLHTTP}{
language=XML,
morekeywords={POST},
keywordstyle={\bfseries},
tagstyle={\bfseries},
escapeinside={(*@}{@*)},
frame=shadowbox,
numbers=left,
stepnumber=1,
numberstyle=\tiny,
basicstyle=\small\ttfamily,
commentstyle=\itshape,
columns=fullflexible,
captionpos=b,
rulesepcolor=\color{shadowgray},
keepspaces=true,
fontadjust=true,
showstringspaces=false,
morecomment=[s]{},
}
\lstdefinestyle{JavaHTTP}{
language=Java,
morekeywords={POST},
keywordstyle={\bfseries},
tagstyle={\bfseries},
escapeinside={(*@}{@*)},
frame=shadowbox,
numbers=left,
stepnumber=1,
numberstyle=\tiny,
basicstyle=\small\ttfamily,
commentstyle=\itshape,
columns=fullflexible,
captionpos=b,
rulesepcolor=\color{shadowgray},
keepspaces=true,
fontadjust=true,
showstringspaces=false,
morecomment=[s]{},
}
\begin{document}
\begin{lstlisting}[style=XMLHTTP, caption=XML-HTTP]
POST /StockQuote HTTP/1.1
Host: www.stockquoteserver.com
Content-Type: text/xml; charset="utf-8"
Content-Length: nnnn
SOAPAction: "Some-URI"
HTML-Code:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<m:GetLastTradePrice xmlns:m="Some-URI">
<symbol>DIS</symbol>
</m:GetLastTradePrice>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
\end{lstlisting}
\begin{lstlisting}[style=JavaHTTP, caption=Java-HTTP]
POST /StockQuote HTTP/1.1
Host: www.stockquoteserver.com
Content-Type: text/xml; charset="utf-8"
Content-Length: nnnn
SOAPAction: "Some-URI"
public void example(){}
\end{lstlisting}
\end{document}
Lesezeichen