Hi Monks,

I new to SOAP and wsdl.

I have 2 machines, 1 server and 1 client.

And I have a wsdl:

<?xml version="1.0" encoding="UTF-8" ?> - <definitions name="HelloService" targetNamespace="http://www.mysite. +com/HelloService.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns +:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.m +ysite.com/HelloService.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSch +ema"> - <message name="SayHelloRequest"> <part name="firstName" type="xsd:string" /> </message> - <message name="SayHelloResponse"> <part name="greeting" type="xsd:string" /> </message> - <portType name="Hello_PortType"> - <operation name="sayHello"> <input message="tns:SayHelloRequest" /> <output message="tns:SayHelloResponse" /> </operation> </portType> - <binding name="Hello_Binding" type="tns:Hello_PortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap +/http" /> - <operation name="sayHello"> <soap:operation soapAction="sayHello" /> - <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="urn:examples:helloservice" use="encoded" /> </input> - <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="urn:examples:helloservice" use="encoded" /> </output> </operation> </binding> - <service name="Hello_Service"> <documentation>WSDL File for HelloService</documentation> - <port binding="tns:Hello_Binding" name="Hello_Port"> <soap:address location="http://www.mysite.com/HelloServerWsdl.pl" /> + </port> </service> </definitions>

My client side script:

use SOAP::Lite; print "Connecting to Hello Service...\n"; print SOAP::Lite -> service('http://www.mysite.com/HelloService.wsdl') -> sayHello;

However, I have problem on writing server side script as I can't find much sample/exampes from the internet.

Please show me some examples/sample codes.

Please help. Thanks


In reply to How to create soap server script? by Boring

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.