0

关于如何创建存储过程以输出数据流 (xml) 并将其部署为 Web 服务,我需要您的帮助吗?SAS 存储过程需要将数据集作为 xml 流出。但是当我在soap UI上测试它作为webservice时,xml上没有显示任何值。请参阅下面的代码和 SOAP UI 的输出。我还附上了存储过程属性的屏幕截图。enter code here   代码:

data chartxml; input price sell; datalines; 20 250 30 180 40 130 50 250 60 250 ; run; libname _webout XML XMLmeta=schemadata; data _webout.chartxml; set chartxml; run;
SOAP OUTPUT 
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" <soapenv:Body <n:chartResponse xmlns:n="http://tempuri.org/Chart"> <n:chartResult/ </n:chartResponse> </soapenv:Body> </soapenv:Envelope> 

  谢谢,克里希纳

4

1 回答 1

1

我无法运行您的示例,但可以建议您通过将其用作(手动定义的)libref来混合(自动可用的) _webout fileref

如果要流式传输 Web 输出,可以在file 语句中使用它,如下所示:

data _null_;
  file _webout;
  put '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"' @;
  put '<soapenv:Body <n:chartResponse xmlns:n="http://tempuri.org/Chart">' @;
  put '<n:chartResult/ </n:chartResponse> </soapenv:Body> </soapenv:Envelope>';
run;

要“部署为 Web 服务”,您的 SAS 代码需要注册为存储过程(使用 SAS 管理控制台)并选择流输出。然后,您可以在 _PROGRAM 参数中使用带有 STP 元数据位置的 URL 来执行 STP - 如下所示:

http://YOURMACHINE:8080/SASStoredProcess/do?_PROGRAM=/MetaLoc/STP_Name

于 2017-02-09T17:45:56.220 回答