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

Re: [soaplite] A Simple Example (Perl SOAP Server, VB.NET Client)

Expand Messages
  • Nayana Hettiarachchi
    You might be having an issue with NameSpaces, .NET is very picky about namespaces in XML documents, i have posted a good working example on a SOAP::Lite server
    Message 1 of 4 , May 3, 2004
    • 0 Attachment
      You might be having an issue with NameSpaces, .NET is very picky about
      namespaces in XML documents, i have posted a good working example on a
      SOAP::Lite server to a .NET Client search in the group you will find it,

      cheers

      Nayana


      Christopher Parker wrote:

      > ***This is a possible duplicate. I posted this morning, and still
      > nothing. If this is a duplicate message, please accept my
      > apologies.***
      >
      > Hello all,
      >
      > I'm trying to get communications working between a Perl SOAP::Lite
      > server and a .NET client application. I have three things written to
      > test this:
      >
      > 1.) WSDL Document
      > 2.) Perl SOAP::Lite Server (CGI)
      > 3.) Visual Basic .NET Client
      >
      > When I add the WSDL document as a Web Reference to my VB.NET client
      > and try to run my client application, I get this error:
      >
      > "An unhandled exception of type 'System.
      > Web.Services.Protocols.SoapHeaderException' occurred in
      > system.web.services.dll
      >
      > "Additional information: Denied access to method (sayHello) in class
      > (main) at C:/Perl/site/lib/SOAP/Lite.pm line 2159."
      >
      > I'm assuming my problem is with my Perl server, then? I don't
      > understand how this is possible. My entire SOAP server is here:
      >
      > #########################
      > #!c:/perl/bin/perl.exe -w
      > # Location: http://localhost/cgi-bin/Hello.cgi
      > use strict;
      >
      > use SOAP::Transport::HTTP;
      >
      > SOAP::Transport::HTTP::CGI
      > -> dispatch_to('Hello')
      > -> handle;
      >
      > package Hello;
      >
      > sub sayHello
      > {
      > return "Hello world!";
      > }
      > #########################
      >
      >
      > I'm doubting the problem is with my WSDL, either. It's here:
      >
      > <!---------------------->
      > <?xml version="1.0" encoding="UTF-8"?>
      > <definitions name="HelloService"
      > targetNamespace="http://www.helloWSDL"
      > xmlns="http://schemas.xmlsoap.org/wsdl/"
      > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:tns="http://www.helloWSDL"
      > xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      > <types/>
      > <message name="sayHelloRequest"/>
      > <message name="sayHelloResponse">
      > <part name="arg0" type="xsd:string"/>
      > </message>
      > <portType name="Hello">
      > <operation name="sayHello">
      > <input message="tns:sayHelloRequest"/>
      > <output message="tns:sayHelloResponse"/>
      > </operation>
      > </portType>
      > <binding name="HelloBinding" type="tns:Hello">
      > <soap:binding style="rpc"
      > transport="http://schemas.xmlsoap.org/soap/http"/>
      > <operation name="sayHello">
      > <soap:operation soapAction="http://www.helloWSDL/sayHello"/>
      > <input>
      > <soap:body
      > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > namespace="http://www.helloWSDL" use="encoded"/>
      > </input>
      > <output>
      > <soap:body
      > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > namespace="http://www.helloWSDL" use="encoded"/>
      > </output>
      > </operation>
      > </binding>
      > <service name="HelloService">
      > <port binding="tns:HelloBinding" name="HelloPort">
      > <soap:address location="http://localhost/cgi-bin/Hello.cgi"/>
      > </port>
      > </service>
      > </definitions>
      > <!---------------------->
      >
      > In case this WSDL looks faimilar, that's because I ripped it from
      > http://www.novell.com/documentation/lg/workbench41/docs/jbroker-
      > web/docs/tutorial/helloWSDL-1.htm (appears second on Google when you
      > search for "hello world wsdl").
      >
      > I'm able to successfully add this as a Web Reference to my VB.NET
      > project and I'm able to browse the method (sayHello) via my class
      > browser. So, I'm stumped. Is there anything I'm forgetting to do? Is
      > there anything I'm doing that I shouldn't be doing?
      >
      > Thanks.
      >
      > --
      > Parker
      >
      >
      > ------------------------------------------------------------------------
      > *Yahoo! Groups Links*
      >
      > * To visit your group on the web, go to:
      > http://groups.yahoo.com/group/soaplite/
      >
      > * To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      > <mailto:soaplite-unsubscribe@yahoogroups.com?subject=Unsubscribe>
      >
      > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      > Service <http://docs.yahoo.com/info/terms/>.
      >
      >

      --
      Nayana Hettiarachchi

      Trade Tech, Inc.
      Comprehensive E-Business Solutions for Freight Management

      12600 S.E. 38th Street Suite 150
      Bellevue, WA 98006 USA

      Phone: +1 (425) 837.9000
      Fax: +1 (425) 837.9008
      Mobile: +1 (206) 617.8079

      On the web at: http://www.tradetech.net
    • perlmedian
      Check out this post, it should have all the fixins you need: http://groups.yahoo.com/group/soaplite/message/3531
      Message 2 of 4 , May 6, 2004
      • 0 Attachment
        Check out this post, it should have all the fixins you need:

        http://groups.yahoo.com/group/soaplite/message/3531


        --- In soaplite@yahoogroups.com, Nayana Hettiarachchi <nayana@t...> wrote:
        > You might be having an issue with NameSpaces, .NET is very picky about
        > namespaces in XML documents, i have posted a good working example on a
        > SOAP::Lite server to a .NET Client search in the group you will find it,
        >
        > cheers
        >
        > Nayana
        >
        >
        > Christopher Parker wrote:
        >
        > > ***This is a possible duplicate. I posted this morning, and still
        > > nothing. If this is a duplicate message, please accept my
        > > apologies.***
        > >
        > > Hello all,
        > >
        > > I'm trying to get communications working between a Perl SOAP::Lite
        > > server and a .NET client application. I have three things written to
        > > test this:
        > >
        > > 1.) WSDL Document
        > > 2.) Perl SOAP::Lite Server (CGI)
        > > 3.) Visual Basic .NET Client
        > >
        > > When I add the WSDL document as a Web Reference to my VB.NET client
        > > and try to run my client application, I get this error:
        > >
        > > "An unhandled exception of type 'System.
        > > Web.Services.Protocols.SoapHeaderException' occurred in
        > > system.web.services.dll
        > >
        > > "Additional information: Denied access to method (sayHello) in class
        > > (main) at C:/Perl/site/lib/SOAP/Lite.pm line 2159."
        > >
        > > I'm assuming my problem is with my Perl server, then? I don't
        > > understand how this is possible. My entire SOAP server is here:
      • Christopher Parker
        ... Check out this post, it should have all the fixins you need: http://groups.yahoo.com/group/soaplite/message/3531 ... You are a life-saver. I don t know how
        Message 3 of 4 , May 7, 2004
        • 0 Attachment
          --- perlmedian <perlmedian@...> wrote:
          Check out this post, it should have all the fixins you need:

          http://groups.yahoo.com/group/soaplite/message/3531
          -----

          You are a life-saver. I don't know how I missed this post.

          I was receiving the Denied Access error because I was attempting to return a scalar value, when I
          should have been returning a SOAP::Data object.

          Once I made this change, my Perl-to-.NET communication worked perfectly:

          return SOAP::Data
          -> name('sayHelloResponse')
          -> value('Hello, world!')
          -> type('string')
          -> uri('urn:HelloService');

          As long as the name, type, and uri match those in the WSDL document, then it works without any
          problems. (Now to read up on how to return complex data structures!)

          Thank you so much! Now, I can successfully continue on with the rest of my project.

          Do you use Affero, by any chance? http://www.affero.net/

          --
          Christopher Parker
        Your message has been successfully submitted and would be delivered to recipients shortly.