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

Handling a WSDL file with multiple portType/BindingType/Service

Expand Messages
  • Weidong Wang
    SOAP::Lite has simple way of dealing with WSDL file: $soap = SOAP::Lite- service($wsdlfile); $result = $soap- funccall(); But what if the wsdl file contains
    Message 1 of 6 , Oct 2, 2002
    • 0 Attachment
      SOAP::Lite has simple way of dealing with WSDL file:

      $soap = SOAP::Lite->service($wsdlfile);
      $result = $soap->funccall();

      But what if the wsdl file contains multiple ports, bindings, and services? Will the above simple approach still work? Will it know, based on the funccall names, to use diferent service? What if the funccall name is the same?

      Just wondering, as I see some WSDL like this.

      Weidong
    • Paul Kulchenko
      Hi Weidong, ... it should ;). ... service() method accepts optional service and port names which allows you to choose the right method: $soap =
      Message 2 of 6 , Oct 2, 2002
      • 0 Attachment
        Hi Weidong,

        > services? Will the above simple approach still work? Will it know,
        it should ;).

        > based on the funccall names, to use diferent service? What if the
        > funccall name is the same?
        service() method accepts optional service and port names which allows
        you to choose the right method:

        $soap = SOAP::Lite->service($wsdlfile [, $service [, $port]]);

        The current interface doesn't allow you to get the list of available
        methods though. There was some work done around Simple Web Services
        API (http://aspn.activestate.com/ASPN/WebServices/SWSAPI) and
        ActiveState even created reference implementation for Perl
        (ftp://ftp.activestate.com/WebService/Perl/WebService-0.01.tar.gz),
        but I'm not sure what's the current state of the effort.

        Best wishes, Paul.

        --- Weidong Wang <wwang@...> wrote:
        > SOAP::Lite has simple way of dealing with WSDL file:
        >
        > $soap = SOAP::Lite->service($wsdlfile);
        > $result = $soap->funccall();
        >
        > But what if the wsdl file contains multiple ports, bindings, and
        > services? Will the above simple approach still work? Will it know,
        > based on the funccall names, to use diferent service? What if the
        > funccall name is the same?
        >
        > Just wondering, as I see some WSDL like this.
        >
        > Weidong
        >
        >
        > ------------------------ Yahoo! Groups Sponsor
        >
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
        >


        __________________________________________________
        Do you Yahoo!?
        New DSL Internet Access from SBC & Yahoo!
        http://sbc.yahoo.com
      • Weidong Wang
        ... Paul, thanks for the reply. I finally got to the point that I will need to deal with such WSDLs. I wonder what I need to do when dealing with tModel WSDL
        Message 3 of 6 , Oct 15, 2002
        • 0 Attachment
          > > based on the funccall names, to use diferent service? What if the
          > > funccall name is the same?
          > service() method accepts optional service and port names which allows
          > you to choose the right method:
          >
          > $soap = SOAP::Lite->service($wsdlfile [, $service [, $port]]);

          Paul, thanks for the reply. I finally got to the point that I will need to deal with such WSDLs.

          I wonder what I need to do when dealing with tModel WSDL file with multiple port/bindings. Such WSDL files do not contain the <service> section. Can I leave the $service part empty and jus tuse the $port, like:

          $soap = SOAP::Lite->service($wsdlfile, '', $myPortTypeName);

          Thanks.

          Weidong
        • Paul Kulchenko
          Hi Weidong, ... Yes, you should be able to. Regardless of the presence of section - service($wsdl, , $myPortTypeName) will allow you to choose
          Message 4 of 6 , Oct 17, 2002
          • 0 Attachment
            Hi Weidong,

            > I wonder what I need to do when dealing with tModel WSDL file with
            > multiple port/bindings. Such WSDL files do not contain the
            > <service> section. Can I leave the $service part empty and jus tuse
            > the $port, like:
            >
            > $soap = SOAP::Lite->service($wsdlfile, '', $myPortTypeName);
            Yes, you should be able to. Regardless of the presence of <service>
            section ->service($wsdl, '', $myPortTypeName) will allow you to
            choose specific portType from the list of all available portTypes (it
            will filter based on service name only if it's present and not
            empty). It's actually in the code, but I haven't tested this piece
            with multiple portTypes yet. Do you have a WSDL file for me to try?

            Best wishes, Paul.

            --- Weidong Wang <wwang@...> wrote:
            > > > based on the funccall names, to use diferent service? What if
            > the
            > > > funccall name is the same?
            > > service() method accepts optional service and port names which
            > allows
            > > you to choose the right method:
            > >
            > > $soap = SOAP::Lite->service($wsdlfile [, $service [, $port]]);
            >
            > Paul, thanks for the reply. I finally got to the point that I will
            > need to deal with such WSDLs.
            >
            > I wonder what I need to do when dealing with tModel WSDL file with
            > multiple port/bindings. Such WSDL files do not contain the
            > <service> section. Can I leave the $service part empty and jus tuse
            > the $port, like:
            >
            > $soap = SOAP::Lite->service($wsdlfile, '', $myPortTypeName);
            >
            > Thanks.
            >
            > Weidong
            >


            __________________________________________________
            Do you Yahoo!?
            Faith Hill - Exclusive Performances, Videos & More
            http://faith.yahoo.com
          • Weidong Wang
            Paul, I am happy to report that it works fine. We have WSDLs that defines multiple port types/services, and for each new call, the endpoint is different. What
            Message 5 of 6 , Oct 18, 2002
            • 0 Attachment
              Paul, I am happy to report that it works fine.

              We have WSDLs that defines multiple port types/services, and for each new call, the endpoint is different. What I did is to read in such WSDL file, get rid of the <service> section on the fly and then call service($wsdl), possibly to pass in the port type name in the case when there are multiple port types in the WSDL file.

              Then when I need to actually make a call, I can set the endpoint by doing $soap->proxy($newEndpoint) and it all works fine.

              The only minor problem I noticed is, when I do the above initialization for multiple WSDL files, say w1, w2, w3, w4, then I make a call to func1 in w1, the soapAction from W4 is used in the envelope. It is not a problem as our server does not use soapAction for anything. Just not looking good. Any way to get around this? not important, though.

              Weidong


              ----- Original Message -----
              From: "Paul Kulchenko" <paulclinger@...>
              To: "Weidong Wang" <wwang@...>; <soaplite@yahoogroups.com>
              Sent: Friday, October 18, 2002 2:08 AM
              Subject: Re: [soaplite] Handling a WSDL file with multiple portType/BindingType/Service


              > Hi Weidong,
              >
              > > I wonder what I need to do when dealing with tModel WSDL file with
              > > multiple port/bindings. Such WSDL files do not contain the
              > > <service> section. Can I leave the $service part empty and jus tuse
              > > the $port, like:
              > >
              > > $soap = SOAP::Lite->service($wsdlfile, '', $myPortTypeName);
              > Yes, you should be able to. Regardless of the presence of <service>
              > section ->service($wsdl, '', $myPortTypeName) will allow you to
              > choose specific portType from the list of all available portTypes (it
              > will filter based on service name only if it's present and not
              > empty). It's actually in the code, but I haven't tested this piece
              > with multiple portTypes yet. Do you have a WSDL file for me to try?
              >
              > Best wishes, Paul.
              >
              > --- Weidong Wang <wwang@...> wrote:
              > > > > based on the funccall names, to use diferent service? What if
              > > the
              > > > > funccall name is the same?
              > > > service() method accepts optional service and port names which
              > > allows
              > > > you to choose the right method:
              > > >
              > > > $soap = SOAP::Lite->service($wsdlfile [, $service [, $port]]);
              > >
              > > Paul, thanks for the reply. I finally got to the point that I will
              > > need to deal with such WSDLs.
              > >
              > > I wonder what I need to do when dealing with tModel WSDL file with
              > > multiple port/bindings. Such WSDL files do not contain the
              > > <service> section. Can I leave the $service part empty and jus tuse
              > > the $port, like:
              > >
              > > $soap = SOAP::Lite->service($wsdlfile, '', $myPortTypeName);
              > >
              > > Thanks.
              > >
              > > Weidong
            • Paul Kulchenko
              Hi Weidong, ... > The only minor problem I noticed is, when I do the above > initialization for multiple WSDL files, say w1, w2, w3, w4, then I > make
              Message 6 of 6 , Oct 18, 2002
              • 0 Attachment
                Hi Weidong,

                --- Weidong Wang <wwang@...> wrote:
                > The only minor problem I noticed is, when I do the above
                > initialization for multiple WSDL files, say w1, w2, w3, w4, then
                I
                > make a call to func1 in w1, the soapAction from W4 is used in
                the
                > envelope. It is not a problem as our server does not use
                soapAction
                > for anything. Just not looking good. Any way to get around this?
                > not important, though.
                Interesting. Shouldn't happen though. What you can do is to assign
                different service names to those services (just provide non-empty
                service name in your service() call; it's possible to do because if
                there is no <service> section in the WSDL document, you can
                assign any service name you want and it will become a name of the
                generated package), which will effectively put all method-specific
                information in different spaces.

                (looking at the code I think it WILL help in your code, but I would
                like to call it feature for now rather than a bug ;). Could you try
                it?)

                I would like to try it with your WSDL myself. Could you send it to me
                off-list? Thanks.

                Best wishes, Paul.

                __________________________________________________
                Do you Yahoo!?
                Faith Hill - Exclusive Performances, Videos & More
                http://faith.yahoo.com
              Your message has been successfully submitted and would be delivered to recipients shortly.