After a lot of experimenting I've determined that when I override the "address", I lose the definition of "SOAPAction". I try to define it by adding "action=>....", but I still get 404 error (and I don't see it in the "$trace -> printRequest;" output).

If I don't override the server address (using the one in the WSDL) and specify the correct action, the request works fine.
If I don't override the server address and specify a bogus action, I get a 404 error (as expected).
If I override the server address with the same address (just to test) and specify the correct action, I unexpectedly get a 404 error.

The trace of the request -- using the endpoint address in the WSDL (which works):
Request: POST http://address.of.server1:18082/ServiceRequest HTTP/1.1 User-Agent: libwww-perl/6.04 Content-Length: 1178 Content-Type: text/xml; charset="utf-8" SOAPAction: "/Processes/ServiceRequest" X-LWP-Version: 6.04 X-XML-Compile-Cache-Version: 0.994 X-XML-Compile-SOAP-Version: 2.36 X-XML-Compile-Version: 1.34 X-XML-LibXML-Version: 2.0018
The trace of the request -- using the same endpoint address and action, but specified in the calls (which doesn't work):
Request: POST http://address.of.server1:18082/ServiceRequest HTTP/1.1 User-Agent: libwww-perl/6.04 Content-Length: 1178 Content-Type: text/xml; charset="utf-8" X-LWP-Version: 6.04 X-XML-Compile-Cache-Version: 0.994 X-XML-Compile-SOAP-Version: 2.36 X-XML-Compile-Version: 1.34 X-XML-LibXML-Version: 2.0018

I need to be able to pass in different server names and override the one in the WSDL. I'd rather avoid the ugliness of multiple copies of the same WSDL as I have many other web services as well.


In reply to Re^2: XML::Compile Changing Server Endpoint by jdudleyh
in thread XML::Compile Changing Server Endpoint by jdudleyh

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.