I am trying to make a PROC SOAP call from SAS using a saved file instead of a URL. The reason for this is firewall/proxy issues calling some of the "w3" websites. The xml from the WSDL is saved to a text file with a ."wsdl" extension and the problematic URLs are replaced with ".xsd" files stored in the same directory.
This solution does work when testing in SOAP UI 5.2 , but the challenge I am having is getting SAS to reference the local file saved to SAMGW instead of using the URL. Has anyone had any experience with this? Below is the code I am trying to use. The statement in bold is the problematic part. The SOAP Envelope is contained in the REQUEST.xml file referenced in the first line of code.
filename REQUEST "samplefilepath/REQUEST.xml" ;
filename RESPONSE "samplefilepath/RESPONSE.xml" ;
proc soap in=REQUEST
out=RESPONSE
URL="samplefilepath/ChangeRiskModel2.wsdl" /*this is the line I am trying to figure out. Instead of using a URL I need it to reference a static file
soapaction="http://urltowsdl"
WEBUSERNAME="xxxxxx"
WEBPASSWORD="xxxxxx";
run;
I think you need to use a comment such as /* <=== This line is the problem line */
as the posted code doesn't show any bold text.
thanks. I added a comment next to the line I am having difficulties with.
I am guessing here but if your URL would generally be http:// <etc> I might try Url= "file://<local path>"
Thanks, that helped! I also found that I had reversed my URL and SOAPAction. It seems now that the PROC SOAP command is connecting but I am seeing an issue with the SOAP Envelope now. The envelope works in SOAPUI 5.2 but the same envelope returns an error -
<SOAP-ENV:Fault xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>SOAP-ENV:Server</faultcode><faultstring>A CXmlApiException was raised in native code : error 16 : scxmlapi(16) - Invalid or missing file name in XML request</faultstring><faultactor>Server</faultactor></SOAP-ENV:Fault>
Anyone know a way around this? Details of the envelope I am using below:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://schemas.hp.com/SM/7" xmlns:com="http://schemas.hp.com/SM/7/Common" xmlns:c="file:///c:\dev\xmlmime"> <soapenv:Header/> <soapenv:Body> <ns:UpdateChangeRiskModelRequest attachmentInfo="" attachmentData="" ignoreEmptyElements="true" updateconstraint="-1"> <ns:model query=""> <ns:keys query="" updatecounter=""> <!--Optional:--> <ns:ChangeID type="String" mandatory="" readonly="">C02766647</ns:ChangeID> </ns:keys> <ns:instance query="" uniquequery="" recordid="" updatecounter=""> <ns:header type="Structure"> <!--Optional:--> <ns:ChangeID type="String" mandatory="" readonly=""></ns:ChangeID> <!--Optional:--> <ns:CurrentPhase type="String" mandatory="" readonly=""></ns:CurrentPhase> <!--Optional:--> <ns:RiskAssessment type="String" mandatory="" readonly=""></ns:RiskAssessment> <!--Optional:--> <ns:TestingResults type="String" mandatory="" readonly=""></ns:TestingResults> <!--Optional:--> <ns:RecoveryScope type="String" mandatory="" readonly=""></ns:RecoveryScope> <!--Optional:--> <ns:CodeRepository type="String" mandatory="" readonly=""></ns:CodeRepository> <!--Optional:--> <ns:PerformingGroup type="String" mandatory="" readonly=""></ns:PerformingGroup> </ns:header> <ns:middle type="Structure"> <!--Optional:--> <ns:AssociatedCIs type="Array"> <!--Zero or more repetitions:--> <ns:AssociatedCIs type="String" mandatory="" readonly=""></ns:AssociatedCIs> </ns:AssociatedCIs> </ns:middle> <!--Optional:--> <ns:Service type="String" mandatory="" readonly=""></ns:Service> <!--Optional:--> <ns:ScoredRiskFlag type="String" mandatory="" readonly="">Scored</ns:ScoredRiskFlag> <!--Optional:--> <ns:ScoredRisk type="String" mandatory="" readonly="">Low</ns:ScoredRisk> <!--Optional:--> <ns:attachments> <!--Zero or more repetitions:--> <com:attachment c:contentType="" href="" contentId="" action="" name="" type="" len="" charset="" attachmentType="">cid:1331595433226</com:attachment> </ns:attachments> </ns:instance> <!--Optional:--> <ns:messages> <!--Zero or more repetitions:--> <com:message severity="" module=""></com:message> </ns:messages> </ns:model> </ns:UpdateChangeRiskModelRequest> </soapenv:Body> </soapenv:Envelope>
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.