Loading ...
Sorry, an error occurred while loading the content.

RE: [soaplite] MS .NET needs interface definition... how?

Expand Messages
  • Tony Hong
    Hi Chris, An SDL file is an XML description of interface and binding information for a service. Using an XML-based SDL document, a program can derive
    Message 1 of 2 , Feb 28, 2001
    • 0 Attachment
      Hi Chris,
       
      An SDL file is an XML description of interface and binding information for a service. Using an XML-based SDL document, a program can derive information about how to use a service, such as:
       
      1.  Namespaces used inthe SOAP document
      2.  What the available methods are
      3.  What the SOAPAction header should be
      4.  What the schemas are of the body elements (ie, the "parts"), and what types do those elements map into
      5.  What the endpoint is for the service
       
      etc. etc.
       
      "SDL" is actually an older specification that has been superceded by "WSDL", but .NET hasn't quite caught up yet. However, MS is certainly planning to support WSDL in a (hopefully not to far into the) future .NET release and SDL will become obsolete .
       
      Now, the .NET framework has a utilty called "webserviceutil" . One of the things webserviceutil does is take a URL to an SDL doc, and generate a stub in whatever .NET language the user wants - C#, VB.NET, etc.  This stub then compiles into a DLL that can be used by .NET applications to transparently invoke webservices - all of the info about how to invoke the service , derived from the SDL , is compiled into the DLL. This is not unlike the stubs that can be generated in SOAP::Lite. 
       
      The bottom line, though is that for SOAP::Lite servers, if you want to have .NET clients bind to it, you will need to build an SDL file yourself , because SOAP::Lite doesn't autogenerate SDL (and it probably shouldn't , given the fact that SDL is on its way out) . Once you've built one by hand, the webserviceutil utility can then consume it and generate the stub. to call it. I've actually already done this for one of the XMethods services, so maybe this will be helpfull in illustrating how to do this for a very simple service.
       
      Here is the service code :
       
      --------------------------------------------------
      use SOAP::Lite;
      package xmethodsSoapPing;
       
      sub pingHost {
          ($class,$hostname)=@_;
       
            .... <code> ...
       
          return SOAP::Data->name('return')->type('int')->value($status);
       
      }
       
      --------------------------------------------------
       
      where status is either a 0 or 1.
       
       
      And here is the associated SDL:
       
      --------------------------------------------------------
       
      <?xml version="1.0"?>
      <serviceDescription xmlns:s0="urn:xmethodsSoapPing" name="Ping" targetNamespace="urn:xmethodsSoapPing" xmlns="urn:schemas-xmlsoap-org:sdl.2000-01-25">
        <soap xmlns="urn:schemas-xmlsoap-org:soap-sdl-2000-01-25">
          <service>
            <addresses>
              <address uri="http://services.xmethods.net/perl/soaplite.cgi"/>
            </addresses>
            <requestResponse name="pingHost" soapAction="urn:xmethodsSoapPing#pingHost">
              <request ref="s0:pingHost"/>
              <response ref="s0:pingHostResponse"/>
            </requestResponse>
          </service>
        </soap>
        <schema targetNamespace="urn:xmethodsSoapPing" attributeFormDefault="qualified" elementFormDefault="qualified" xmlns="http://www.w3.org/1999/XMLSchema">
          <element name="pingHost">
            <complexType>
              <all>
                <element name="hostname" xmlns:q1="http://www.w3.org/1999/XMLSchema" type="q1:string" nullable="true" form="unqualified"/>
              </all>
            </complexType>
          </element>
          <element name="pingHostResponse">
            <complexType>
              <all>
                <element name="return" xmlns:q2="http://www.w3.org/1999/XMLSchema" type="q2:int" form="unqualified"/>
              </all>
            </complexType>
          </element>
        </schema>
      </serviceDescription>
       
      ------------------------------------------
       
      This is a real live service at XMethods, so if you want you can create the .NET stub from this SDL and try it out.
       
      Hopefully that clarifies things a bit.
       
      Cheers,
      Tony
       
       
       
       
       
       
       
       
       
       
       
      A sample SDL
      document can be found here
       
      -----Original Message-----
      From: Chris Davies [mailto:Chris.Davies@...]
      Sent: Wednesday, February 28, 2001 3:11 AM
      To: SOAP Lite mailing list
      Subject: [soaplite] MS .NET needs interface definition... how?

      I've just started using SOAP::Lite as a client/server to talk with an MS
      .NET client/server. I've read the bit in the docs about needing to fix up
      the encoding differences, and now my client can talk to the other party's
      server.

      However, in attempting to get the MS .NET client talk to my SOAP::Lite
      server, they (the other party) have written,

      "[...] the Microsoft tools 'prefer' a definition of the interfaces (SDL, I
      think the term is) during its class wrapper creation phase which we don't
      have.  Are there any discoverer files / services available with what you
      have done?"

      The chap who wrote this can only try to explain it in terms of Microsoft
      programming tools, and I don't know anything about those and he doesn't know
      anything about perl!

      So, can anyone here please explain to me simply (or in perl terminology if
      you prefer) what this means and how I provide it? I'm not an XML expert, so
      I'm groping in the dark. I do know what I want to achieve, though, and I'm
      familiar with the concepts from the time back in the "old days" of SunRPC.

      If it helps, let's consider the simple example functions "hi()" and
      "languages()" provided in Demo.pm, and perhaps "c2f()" provided in temp.cgi,
      as part of the SOAP::Lite package.

      Thanks,
      Chris



      To unsubscribe from this group, send an email to:
      soaplite-unsubscribe@yahoogroups.com



      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
    Your message has been successfully submitted and would be delivered to recipients shortly.