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

Help!! Formatting SOAP::Header

Expand Messages
  • ravi0508@aim.com
    Hello All, First off, I am a SOAP newbie and I am trying to write a perl script (ActivePerl 5.8.7-815) which consumes a web service published by Remedy ARS
    Message 1 of 5 , Mar 16, 2006
    • 0 Attachment
      Hello All,
       
           First off, I am a SOAP newbie and I am trying to write a perl script (ActivePerl 5.8.7-815) which consumes a web service published by Remedy ARS 6.3.15.
       
           Remedy wants the XML to be in the following form:
      1. Messaging style = Document-Literal
      2. Only support namespaces of 2001 (http://www.w3c.org/2001/XMLSchema)
      3. The authentication information must be in the soap header section of the XML in the form of:
      <AuthenticationInfo>
      <userName>blahblahblah</userName>
      <password>blehblehbleh</password>
      </AuthenticationInfo>
      When I try to nest the AuthenticationInfo as in the example below:
      SOAP::Header->name('AuthenticationInfo' => SOAP::Header->value(
            SOAP::Header->name('userName)->value('blahblahblah'),
            SOAP::Header->name('password')->value('blehblehbleh')
      );
      I see that the XML that is actually passed to Remedy does not include the <AuthenticationInfo> tags, only the <userName> and <password> tags are included in the header section.
       
      Below is an example of the XML that is being generated by my perl script (the password is a blank password):
      ?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope xmlns:xsi="
      http://www.w3.org/2001/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/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      >
        <SOAP-ENV:Header
        >
          <userName xsi:type="xsd:string"
          >blahblahblah</userName>
          <password xsi:type="xsd:string"/></SOAP-ENV:Header>
        <SOAP-ENV:Body
        >
          <OpGet xmlns=""
          >
            <Request_ID xsi:type="xsd:int"
            >000000000000045</Request_ID></OpGet></SOAP-ENV:Body></SOAP-ENV:Envelope>
      Does anyone know why the AuthenticationInfo tags in the header are getting stripped out?  Is the above XML in Document-Literal style?  If it is not, does anyone know how to force it to be document literal?  And could that be the reason why the AuthenticationInfo tags are being stripped?
       
      I am using SOAP::Lite version 0.55 which comes with ActivePerl version 5.8.7-815.
       
      Thank you all,
      Ravi

      Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection.
    • Eric Bridger
      Have not used SOAP::Header much but in order to nest XML elements you need to point to a reference. Try: SOAP::Header- name( AuthenticationInfo =
      Message 2 of 5 , Mar 16, 2006
      • 0 Attachment
        Have not used SOAP::Header much but in order to nest XML elements you
        need to point to a reference.
        Try:

        SOAP::Header->name('AuthenticationInfo' => \SOAP::Data->value(
        SOAP::Data->name('userName)->value('blahblahblah'),
        SOAP::Data->name('password')->value('blehblehbleh')
        );

        On Thu, 2006-03-16 at 09:08, ravi0508@... wrote:
        > Hello All,
        >
        > First off, I am a SOAP newbie and I am trying to write a perl script (ActivePerl 5.8.7-815) which consumes a web service published by Remedy ARS 6.3.15.
        >
        > Remedy wants the XML to be in the following form:
        > Messaging style = Document-Literal
        > Only support namespaces of 2001 (http://www.w3c.org/2001/XMLSchema)
        > The authentication information must be in the soap header section of the XML in the form of:
        > <AuthenticationInfo>
        > <userName>blahblahblah</userName>
        > <password>blehblehbleh</password>
        > </AuthenticationInfo>
        > When I try to nest the AuthenticationInfo as in the example below:
        > SOAP::Header->name('AuthenticationInfo' => SOAP::Header->value(
        > SOAP::Header->name('userName)->value('blahblahblah'),
        > SOAP::Header->name('password')->value('blehblehbleh')
        > );
        > I see that the XML that is actually passed to Remedy does not include the <AuthenticationInfo> tags, only the <userName> and <password> tags are included in the header section.
        >
        > Below is an example of the XML that is being generated by my perl script (the password is a blank password):
        > ?xml version="1.0" encoding="UTF-8"?>
        > <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/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/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        > >
        > <SOAP-ENV:Header
        > >
        > <userName xsi:type="xsd:string"
        > >blahblahblah</userName>
        > <password xsi:type="xsd:string"/></SOAP-ENV:Header>
        > <SOAP-ENV:Body
        > >
        > <OpGet xmlns=""
        > >
        > <Request_ID xsi:type="xsd:int"
        > >000000000000045</Request_ID></OpGet></SOAP-ENV:Body></SOAP-ENV:Envelope>
        > Does anyone know why the AuthenticationInfo tags in the header are getting stripped out? Is the above XML in Document-Literal style? If it is not, does anyone know how to force it to be document literal? And could that be the reason why the AuthenticationInfo tags are being stripped?
        >
        > I am using SOAP::Lite version 0.55 which comes with ActivePerl version 5.8.7-815.
        >
        > Thank you all,
        > Ravi
        > ________________________________________________________________________
        > Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection.
      • ravi0508@aim.com
        Thank you very much Eric! That worked! I have tried all variations but I could think of but the one thing I never did was include that backslash as in your
        Message 3 of 5 , Mar 16, 2006
        • 0 Attachment
          Thank you very much Eric!  That worked!
           
          I have tried all variations but I could think of but the one thing I never did was include that backslash as in your example below.  Including it made my code work.  What does the backslash do in this case?  Does it just escapes the rest of the stuff?
           
          Ravi 
           
          -----Original Message-----
          From: Eric Bridger <eric@...>
          To: ravi0508@...
          Cc: SoapLite List <soaplite@yahoogroups.com>
          Sent: 16 Mar 2006 10:14:32 -0500
          Subject: Re: [soaplite] Help!! Formatting SOAP::Header

          Have not used SOAP::Header much but in order to nest XML elements you
          need to point to a reference.
          Try:
          
          SOAP::Header->name('AuthenticationInfo' => \SOAP::Data->value(
                 SOAP::Data->name('userName)->value('blahblahblah'),
                 SOAP::Data->name('password')->value('blehblehbleh')
           );
          
          
          On Thu, 2006-03-16 at 09:08, ravi0508@... wrote: > Hello All, > > First off, I am a SOAP newbie and I am trying to write a perl script (ActivePerl 5.8.7-815) which consumes a web service published by Remedy ARS 6.3.15. > > Remedy wants the XML to be in the following form: > Messaging style = Document-Literal > Only support namespaces of 2001 (http://www.w3c.org/2001/XMLSchema) > The authentication information must be in the soap header section of the XML in the form of: > <AuthenticationInfo> > <userName>blahblahblah</userName> > <password>blehblehbleh</password> > </AuthenticationInfo> > When I try to nest the AuthenticationInfo as in the example below: > SOAP::Header->name('AuthenticationInfo' => SOAP::Header->value( > SOAP::Header->name('userName)->value('blahblahblah'), > SOAP::Header->name('password')->value('blehblehbleh') > ); > I see that the XML that is actually passed to Remedy does not include the <AuthenticationInfo> tags, only the <userName> and <password> tags are included in the header section. > > Below is an example of the XML that is being generated by my perl script (the password is a blank password): > ?xml version="1.0" encoding="UTF-8"?> > <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/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/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > > > <SOAP-ENV:Header > > > <userName xsi:type="xsd:string" > >blahblahblah</userName> > <password xsi:type="xsd:string"/></SOAP-ENV:Header> > <SOAP-ENV:Body > > > <OpGet xmlns="" > > > <Request_ID xsi:type="xsd:int" > >000000000000045</Request_ID></OpGet></SOAP-ENV:Body></SOAP-ENV:Envelope> > Does anyone know why the AuthenticationInfo tags in the header are getting stripped out? Is the above XML in Document-Literal style? If it is not, does anyone know how to force it to be document literal? And could that be the reason why the AuthenticationInfo tags are being stripped? > > I am using SOAP::Lite version 0.55 which comes with ActivePerl version 5.8.7-815. > > Thank you all, > Ravi > ________________________________________________________________________ > Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection.

          Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection.
        • Eric Bridger
          The backslash (a reference to a SOAP::Data or Header object) creates nested XML in your SOAP message as explained here:
          Message 4 of 5 , Mar 16, 2006
          • 0 Attachment
            The backslash (a reference to a SOAP::Data or Header object) creates
            nested XML in your SOAP message as explained here:

            http://www.majordojo.com/archives/2003_04.html#000008


            On Thu, 2006-03-16 at 12:18, ravi0508@... wrote:
            > Thank you very much Eric! That worked!
            >
            > I have tried all variations but I could think of but the one thing I never did was include that backslash as in your example below. Including it made my code work. What does the backslash do in this case? Does it just escapes the rest of the stuff?
            >
            > Ravi
            >
            > -----Original Message-----
            > From: Eric Bridger <eric@...>
            > To: ravi0508@...
            > Cc: SoapLite List <soaplite@yahoogroups.com>
            > Sent: 16 Mar 2006 10:14:32 -0500
            > Subject: Re: [soaplite] Help!! Formatting SOAP::Header
            >
            >
            > Have not used SOAP::Header much but in order to nest XML elements you
            > need to point to a reference.
            > Try:
            >
            > SOAP::Header->name('AuthenticationInfo' => \SOAP::Data->value(
            > SOAP::Data->name('userName)->value('blahblahblah'),
            > SOAP::Data->name('password')->value('blehblehbleh')
            > );
            >
            > On Thu, 2006-03-16 at 09:08, ravi0508@... wrote:
            > > Hello All,
            > >
            > > First off, I am a SOAP newbie and I am trying to write a perl script
            > (ActivePerl 5.8.7-815) which consumes a web service published by Remedy ARS
            > 6.3.15.
            > >
            > > Remedy wants the XML to be in the following form:
            > > Messaging style = Document-Literal
            > > Only support namespaces of 2001 (http://www.w3c.org/2001/XMLSchema)
            > > The authentication information must be in the soap header section of the XML
            > in the form of:
            > > <AuthenticationInfo>
            > > <userName>blahblahblah</userName>
            > > <password>blehblehbleh</password>
            > > </AuthenticationInfo>
            > > When I try to nest the AuthenticationInfo as in the example below:
            > > SOAP::Header->name('AuthenticationInfo' => SOAP::Header->value(
            > > SOAP::Header->name('userName)->value('blahblahblah'),
            > > SOAP::Header->name('password')->value('blehblehbleh')
            > > );
            > > I see that the XML that is actually passed to Remedy does not include the
            > <AuthenticationInfo> tags, only the <userName> and <password> tags are included
            > in the header section.
            > >
            > > Below is an example of the XML that is being generated by my perl script (the
            > password is a blank password):
            > > ?xml version="1.0" encoding="UTF-8"?>
            > > <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/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/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
            > > >
            > > <SOAP-ENV:Header
            > > >
            > > <userName xsi:type="xsd:string"
            > > >blahblahblah</userName>
            > > <password xsi:type="xsd:string"/></SOAP-ENV:Header>
            > > <SOAP-ENV:Body
            > > >
            > > <OpGet xmlns=""
            > > >
            > > <Request_ID xsi:type="xsd:int"
            > > >000000000000045</Request_ID></OpGet></SOAP-ENV:Body></SOAP-ENV:Envelope>
            > > Does anyone know why the AuthenticationInfo tags in the header are getting
            > stripped out? Is the above XML in Document-Literal style? If it is not, does
            > anyone know how to force it to be document literal? And could that be the
            > reason why the AuthenticationInfo tags are being stripped?
            > >
            > > I am using SOAP::Lite version 0.55 which comes with ActivePerl version
            > 5.8.7-815.
            > >
            > > Thank you all,
            > > Ravi
            > > ________________________________________________________________________
            > > Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading
            > spam and email virus protection.
            > ________________________________________________________________________
            > Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection.
          • Ted Zeng
            Hi, A dumb question: I tried to install SOAP::Lite On a OS X 10.4.5 machine. The installation process says it needs XML::Parser, Which in turn says it needs
            Message 5 of 5 , Mar 16, 2006
            • 0 Attachment
              A question on installating expat Hi,

              A dumb question:

              I tried to install SOAP::Lite

              On a OS X 10.4.5 machine.

              The installation process says it needs XML::Parser,
              Which in turn says it needs expat.


              I downloaded the Expat package.
              I read the README:

              Expat is no longer included with this package. It must now be already
              installed on your system as a library. You may download the library
              version of expat from http://sourceforge.net/projects/expat/. After
              downloading, expat must be configured (an automatic script does this),
              built and installed.

              My question is :
              Where should expat be in my machine? How could I figure out?


              Ted Zeng
            Your message has been successfully submitted and would be delivered to recipients shortly.