ffrost has asked for the wisdom of the Perl Monks concerning the following question:
## CURRENT OUTPUT CREATED (debug):$soapreg = SOAP::Lite ->proxy($regws) ->uri ("$regns") ->autotype(0); $results = $soapreg -> $regmethod (SOAP::Data->name('username') ->value($cun), SOAP::Data->name('password') ->value($cpw), SOAP::Data->name('status') ->value('1'), SOAP::Data->name('filter') ->value($testdata));
## DESIRED OUTPUT (can't get the extra slash at the end in UserInfo)SOAP::Transport::HTTP::Client::send_receive: POST https://(url.com)/xx +x/service.asmx HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 621 Content-Type: text/xml; charset=utf-8 SOAPAction: https://(url.com)/xxx/UserInfo <?xml version="1.0" encoding="UTF-8"?> <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/encoding +/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Body> <UserInfo xmlns="https://(url.com)/xxx"> <username>OMIT</username> <password>OMIT</password> <status>1</status> <filter>9876533</filter> </UserInfo> </soap:Body></soap:Envelope>
This should be easy to do, but I can't figure out how. If I modify $regns to "https://(url.com)/xxx/" (extra slash at the end) then it creates an invalid SOAPAction request (https://(url.com)/xxx//UserInfo) which breaks the application. We don't have control of the server so nothing can be done on that end, unfortunately.SOAP::Transport::HTTP::Client::send_receive: POST https://(url.com)/xx +x/service.asmx HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 621 Content-Type: text/xml; charset=utf-8 SOAPAction: https://(url.com)/xxx/UserInfo <?xml version="1.0" encoding="UTF-8"?> <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/encoding +/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Body> <UserInfo xmlns="https://(url.com)/xxx/"> <username>OMIT</username> <password>OMIT</password> <status>1</status> <filter>9876533</filter> </UserInfo> </soap:Body></soap:Envelope>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SOAP::Lite attribute modification on method
by ffrost (Acolyte) on May 30, 2021 at 21:13 UTC |