Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

here is my perl script. I am trying to create a new space in Confluence (the Atlassian program).

#!perl use SOAP::Lite; use Data::Dumper; my $username = 'admin'; my $password = 'admin'; my $soap = SOAP::Lite->service("file:confluenceRemoteService.xml"); # +the wsdl print "logging in...\n"; $auth = $soap->login($username, $password); ### everything above here is fine, included for completeness ### $soap->addSpace($auth, { "key" => SOAP::Data->type(string => 'BOXER'), "name" => SOAP::Data->type(string => 'Battlecruiser opera +tional'), "description" => SOAP::Data->type(string => "This is a space") } ) or die "didnt work again\n"; exit 0;

So when I run it, the program dies at the end there because the addSpace call failed. I've been in contact with someone from Atlassian and they were able to tell me that when they run the script, the hash becomes a null object inside of the program.

I've tried a lot of little things, just fiddling around with the script. I've tried enclosing the hash in Soap::Data->type(struct =>...), ive tried creating the hash before the call and passing it in as %hash. I've tried creating a hash reference and passing in $hash.

I've even tried to use a different function called getSpace to get a Space object, and then printed it using Data::Dumper. I then used the output to create a Space object such that when I printed my object using Data::Dumper, it would print out in the same format as the space that I get when I call getSpace. (a little convoluted) but that didnt work either.

So now I'm trying to either get some help on how I create remote objects (structs) and send them through SOAP or find a way to print out the exact xml that is being sent, or something to determine why my hash doesn't isnt being processed correctly

Here is the relevant part of the Atlassian documentation

Space addSpace(String token, Space space) - create a new space, passing in name, key and description.

Where Space is


Key Type Value
key String the space key
name String the name of the space
url String the url to view this space online
homePage String the id of the space homepage
description String the HTML rendered space description

In reply to Re^2: Issues with Perl SOAP by J_Alex
in thread Issues with Perl SOAP by J_Alex

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (3)
    As of 2018-02-24 22:24 GMT
    Find Nodes?
      Voting Booth?
      When it is dark outside I am happiest to see ...

      Results (311 votes). Check out past polls.