- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我创建了一个 JaxWs 服务。用户尝试使用 PHP 客户端调用它,唯一的参数是一个字符串。当我使用 Eclipse Web 服务浏览器(测试器)时,一切都很好。当用户尝试使用 PHP 时,我在方法中收到一个空参数。我还没有对 wsdl 或代码进行任何定制。预先感谢您的任何指点...
方法
@WebService(endpointInterface = "my.endpoint.class")
public class ExternalReportsImpl implements ExternalReports {
private org.w3c.dom.Document doc;
@Resource
private WebServiceContext context;
private enum Types {
tfbData, tfbRate, tfbSupport, tfbMakes, tfbVin, tfbSave, tfbRetrieve;
}
@Override
public String getReports(String xmlSource){
XmlHelper xh;
SupportTables support = new SupportTables();
Connection con = null;
Policy policy = null;
String schema = "";
String ret = "";
ServletContext servletContext = (ServletContext) context.getMessageContext().get(MessageContext.SERVLET_CONTEXT);
try {
xh = new XmlHelper();
doc = xh.loadDoc(xmlSource);
}
WSDL 片段
<message name="getReports"><part name="parameters" element="tns:getReports"/></message><message name="getReportsResponse"><part name="parameters" element="tns:getReportsResponse"/></message><portType name="ExternalReports"><operation name="getReports"><input wsam:Action="http://my.class/ExternalReports/getReportsRequest" message="tns:getReports"/><output wsam:Action="http://my.class/ExternalReports/getReportsResponse" message="tns:getReportsResponse"/></operation></portType>
PHP 客户端
error_reporting(E_ALL);
$url = 'http://my.endpoint/ExternalReportsWebService?wsdl';
$client = new SoapClient($url);
class getReports {
function __construct($arg0) {
$this->getReports = $arg0;
}
}
class getReportsResponse {
function __construct($arg0='') {
$this->getReportsResponse = $arg0;
}
}
//$GR = new getReports(file_get_contents("test/test.xml") );
$GR = new getReports("test") );
$GRR = new getReportsResponse();
$report = new SoapVar( $GR , SOAP_ENC_OBJECT, 'getReports', $url);
$response = new SoapVar( $GRR , SOAP_ENC_OBJECT, 'getReportsResponse', $url);
echo nl2br(htmlspecialchars(print_r($client->getReports($report, $response), true)));
将此代码添加到 PHP 客户端
echo "<br> LAST REQUEST <br>" ;
echo $client->__getLastRequest();
echo " <br> Functions <br>" ;
echo $client->__getFunctions();
echo " <br> Types <br>" ;
echo $client->__getTypes();
echo "<br> Request headers <br>" ;
echo $client->__getLastRequestHeaders();
客户追踪结果
LAST REQUEST
TEST
Functions
Array
Types
Array
Request headers
POST /myApp/ExternalReportsWebService HTTP/1.1 Host: localhost:8080 Connection: Keep-Alive User-Agent: PHP-SOAP/5.3.14 Content-Type: text/xml; charset=utf-8 SOAPAction: "" Content-Length: 531
最佳答案
找到这个链接
http://www.lampjunkie.com/2010/03/get-phps-soapclient-to-speak-with-javas-jax-ws/
我的架构已命名为 params
<xs:schema version="1.0" targetNamespace="http://my.namespace/"><xs:element name="getReports" type="tns:getReports"/><xs:element name="getReportsResponse" type="tns:getReportsResponse"/><xs:complexType name="getReports"><xs:sequence><xs:element name="arg0" type="xs:string" minOccurs="0"/></xs:sequence></xs:complexType><xs:complexType name="getReportsResponse"><xs:sequence><xs:element name="return" type="xs:string" minOccurs="0"/></xs:sequence></xs:complexType></xs:schema>
必须添加
$addRequest = new stdClass();
$addRequest->argO = "String I was sending";
$response = $client->add($addRequest);
关于java - Jax Ws 与 PHP 客户端始终发送 Null parm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14687948/
我看到以下警告。有没有人知道为什么会出现这样的警告,尽管看起来合身似乎可以正常工作?有什么方法可以使优化工作更好,使其不会产生这些警告? R> library(MASS) R> set.seed(0)
class ServiceLoader implements Iterable { // ... } interface Foo { // ... } class FooReposit
我需要先初步了解这个术语,然后才能在我见过的所有一般上下文中理解它。 (而且我相当确定这是一个众所周知的术语。) @parm 是什么意思?它被基础程序员大量使用,(我绝对是编程新手)并且它总是在注释中
在我的第一次运行中,我有两类样本要由不同的参数处理,然后在第二次运行中将它们合并在一起。像下面的例子: SAMPLES = ['1', '2', '3'] CLASS1 = ['1', '2'] CL
我知道这是一个基本问题,但我不知道如何使用 Facebook 分析记录带有自定义参数的自定义事件。例如,我想记录以下内容: 播放的歌曲 标题 艺术家 请看下面的代码(不起作用): let di
我知道这是一个基本问题,但我不知道如何使用 Facebook 分析记录带有自定义参数的自定义事件。例如,我想记录以下内容: 播放的歌曲 标题 艺术家 请看下面的代码(不起作用): let di
我创建了一个 JaxWs 服务。用户尝试使用 PHP 客户端调用它,唯一的参数是一个字符串。当我使用 Eclipse Web 服务浏览器(测试器)时,一切都很好。当用户尝试使用 PHP 时,我在方法中
这是我的问题 我有一个带有名为“UserActivationStrategy”的自定义策略的功能开关。它所做的只是在 Id 字段中有一个硬编码值“user”,在 param 以及一些在 isActiv
我正在查看 Hello world Cordova 应用程序 出于某种原因,它的定义(看起来像)函数如下所示 receivedEvent: function(id) { // blah
所以对于我的项目,我们有一些 javascript 代码作为规则在 Alfresco 存储库中运行。因此,每当新文档进入某个空间时,就会动态创建一个新文件夹,并将该文档移动到新创建的空间中。此外,无论
这个问题已经有答案了: 奥 git _a (16 个回答) 已关闭 5 年前。 我正在尝试创建一种方法,该方法将根据参数和类似值从集合中获取记录。 其中parm例如是此架构中的_id字段。 getRe
[basic.lookup.argdep]/3 中的示例: namespace NS { class T { }; void f(T); void g(T, int); } N
如果传入的参数值为空,如何创建不会更新列的批量更新?例如: String UPDATE_STMT = "UPDATE MY_TABLE SET col1 = ?, col2 = ?, col3 = ?
我是一名优秀的程序员,十分优秀!