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

Re: .NET client Howto

Expand Messages
  • Dan Grigsby
    Hi Jay, others: This seems like the most frequently asked question, and while it s been answered in pieces, I thought maybe I could try and package up the
    Message 1 of 1 , Feb 5, 2003
    • 0 Attachment
      Hi Jay, others:

      This seems like the most frequently asked question, and while it's been
      answered in pieces, I thought maybe I could try and package up the
      solution all into one post. This isn't necessarily the best way, or the
      right way, but it works for me.

      1. I wrote a WSDL file for each service. Attached please find one
      called ListGroupMembers.wsdl. Note the segment:

      <service name="ListGroupMembersService">
      <port name="ListGroupMembersPort"
      binding="tns:ListGroupMembersSoapBinding">
      <soap:address
      location="http://webservices.mozo.com/soap"/>
      </port>
      </service>

      This will be the URL that the dotNet client asks for. This will be your
      SoapLite server -- the "proxy" in SoapLite terms.

      2. Use wsdle.exe (in the path if you run the VS.Net command prompt) to
      create a VB or VC# class for the service. Add the class to the project
      and create an instance of the class. See MSDE for help on this.

      3. When, in .net, you access the service (in this case by calling the
      BeginListGroupMember or ListGroupMembers functions in the class) .net
      puts together the request. The request will include the namespace (in
      this case http://webservices.mozo.com/ListGroupMembers) which will be
      used by SoapLite to decide which perl package to dispatch to (in this
      case the package ListGroupMembers) and will also include the function
      (in this case also called ListGroupMembers) to execute.

      4. The attached ListGroupMembers.pm file handles request. The primary
      thing to note here is that each element includes the namespace before
      the tag inside {} brackets. SoapLite will use this to qualify the SOAP
      response in the appropriate namespace. This seems to be the big thing
      that stops most .net integrations from working.

      5. The attached ListGroupMember.pm doesn't do anything with the input.
      It's just a stub. To handle the client's input I like to use the
      "byName" capabilities of SoapLite. You can grab the values of
      parameters "by name." To do this, add:

      use vars qw(@ISA);
      @ISA = qw(SOAP::Server::Parameters);

      In your package declaration, and then to grab the values inside the
      function with:

      my $SOMEPARAM = SOAP::Server::Parameters::byName(['SOMEPARAM'],@_).

      You'll do this after you shift self.

      Anyway, it works for me. Hopefully it helps.

      Best,

      Dan

      -----Original Message-----
      From: gartonehome <jgardner@...> [mailto:jgardner@...]
      Sent: Wednesday, February 05, 2003 12:49 PM
      To: dcgrigsby <dan@...>
      Subject: Re: Empty element; xsi:type="xsd:string" attribute -> .NET
      client spits up


      Just out of curiousity. Have you documented the necessary steps to
      get VB.Net client to talk to the SOAP::Lite server? I am interested
      in doing this, but do not have much time to figure it out. I have
      gotten SOAP::Lite to talk to the VB.NET server, but not the other way
      around. I am new to .NET (old to perl and java) and am not even sure
      how to get the client to see the SOAP::Lite service. If you or anyone
      else could enumerate the step I would be very grateful.

      Best Regards,

      --Jay Gardner



      --- In soaplite@yahoogroups.com, "dcgrigsby <dan@u...>" <dan@u...>
      wrote:
      > Hi,
      >
      > I'm successfully using a VB.Net client with a Soap::Lite based
      > server. I've run into a problem that doesn't appear to be one of
      > the .NET FAQs, so I thought I'd ask:
      >
      > I am trying to return an empty tag with a single attribute. I use
      >
      > return SOAP::Data
      > ->name("{http://webservices.mozo.com/LookUp}Item" => "")
      > ->attr({"{http://webservices.mozo.com/LookUp}key" => "somekey"})
      > ;
      >
      > The service returns the following element (extracted from the
      > headers):
      >
      > <namesp2:Item namesp3:key="somekey" xsi:type="xsd:string"
      > xmlns:namesp2="http://webservices.mozo.com/LookUp"/>
      >
      > .NET spits up because of the xsi:type attribute in there. I used
      > the full results to write a CGI to output the soap message,
      stripped
      > out the xsi:type attribute and it works.
      >
      > So the question is: how can I get an empty element with out having
      > a xsi:type attribute?
      >
      > Thanks,
      >
      > Dan
    Your message has been successfully submitted and would be delivered to recipients shortly.