Hi

I have the code below to make a webservice call

use strict; use warnings; use SOAP::Lite 'trace', 'debug'; my $xmltest = <<EOF; <episodicProgrammePlaceholder xmlns="http://www.cnnmedia.com"> <titleID>SN_DELETE</titleID> <messageAction>Create</messageAction> <doNotUse>false</doNotUse> <programmeType>SN</programmeType> <programmeLabel>DELETE</programmeLabel> <subTypeCode>Primary</subTypeCode> <titles> <title> <titleName><![CDATA[DELETE]]></titleName> <titleLang>ENG</titleLang> <titleType>Primary Legal</titleType> </title> </titles> <synopses> <synopsis> <synopsisText>Set in the fictional town of Gulfhaven, Flor +ida (nicknamed "Cougar Town" since its high school teams are the Coug +ars), the series focuses on a recently divorced woman in her forties +facing the often humorous challenges, pitfalls, and rewards of life's + next chapter, along with her son, ex-husband, and wine-loving friend +s who together make up her dysfunctional, but supportive and caring e +xtended family.</synopsisText> <synopsisLang>ENG</synopsisLang> <synopsisType>Turner Internal</synopsisType> </synopsis> </synopses> <keywords> <keyword> <keywordID>Red Wine</keywordID> <keywordLang>ENG</keywordLang> <keywordRelevance>1</keywordRelevance> </keyword> </keywords> <genres> <genre>Comedy</genre> </genres> <participations></participations> <studios></studios> <compliances> <compliance> <complianceCode>OFCOM</complianceCode> <complianceName>OFCOM</complianceName> <doNotUse>false</doNotUse> </compliance> </compliances> </episodicProgrammePlaceholder> EOF my $soap = SOAP::Lite -> service('http://user:password@lonsmam-is1:5555/ws/tb +selXenWebService:XenTxWS?WSDL') -> outputxml(1); $soap->serializer->register_ns('http://www.cnnmedia.com', 'cnn' ); $soap -> processEpisodicProgramme(SOAP::Data->type( 'xml' => $xmltest +));

It produces the following envelope element

<soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/enc +oding/" xmlns:soap="http://schemas.xmlsoap .org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/en +coding/" xmlns:tns="http://www.cnnmedia.com" xmlns:wsdl="http://schem +as.xmlsoap. org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="htt +p://www.w3.org/2001/XMLSchema-instance">

Using Soap UI i have determined that the attribute 'xmlns:tns="http://www.cnnmedia.com"' need to be 'xmlns:cnn="http://www.cnnmedia.com"' to get it working which I thought the line below acheived

$soap->serializer->register_ns('http://www.cnnmedia.com', 'cnn' );

This is not having any effect so I'm obviously not understanding it's intended use, any pointers would be appreciated. I've tried soap::lite v1.11 & v0.710.08


In reply to Soap::Lite - Changing attribute in envelope element by freeflyer73

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.