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

newbie question... I think

Expand Messages
  • John Brahy
    I m trying to generate a packet in this form: POST /SMSAPI HTTP/1.1 Host: testing.ad2.com Content-Type: text/xml; charset=utf-8 Content-Length: 597 SOAPAction:
    Message 1 of 5 , Mar 29, 2006
    • 0 Attachment
      I'm trying to generate a packet in this form:


      POST /SMSAPI HTTP/1.1
      Host: testing.ad2.com
      Content-Type: text/xml; charset=utf-8
      Content-Length: 597
      SOAPAction: "http://testing.ad2.com/SMSAPI/GetReplyCodeSets"

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Header>
      <Secure xmlns="http://testing.ad2.com/SMSAPI">
      <UserId>username</UserId>
      <Password>password</Password>
      </Secure>
      </soap:Header>
      <soap:Body>
      <GetReplyCodeSets xmlns="http://testing.ad2.com/SMSAPI">
      <Input>string</Input>
      </GetReplyCodeSets>
      </soap:Body>
      </soap:Envelope>


      I've tried a million different things, I've read the man pages for
      SOAP::Lite but I'm not able to find success.

      Is there anyone that can give me a pointer for this?

      Thanks,

      John
    • Jeff
      Getting the namespaces right is a pain, but something like what s below will get you pretty close. Hope this helps, Jeff use SOAP::Lite +trace = [qw/ debug
      Message 2 of 5 , Mar 29, 2006
      • 0 Attachment
        Getting the namespaces right is a pain, but something like what's below
        will get you pretty close. Hope this helps,

        Jeff




        use SOAP::Lite +trace => [qw/ debug method fault /]; #global debug for
        SOAP calls

        my $soap = SOAP::Lite->new
        ->proxy(
        'http://intadsrvcs-001.klsoft.com:8080/services/AccountService' )
        ->default_ns( 'http://testing.ad2.com/SMSAPI' )
        ;

        my $som = $soap->GetReplyCodeSets( args(), headers() );

        sub args {
        return SOAP::Data->name( 'Input' )
        ->value( 'string' );
        }

        sub headers {
        return ( SOAP::Header->name( 'Secure' )
        ->value( [ SOAP::Header->name( 'UserId' )
        ->value( 'username' )
        ,
        SOAP::Header->name( 'Password' )
        ->value( 'password' )
        ,
        ]
        )
        )
        }



        output:

        <?xml version="1.0" encoding="UTF-8"?>
        <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
        <Secure soapenc:arrayType="xsd:string[2]" xsi:type="soapenc:Array">
        <UserId xsi:type="xsd:string">username</UserId>
        <Password xsi:type="xsd:string">password</Password>
        </Secure>
        </soap:Header>
        <soap:Body>
        <GetReplyCodeSets xmlns="http://testing.ad2.com/SMSAPI">
        <Input xsi:type="xsd:string">string</Input>
        </GetReplyCodeSets>
        </soap:Body>
        </soap:Envelope>



        John Brahy wrote:
        > I'm trying to generate a packet in this form:
        >
        >
        > POST /SMSAPI HTTP/1.1
        > Host: testing.ad2.com
        > Content-Type: text/xml; charset=utf-8
        > Content-Length: 597
        > SOAPAction: "http://testing.ad2.com/SMSAPI/GetReplyCodeSets"
        >
        > <?xml version="1.0" encoding="utf-8"?>
        > <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        > <soap:Header>
        > <Secure xmlns="http://testing.ad2.com/SMSAPI">
        > <UserId>username</UserId>
        > <Password>password</Password>
        > </Secure>
        > </soap:Header>
        > <soap:Body>
        > <GetReplyCodeSets xmlns="http://testing.ad2.com/SMSAPI">
        > <Input>string</Input>
        > </GetReplyCodeSets>
        > </soap:Body>
        > </soap:Envelope>
        >
        >
        > I've tried a million different things, I've read the man pages for
        > SOAP::Lite but I'm not able to find success.
        >
        > Is there anyone that can give me a pointer for this?
        >
        > Thanks,
        >
        > John
      • John Brahy
        I do not get any header information when I run this, could anyone verify that it works on other operating systems? use SOAP::Lite +trace = [qw/ debug method
        Message 3 of 5 , Mar 30, 2006
        • 0 Attachment
          I do not get any header information when I run this, could anyone
          verify that it works on other operating systems?


          use SOAP::Lite +trace => [qw/ debug method fault /]; #global debug for
          SOAP calls

          my $soap = SOAP::Lite->new
          ->proxy('http://scandalz.net:8080/services/AccountService' )
          ->default_ns( 'http://testing.ad2.com/SMSAPI' );

          my $som = $soap->GetReplyCodeSets( args(), headers() );

          sub args {
          return SOAP::Data->name( 'Input' )
          ->value( 'string' );
          }

          sub headers {
          return ( SOAP::Header->name( 'Secure' )
          ->value( [ SOAP::Header->name( 'UserId' )
          ->value( 'username' ),
          SOAP::Header->name( 'Password' )
          ->value( 'password' ),
          ]
          )
          )
          }

          -------------------------------------
          I am trying to generate this:

          POST /SMSAPI HTTP/1.1
          Host: testing.ad2.com
          Content-Type: text/xml; charset=utf-8
          Content-Length: 597
          SOAPAction: "http://testing.ad2.com/SMSAPI/GetReplyCodeSets"

          <?xml version="1.0" encoding="utf-8"?>
          <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
          <soap:Header>
          <Secure xmlns="http://testing.ad2.com/SMSAPI">
          <UserId>username</UserId>
          <Password>password</Password>
          </Secure>
          </soap:Header>
          <soap:Body>
          <GetReplyCodeSets xmlns="http://testing.ad2.com/SMSAPI">
          <Input>string</Input>
          </GetReplyCodeSets>
          </soap:Body>
          </soap:Envelope>
        • Jeff Lavallee
          John - As I suggested in a private email, the problem is likely due to the version of SOAP::Lite you re using. default_ns is not a valid method in versions
          Message 4 of 5 , Mar 30, 2006
          • 0 Attachment
            John - As I suggested in a private email, the problem is likely due to
            the version of SOAP::Lite you're using. default_ns is not a valid
            method in versions prior to 0.66 (I think), so the default_ns call
            results in a call to the SOAP server instead of setting the default
            namespace.

            I have tested this on an OS X box and a debian box, and with
            SOAP::Lite-0.60 I get the output you described, and with 0.66 I get the
            output below.

            If you cannot use a more recent version of SOAP::Lite, look at the
            use_prefix method.

            Also please note that your OS version is one of the last things you
            should expect to cause the type of issue you're describing.

            Hope this helps,

            Jeff




            output displaying default_ns issue:

            <?xml version="1.0" encoding="UTF-8"?>
            <SOAP-ENV:Envelope
            xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
            xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
            xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
            xmlns:xsd="http://www.w3.org/1999/XMLSchema"
            SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <SOAP-ENV:Body>
            <default_ns>
            <c-gensym3
            xsi:type="xsd:string">http://testing.ad2.com/SMSAPI</c-gensym3>
            </default_ns>
            </SOAP-ENV:Body>
            </SOAP-ENV:Envelope>





            --- In


            John Brahy wrote:
            > I do not get any header information when I run this, could anyone
            > verify that it works on other operating systems?
            >
            >
            > use SOAP::Lite +trace => [qw/ debug method fault /]; #global debug for
            > SOAP calls
            >
            > my $soap = SOAP::Lite->new
            > ->proxy('http://scandalz.net:8080/services/AccountService' )
            > ->default_ns( 'http://testing.ad2.com/SMSAPI' );
            >
            > my $som = $soap->GetReplyCodeSets( args(), headers() );
            >
            > sub args {
            > return SOAP::Data->name( 'Input' )
            > ->value( 'string' );
            > }
            >
            > sub headers {
            > return ( SOAP::Header->name( 'Secure' )
            > ->value( [ SOAP::Header->name( 'UserId' )
            > ->value( 'username' ),
            > SOAP::Header->name( 'Password' )
            > ->value( 'password' ),
            > ]
            > )
            > )
            > }
          • John Brahy
            I agree with you that the os version is the last thing that should matter but the reason that I included it with my post is because my version of SOAP::Lite is
            Message 5 of 5 , Apr 6, 2006
            • 0 Attachment
              I agree with you that the os version is the last thing
              that should matter but the reason that I included it
              with my post is because my version of SOAP::Lite is
              part of the OpenBSD ports tree. So it was touched by
              people in the OpenBSD community, so it's not a stock
              version of SOAP::Lite.

              just fyi for the future,

              John

              --- Jeff Lavallee <jeff@...> wrote:

              >
              > John - As I suggested in a private email, the
              > problem is likely due to
              > the version of SOAP::Lite you're using. default_ns
              > is not a valid
              > method in versions prior to 0.66 (I think), so the
              > default_ns call
              > results in a call to the SOAP server instead of
              > setting the default
              > namespace.
              >
              > I have tested this on an OS X box and a debian box,
              > and with
              > SOAP::Lite-0.60 I get the output you described, and
              > with 0.66 I get the
              > output below.
              >
              > If you cannot use a more recent version of
              > SOAP::Lite, look at the
              > use_prefix method.
              >
              > Also please note that your OS version is one of the
              > last things you
              > should expect to cause the type of issue you're
              > describing.
              >
              > Hope this helps,
              >
              > Jeff
              >
              >
              >
              >
              > output displaying default_ns issue:
              >
              > <?xml version="1.0" encoding="UTF-8"?>
              > <SOAP-ENV:Envelope
              >
              xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
              >
              xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
              >
              xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
              > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
              >
              SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
              > <SOAP-ENV:Body>
              > <default_ns>
              > <c-gensym3
              >
              xsi:type="xsd:string">http://testing.ad2.com/SMSAPI</c-gensym3>
              > </default_ns>
              > </SOAP-ENV:Body>
              > </SOAP-ENV:Envelope>
              >
              >
              >
              >
              >
              > --- In
              >
              >
              > John Brahy wrote:
              > > I do not get any header information when I run
              > this, could anyone
              > > verify that it works on other operating systems?
              > >
              > >
              > > use SOAP::Lite +trace => [qw/ debug method fault
              > /]; #global debug for
              > > SOAP calls
              > >
              > > my $soap = SOAP::Lite->new
              > >
              >
              ->proxy('http://scandalz.net:8080/services/AccountService'
              > )
              > > ->default_ns(
              > 'http://testing.ad2.com/SMSAPI' );
              > >
              > > my $som = $soap->GetReplyCodeSets( args(),
              > headers() );
              > >
              > > sub args {
              > > return SOAP::Data->name( 'Input' )
              > > ->value( 'string' );
              > > }
              > >
              > > sub headers {
              > > return ( SOAP::Header->name( 'Secure' )
              > > ->value( [ SOAP::Header->name(
              > 'UserId' )
              > > ->value( 'username' ),
              > > SOAP::Header->name(
              > 'Password' )
              > > ->value( 'password' ),
              > > ]
              > > )
              > > )
              > > }
              >
              >

              __________________________________________________
              Do You Yahoo!?
              Tired of spam? Yahoo! Mail has the best spam protection around
              http://mail.yahoo.com
            Your message has been successfully submitted and would be delivered to recipients shortly.