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

3835Re: SOLUTION: [soaplite] SOAP::Lite server with .NET client - SOAPAction woes

Expand Messages
  • Issac Goldstand
    Aug 12, 2004
    • 0 Attachment
      First of all, as Mark already mentioned, you don't write a WSDL "server".
      WSDL is a document which describes the web service, much like DTDs were used
      for XML (I think XML Schema's are too complex to make an accurate
      comparison). Many WS server toolkits help out by generating WSDL for you.
      SOAP::Lite is, unfortunately, not one of those. WSDL needs to be written
      the old fashined way - using your favorite text editor.

      As o the error message, I'm no expert on the SOAP::Lite dispatcher, but it
      seems to me that the fact that you're exporting the function into the "main"
      namespace may be confusing it. The dispatcher may come across the "echoYa"
      method in the "main" namespace first, and send that to the HTTP::Server
      object to test against the SOAPAction header. Thus, it wouldn't see
      EchoYa::echoYa as being correct, and spitting that error. Try not
      exporting/importing symbols to see if that works. (It would also be
      interesting if you tried calling main::echoYa and seeing if that worked
      better).

      Hope that helps a bit,
      Issac



      ----- Original Message -----
      From: "wxyc" <wxyc@...>
      To: <soaplite@yahoogroups.com>
      Sent: Thursday, August 12, 2004 6:16 PM
      Subject: Re: SOLUTION: [soaplite] SOAP::Lite server with .NET client -
      SOAPAction woes


      > Issac -
      >
      > I am having a similar problem on making a client(in Axis/Java 1.1)
      > call a SOAP::Lite server, and your post is helpful.
      >
      > However, by following your advices, the problem is not gone.
      >
      > My WS server is deployed in the static mode and is not a WSDL-type
      > server . Here is the code:
      >
      > --------------------8<-----------------------
      > #! /usr/local/bin/perl -w
      > use SOAP::Transport::HTTP;
      > use lib ("/nas/dev/test/testSoap/");
      > use EchoYa qw(echoYa);
      >
      > $SIG{PIPE} = $SIG{INT} = 'IGNORE';
      >
      > $daemon = SOAP::Transport::HTTP::Daemon
      > -> new (LocalPort => 8003)
      > -> dispatch_to('EchoYa');
      > $daemon->handle;
      > --------------------8<-----------------------
      >
      > The EchoYa.pm is like this:
      > --------------------8<-----------------------
      > package EchoYa;
      >
      > require Exporter;
      > @ISA = qw(Exporter);
      > @EXPORT = qw( echoYa );
      >
      > sub echoYa {
      > print "enter echoYa\n";
      > my $self = shift;
      > my $ya = shift;
      > return "I got $ya!";
      > }
      > 1;
      > --------------------8<-----------------------
      >
      > I changed the relevent line of the client to set the SOAPAction as
      > "urn:EchoYa#echoYa", I still got an error:
      >
      > SOAPAction shall match 'uri#method' if present (got
      > 'urn:EchoYa#echoYa', expected '#echoYa'
      >
      > You post sounds like you have a WSDL serveice written in SOAP::Lite.
      > How did you do that? because SOAP::Lite does not really provide bolts
      > and nuts for writing a WSDL server?
      >
      > Thanks,
      >
      > Donald
      >
      > --- In soaplite@yahoogroups.com, "Issac Goldstand" <margol@b...>
      > wrote:
      > > MessageThanks for all the suggestions. I will attempt to include
      > lots of details in this response for the sake of the archives.
      > >
      > > My original suspicion was that the MS type namespaces (eg / instead
      > of #, or "s or lack thereof, or urn: or http:, etc) were not the
      > issue, as the *server* is the part that cares about the namespace, and
      > to properly create a proxy from WSDL, any toolkit regardless of the
      > underlying framwork, need to take the WSDL and just *do what it says*
      >
      > >
      > > Futher, using "urn:MyApp" tends to be important when talking to
      > SOAP::Lite, using the format of "urn:Foo/Bar#baz" may be important,
      > simply because when dispatching (I think both dynamicly and staticly)
      > the SOAP calls to the actually methods, SOAP::Lite translates
      > everything between "urn:" and "#" to the class, substituting "/" for
      > "::", and everything after "#" as the method name. For example:
      > > soapAction="urn:Foo/Bar#Baz" becomes Foo::Bar::baz (or baz in
      > package Foo::Bar if that wasn't clear)
      > > soapAction="urn:MyApp#Method" becomes MyApp::Method
      > > etc
      > >
      > > Also, there are lots of mentions in the archives and in the
      > SOAP::Lite docs seemingly saying that MS doesn't play nicely with RPC
      > type operations, but I've encoutnered no problems with it; quite the
      > opposite.
      > >
      > > As it turns out, my problem was that MS requires the namespace to be
      > explicitly defined wherever possible. In my final (working) WSDL, the
      > namespace of wsdl had to be set to "urn:MyApp" (I also set
      > targetNamespace to "urn:MyApp"), and each "main" section needed to be
      > fully qualified (see below for snippet). Additionally, in the
      > bindings section, each operation's input/output/etc "body" needs to
      > have the namespace fully qualified (eg < soap:body "urn:MyApp:Method"
      > ... />)
      > >
      > > Also, make sure to use UTF-8, as I sometimes had crashes when
      > talking utf-16 to SOAP::Lite from MS...
      > >
      > > the WSDL structure should thus be as follows:
      > >
      > > <?xml version="1.0" encoding="UTF-8"?>
      > > <wsdl:definitions name="MyApp" targetNamespace="urn:MyApp"
      > xmlns="urn:MyApp" xmlns:tns="urn:MyApp"
      > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      > xmlns:xsd="http://www.w3.org/2001/XMLSchema" ... >
      > > <wsdl:message name="MethodRequest">
      > > <wsdl:part name="somePart" type="xsd:string"/>
      > > ...
      > > </wsdl:message>
      > > <wsdl:portType name="MyAppPortType">
      > > <wsdl:operation name="Method">
      > > <wsdl:input message="tns:MethodRequest"/>
      > > <wsdl:output message="tns:MethodResponse"/>
      > > </wsdl:operation>
      > > ...
      > > </wsdl:portType>
      > > <wsdl:binding name="MyAppBinding" type="tns:MyAppPortType">
      > > <soap:binding style="rpc"
      > transport="http://schemas.xmlsoap.org/soap/http"/>
      > > <wsdl:operation name="Method">
      > > <soap:operation soapAction="urn:MyApp#Method"
      > style="rpc"/>
      > > <wsdl:input>
      > > <soap:body namespace="urn:MyApp" use="literal"/>
      > > </wsdl:input>
      > > <wsdl:output>
      > > <soap:body namespace="urn:MyApp" use="literal"/>
      > > </wsdl:output>
      > > </wsdl:operation>
      > > ...
      > > </wsdl:binding>
      > > <wsdl:service name="MyApp">
      > > <wsdl:port binding="tns:MyAppBinding" name="MyAppPort">
      > > <soap:address location="http://localhost:8082"/>
      > > </wsdl:port>
      > > </wsdl:service>
      > > </wsdl:definitions>
      > >
      > > One everything was all nice and fully-qualified, it seemed to work
      > fine in .NET 1.x
      > > I'm currently playing with it on the new beta of 2.0, but I think
      > it's all good there too
      > >
      > > Issac
      > >
      > > ----- Original Message -----
      > > From: Maurice McCabe
      > > To: soaplite@yahoogroups.com
      > > Sent: Friday, July 16, 2004 9:44 PM
      > > Subject: RE: [soaplite] SOAP::Lite server with .NET client -
      > SOAPAction woes
      > >
      > >
      > > I have created a .NET client that talks to a SOAP::Lite server
      > (using simple and complex types in either direction)
      > >
      > > > SOAP::Serializer::envelope: Client SOAPAction shall match
      > 'uri#method' if
      > > > present (got 'urn:MyApp#Method)
      > >
      > > -----Original Message-----
      > > From: jgr@p... [mailto:jgr@p...] On Behalf Of Klaus Guenter
      > > Sent: Friday, July 16, 2004 4:43 AM
      > > To: soaplite@yahoogroups.com
      > > Subject: Re: [soaplite] SOAP::Lite server with .NET client -
      > SOAPAction woes
      > >
      > >
      > > Hi!
      > >
      > > On Tuesday 13 July 2004 15:44, Issac Goldstand wrote:
      > > > If I explicitly declare the SOAPAction in the WSDL, I get:
      > > > SOAP::Serializer::envelope: Client SOAPAction shall match
      > 'uri#method' if
      > > > present (got 'urn:MyApp#Method)
      > > The syntax for urn: is different in .NET. AFAIR s/#/\//;
      > >
      > > But there is more to check when connecting to .NET, namely the
      > encoding style,
      > > IIRC. The MS Knowledge Base has an article that describes
      > connecting
      > > SOAP::Lite Clients to .NET Servers and vice versa.
      > >
      > > HTH,
      > > Klaus
      > > --
      > > People often find it easier to be a result of the past than a
      > cause of
      > > the future.
      > > -
      > >
      > >
      > > Yahoo! Groups Sponsor
      > > ADVERTISEMENT
      > >
      > >
      > >
      > >
      > >
      > >
      > --------------------------------------------------
      > --------------------------
      > > Yahoo! Groups Links
      > >
      > > a.. To visit your group on the web, go to:
      > > http://groups.yahoo.com/group/soaplite/
      > >
      > > b.. To unsubscribe from this group, send an email to:
      > > soaplite-unsubscribe@yahoogroups.com
      > >
      > > c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms
      > of Service.
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
    • Show all 8 messages in this topic