<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Engwar &#187; soap</title>
	<atom:link href="http://engwar.com/tags/soap/feed" rel="self" type="application/rss+xml" />
	<link>http://engwar.com</link>
	<description>Chintana Wilamuna&#039;s weblog</description>
	<lastBuildDate>Wed, 30 Nov 2011 13:28:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Custom SOAP headers using WSF/Perl</title>
		<link>http://engwar.com/post/30?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=custom-soap-headers-using-wsfperl</link>
		<comments>http://engwar.com/post/30#comments</comments>
		<pubDate>Fri, 04 Apr 2008 00:35:00 +0000</pubDate>
		<dc:creator>Chintana</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[webservices]]></category>
		<category><![CDATA[wsf/perl]]></category>

		<guid isPermaLink="false">http://engwar.com/post/30</guid>
		<description><![CDATA[SOAP headers are used to convey additional control information that complements the information in the payload. For example WS-Security is one such thing that use SOAP headers to say how integrity and confidentiality should be achieved. Apart from the specs &#8230; <a href="http://engwar.com/post/30">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>SOAP headers are used to convey additional control information that complements the information in the payload.  For example WS-Security is one such thing that use SOAP headers to say how integrity and confidentiality should be achieved.  Apart from the specs that define standard SOAP headers you could also define your own custom headers which could then be processed as you wish from your application.  Let&#8217;s see how we can generate custom SOAP headers using WSF/Perl.  You&#8217;ll need to get the SVN head revision of <a href="http://wso2.org/projects/wsf/perl">WSF/Perl</a> in order to get this working (as of this writing).</p>
<p>First, let&#8217;s see an example from &#8220;Processing XML with Java&#8221; (<a href="http://www.amazon.com/Processing-XML-Java-TM-Guide/dp/0201771861/">Amazon page</a>) also <a href="http://www.cafeconleche.org/books/xmljava">available online here</a>.  I&#8217;m using <a href="http://www.cafeconleche.org/books/xmljava/chapters/ch02s06.html#bid_with_credit_card.xml">the SOAP header example</a> to show you how to generate the exact thing.</p>
<pre lang="xml">
<Payment xmlns="http://namespaces.cafeconleche.org/xmljava/ch2/">
    <Name>Elliotte Harold</Name>
    <Issuer>VISA</Issuer>
    <Number>5125456787651230</Number>
    <Expires>2005-12</Expires>
</Payment>
</pre>
<p>Here&#8217;s how you can generate the above headers using WSF/Perl,</p>
<pre lang="php">
my $name = new WSO2::WSF::WSHeader(
    {'name' => 'Name', 'data' => 'Elliotte Harold' } );

my $issuer = new WSO2::WSF::WSHeader(
    {'name' => 'Issuer', 'data' => 'VISA' } );

my $number = new WSO2::WSF::WSHeader(
    {'name' => 'Number', 'data' => '5125456787651230' } );

my $expires = new WSO2::WSF::WSHeader(
    {'name' => 'Expires', 'data' => '2005-12' } );

my $payment = new WSO2::WSF::WSHeader(
    {'name' => 'Payment',
      'ns' => 'http://namespaces.cafeconleche.org/xmljava/ch2/',
      'data' => [$name, $issuer, $number, $expires] } );

my $client = new WSO2::WSF::WSClient(
    {...,
     'inputHeaders' => [$payment] } );
</pre>
<p>In the <a href="http://www.cafeconleche.org/books/xmljava/chapters/ch02s06.html#signed_bid_with_payment.xml">next example</a> it shows the header with the <code>mustUnderstand</code> attribute set, this is how you set it,</p>
<pre lang="php">
my $client = new WSO2::WSF::WSClient(
    {...,
     'mustUnderstand' => 'true',
     'inputHeaders' => [$payment] } );
</pre>
<p>Next, I&#8217;ll take an example from a <a href="http://www.ibm.com/developerworks/webservices/library/ws-soapheaders/index.html?ca=drs">developerWorks article that shows you how to manipulate SOAP headers in WebSphere</a>.  Consider the following header contents (Listing 4 in the article)</p>
<pre lang="xml">
<MyPrefix:CallingApplication xmlns:MyPrefix="http://SOAPHeaderDemonstration">
    <name>ServiceRequester1</name>
    <version>1.0</version>
    <timeRequestMade>13:20:00</timeRequestMade>
</MyPrefix:CallingApplication>
</pre>
<p>The main difference in this is that it contains a custom prefix for the element <code>CallingApplication</code>.  Here&#8217;s the WSF/Perl code to generate this header,</p>
<pre lang="php">
my $name = new WSO2::WSF::WSHeader(
    {'name' => 'name', 'data' => 'ServiceRequester1' } );

my $version = new WSO2::WSF::WSHeader(
    {'name' => 'version', 'data' => '1.0' } );

my $timereq = new WSO2::WSF::WSHeader(
    {'name' => 'timeRequestMade', 'data' => '13:20:00' } );

my $capp = new WSO2::WSF::WSHeader(
    {'name' => 'CallingApplication', 'ns' => 'http://SOAPHeaderDemonstration',
     'nsprefix' => 'MyPrefix',
     'data' => [$name, $version, $timereq] } );

my $client = new WSO2::WSF::WSClient(
    {...,
     'inputHeaders' => [$capp] } );
</pre>
<p>As you saw in the examples, <code>WSHeader</code> class facilitate creating custom SOAP headers with WSF/Perl.</p>
]]></content:encoded>
			<wfw:commentRss>http://engwar.com/post/30/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WSF/PHP in Uniserver</title>
		<link>http://engwar.com/post/26?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wsfphp-in-uniserver</link>
		<comments>http://engwar.com/post/26#comments</comments>
		<pubDate>Tue, 19 Feb 2008 18:24:48 +0000</pubDate>
		<dc:creator>Chintana</dc:creator>
				<category><![CDATA[rest]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[wamp]]></category>
		<category><![CDATA[wsf/php]]></category>

		<guid isPermaLink="false">http://engwar.com/post/26</guid>
		<description><![CDATA[The Uniform Server is a WAMP that you could try on your machine without having to install anything. WSF/PHP is a SOAP/REST framework for PHP. Go to The Uniform Server&#8217;s plugin page and get the WSF/PHP plugin. Unzip and follow &#8230; <a href="http://engwar.com/post/26">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.uniformserver.com/">The Uniform Server</a> is a <acronym title="Windows. Apache. MySQL. PHP">WAMP</acronym> that you could try on your machine without having to install anything.  <a href="http://wso2.org/projects/wsf/php">WSF/PHP</a> is a SOAP/REST framework for PHP.  Go to <a href="http://www.uniformserver.com/plugins/">The Uniform Server&#8217;s plugin page</a> and get the WSF/PHP plugin.  Unzip and follow the steps in the README file, you should have WSF/PHP ready to run in no time.  You might find it useful if you don&#8217;t want to install those packages on your computer. </p>
]]></content:encoded>
			<wfw:commentRss>http://engwar.com/post/26/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

