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

Re: [soaplite] Re: Element 'xmlProductString' can't be allowed in valid XML message. Died

Expand Messages
  • Duncan Cameron
    ... version= 1.0 encoding= UTF-8 ?
    Message 1 of 10 , Mar 14, 2002
      On 2002-03-15 davidthewatson wrote:
      >--- In soaplite@y..., Duncan Cameron <dcameron@b...> wrote:
      >> Not sure what you mean by this - 'killed on the wire'.
      >
      >I meant loosely, "Horked up in the SOAP protocol negotiation." Sorry.
      >
      >> Have you run with trace or debug to see the content of the SOAP
      >> envelope?
      >> use SOAP::Lite +trace => qw(all);
      >
      >No, I hadn't but with your instructions I did. Here's the output
      >(LONG, sorry again):
      >
      >SOAPAction: "validateImport"
      >
      ><?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-
      >ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-
      >ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      >xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      >xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      >xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-
      >ENV:Body><namesp2:validateImport
      >xmlns:namesp2="http://tempuri.org/net.metalsite.external.Product"><ses
      >sionId xsi:type="xsd:string">8DEC2983-2EEB-93BB-D37C-
      >A228897DEC9C</sessionId><ProductString xsi:type="xsd:string">
      <?xml >version="1.0" encoding="UTF-8"?><inventory><product
      =======
      . snipped ...
      Well, you've actually got XML embedded as the content of your ProductString
      element, including an XML declaration, which makes the SOAP envelope
      badly-formed.

      I don't understand how SOAP::Lite did this as I thought it automatically
      escaped the <>& characters.
      Try getting rid of the document declaration (the <?xml ..> bit)
      Also, your server should have been complaining about the badly-formed
      envelope.
      >
      >> Also, looking at your original email :
      >>
      >> my $product = 'http://192.168.0.170:8080/mws/urn:Product.wsdl';
      >> my $msg = SOAP::Lite->service($product)
      >> ->validate('somesessionid',$long_line, 'TEXT');
      >>
      >> Are you sure that $product is being assigned correctly?
      >> SOAP::Lite is fairly restricted in the WSDL that it can handle.
      >
      >Not sure what you mean by, "assigned correctly". I don't get any WSDL
      >parse errors or anything like that. I do wonder whether the type
      >negotiation and coercion is correct but I'm not sure I can make an
      >informed opinion since I'd need to read the book on perl first. Sigh.

      Sorry, misread the code. I thought it was the result of a method call.

      Regards,
      Duncan Cameron
    • Paul Kulchenko
      Hi, Duncan! ... That s correct. ... SOAP::Lite doesn t do encoding and doesn t validate XML fragments you insert using xml pseudo-type. If it s not the case
      Message 2 of 10 , Mar 18, 2002
        Hi, Duncan!

        > Well, you've actually got XML embedded as the content of your
        > ProductString
        > element, including an XML declaration, which makes the SOAP
        > envelope badly-formed.
        That's correct.

        > I don't understand how SOAP::Lite did this as I thought it
        > automatically escaped the <>& characters.
        SOAP::Lite doesn't do encoding and doesn't validate XML fragments you
        insert using 'xml' pseudo-type. If it's not the case I would like to
        see the client code.

        > Try getting rid of the document declaration (the <?xml ..> bit)
        > Also, your server should have been complaining about the
        > badly-formed envelope.
        Yes. XML declarations are not allowed inside XML messages as far as I
        remember. Processing instructions are not allowed according to SOAP
        spec, but many toolkits just ignore them, but not fail.

        Best wishes, Paul.

        --- Duncan Cameron <dcameron@...> wrote:
        > On 2002-03-15 davidthewatson wrote:
        > >--- In soaplite@y..., Duncan Cameron <dcameron@b...> wrote:
        > >> Not sure what you mean by this - 'killed on the wire'.
        > >
        > >I meant loosely, "Horked up in the SOAP protocol negotiation."
        > Sorry.
        > >
        > >> Have you run with trace or debug to see the content of the SOAP
        > >> envelope?
        > >> use SOAP::Lite +trace => qw(all);
        > >
        > >No, I hadn't but with your instructions I did. Here's the output
        > >(LONG, sorry again):
        > >
        > >SOAPAction: "validateImport"
        > >
        > ><?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
        > xmlns:SOAP-
        > >ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-
        > >ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        > >xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        > >xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
        > >xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-
        > >ENV:Body><namesp2:validateImport
        >
        >xmlns:namesp2="http://tempuri.org/net.metalsite.external.Product"><ses
        > >sionId xsi:type="xsd:string">8DEC2983-2EEB-93BB-D37C-
        > >A228897DEC9C</sessionId><ProductString xsi:type="xsd:string">
        > <?xml >version="1.0" encoding="UTF-8"?><inventory><product
        > =======
        > . snipped ...
        > Well, you've actually got XML embedded as the content of your
        > ProductString
        > element, including an XML declaration, which makes the SOAP
        > envelope
        > badly-formed.
        >
        > I don't understand how SOAP::Lite did this as I thought it
        > automatically
        > escaped the <>& characters.
        > Try getting rid of the document declaration (the <?xml ..> bit)
        > Also, your server should have been complaining about the
        > badly-formed
        > envelope.
        > >
        > >> Also, looking at your original email :
        > >>
        > >> my $product = 'http://192.168.0.170:8080/mws/urn:Product.wsdl';
        > >> my $msg = SOAP::Lite->service($product)
        > >> ->validate('somesessionid',$long_line, 'TEXT');
        > >>
        > >> Are you sure that $product is being assigned correctly?
        > >> SOAP::Lite is fairly restricted in the WSDL that it can handle.
        > >
        > >Not sure what you mean by, "assigned correctly". I don't get any
        > WSDL
        > >parse errors or anything like that. I do wonder whether the type
        > >negotiation and coercion is correct but I'm not sure I can make an
        >
        > >informed opinion since I'd need to read the book on perl first.
        > Sigh.
        >
        > Sorry, misread the code. I thought it was the result of a method
        > call.
        >
        > Regards,
        > Duncan Cameron
        >
        >
        >
        >
        >
        >
        > ------------------------ 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!?
        Yahoo! Sports - live college hoops coverage
        http://sports.yahoo.com/
      • Paul Kulchenko
        Hi, David! ... Just a follow-up. You can force encoding of your XML fragment with this code: my $product = http://192.168.0.170:8080/mws/urn:Product.wsdl ; my
        Message 3 of 10 , Mar 18, 2002
          Hi, David!

          --- Duncan Cameron <dcameron@...> wrote:
          > I don't understand how SOAP::Lite did this as I thought it
          > automatically escaped the <>& characters.

          Just a follow-up. You can force encoding of your XML fragment with
          this code:

          my $product = 'http://192.168.0.170:8080/mws/urn:Product.wsdl';
          my $msg = SOAP::Lite->service($product)
          ->validate('somesessionid',
          SOAP::Data->type(string => $long_line),
          'TEXT');

          > >> SOAP::Lite is fairly restricted in the WSDL that it can handle.
          That's the main reason for this effect. Will be fixed.

          Best wishes, Paul.

          __________________________________________________
          Do You Yahoo!?
          Yahoo! Sports - live college hoops coverage
          http://sports.yahoo.com/
        • Paul Kulchenko
          Hi, David! ... That s still a mystery for me. You should get this message ONLY if wsdl file specifies xmlProductString as an element name (which is
          Message 4 of 10 , Mar 18, 2002
            Hi, David!

            > I have deleted a lot of extraneous code for brevity. SOAP::Lite
            > generates this message
            >
            > Element 'xmlProductString' can't be allowed in valid XML message.
            > Died
            That's still a mystery for me. You should get this message ONLY if
            wsdl file specifies "xmlProductString" as an element name (which is
            incorrect), but I can't access the file to verify that. Let me know
            if you see some other reason.

            Best wishes, Paul.

            --- davidthewatson <davidthewatson@...> wrote:
            > I have the following code:
            >
            > use SOAP::Lite;
            > $file = 'data.xml' ;
            > open(INFO, "<$file" ) ;
            > @lines = <INFO> ;
            > close(INFO) ;
            > $long_line = join("\n", @lines);
            > my $product = 'http://192.168.0.170:8080/mws/urn:Product.wsdl';
            > my $msg = SOAP::Lite->service($product)->validate
            > ('somesessionid',$long_line, 'TEXT');
            >
            > I have deleted a lot of extraneous code for brevity. SOAP::Lite
            > generates this message
            >
            > Element 'xmlProductString' can't be allowed in valid XML message.
            > Died
            >
            > when making the validate call. The server is running Glue 2.1 from
            > the mind electric. The second parameter where $long_line is being
            > passed is a SOAP string which has embedded XML in it. This works
            > with
            > a variety of clients including java, dotnet(C#), vbscript, etc. I'm
            >
            > not sure why the SOAP::Lite parser doesn't like the embedded XML
            > string. I assume there's a parsing issue with the tags but I'm not
            > sure if it can be escaped or whether there's a call I can make to
            > tell it to treat the string specially.
            >
            > Thanks,
            > David
            >
            >
            > ------------------------ 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!?
            Yahoo! Sports - live college hoops coverage
            http://sports.yahoo.com/
          • davidthewatson
            ... Hi Paul: I tried your suggestion above today. It doesn t work either. The end result is that the server receives a null string. I ve also tried removing
            Message 5 of 10 , Mar 21, 2002
              --- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
              > Just a follow-up. You can force encoding of your XML fragment with
              > this code:
              >
              > my $product = 'http://192.168.0.170:8080/mws/urn:Product.wsdl';
              > my $msg = SOAP::Lite->service($product)
              > ->validate('somesessionid',
              > SOAP::Data->type(string => $long_line),
              > 'TEXT');

              Hi Paul:

              I tried your suggestion above today. It doesn't work either. The end
              result is that the server receives a null string. I've also tried
              removing the XML declaration from the string being sent. That doesn't
              solve it either. I also tried a bit of replacement on the (typically
              escaped) characters. That doesn't seem to do it either. Not sure if
              there's anything else I should try.

              Thanks for all of your help.

              -david
            Your message has been successfully submitted and would be delivered to recipients shortly.