我有一个带有以下 link 的网络服务
我正在尝试使用 SubmitRequestType 访问函数名称,但似乎该函数不存在 submitAnsiSingle 这是我到目前为止尝试的正确函数名称,
$wsdl = 'https://ww3.navicure.com:7000/webservices/NavicureSubmissionService?WSDL';
class SecurityHeaderType {
private $submitterIdentifier;
private $originatingIdentifier;
private $submitterPassword;
private $submissionId;
function SecurityHeaderType() {
$this->submitterIdentifier = '***';
$this->originatingIdentifier = '****';
$this->submitterPassword = '****';
$this->submissionId = '';
}
}
class SubmitRequestType {
private $submitterIdentifier;
private $originatingIdentifier;
private $submitterPassword;
private $submissionId;
private $timeout;
private $transactionType;
private $submittedAnsiVersion;
private $resultAnsiVersion;
private $submitterSubmissionId;
private $processingOption;
private $payload;
private $exceptions;
function SubmitRequestType() {
$this->submitterIdentifier = '***';
$this->originatingIdentifier = '***';
$this->submitterPassword = '**';
$this->submissionId = '**';
$this->timeout = 60 ;
$this->transactionType = "E";
$this->submittedAnsiVersion = '5010';
$this->resultAnsiVersion = '5010';
$this->submitterSubmissionId = '**';
$this->processingOption = 'R';
$this->payload = 'EDI-270-Request';
$this->exceptions = true;
}
}
$soapheader = new SecurityHeaderType();
$submitrequest = new SubmitRequestType();
$service = new \SoapClient($wsdl);
$result= $service->SubmitAnsiSingle($submitrequest);
echo "<pre/>";print_r($result);
$types = $service->__getTypes ();
$functions = $service->__getFunctions ();
//echo "<pre/>";print_r($types);
//echo "<pre/>";print_r($functions);
但我收到如下响应,似乎请求正在处理,但 SecurityHeaderType 未解析它们的结尾。
stdClass Object
(
[transactionTyp] => E
[submitterSubmissionId] => ****
[submittedAnsiVersion] => 5010
[resultAnsiVersion] => 5010
[statusHeader] => stdClass Object
(
[statusCode] => 1150
[statusMessage] => com.navicure.webservices.core.WSCoreException: Account does not exist for ''
[requestProcessed] =>
)
)
任何提示将不胜感激
提前致谢。
最佳答案
我找到了解决方案!似乎是 PHP -> .NET Web 服务可比性问题。所以从 PHP 无法访问复杂类型的 SOAP(这种格式)我发现了一些有用的帖子 here .所以我将 SOAP 切换为带有 CURL 的纯 XML 请求,它似乎工作正常!。同样从 WSDL 链接中,我们可以使用此 online service 提取请求模板. 所以我的最终代码如下所示。
$xml_data = "<?xml version='1.0' encoding='UTF-8'?>
<s12:Envelope xmlns:s12='http://www.w3.org/2003/05/soap-envelope'>
<s12:Header>
<ns1:SecurityHeaderElement xmlns:ns1='http://www.navicure.com/2009/11/NavicureSubmissionService'>
<ns1:originatingIdentifier>****</ns1:originatingIdentifier>
<ns1:submitterIdentifier>****</ns1:submitterIdentifier>
<ns1:submitterPassword>***</ns1:submitterPassword>
<ns1:submissionId>?999?</ns1:submissionId>
</ns1:SecurityHeaderElement>
</s12:Header>
<s12:Body>
<ns1:SubmitAnsiSingleRequestElement xmlns:ns1='http://www.navicure.com/2009/11/NavicureSubmissionService'>
<ns1:timeout>60</ns1:timeout>
<ns1:transactionType>E</ns1:transactionType>
<ns1:submittedAnsiVersion>5010</ns1:submittedAnsiVersion>
<ns1:resultAnsiVersion>5010</ns1:resultAnsiVersion>
<ns1:submitterSubmissionId></ns1:submitterSubmissionId>
<ns1:processingOption>R</ns1:processingOption>
<ns1:payload>EDI270Payload</ns1:payload>
</ns1:SubmitAnsiSingleRequestElement>
</s12:Body>
</s12:Envelope>";
$URL = "https://ww3.navicure.com:7000/webservices/NavicureSubmissionService";
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
print_r($output);
希望这对将来的其他人有帮助。
关于php - Soap 客户端复杂类型 PHP 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47234409/
我正在尝试使用ruby和Savon来使用网络服务。测试服务为http://www.webservicex.net/WS/WSDetails.aspx?WSID=9&CATID=2require'rubygems'require'savon'client=Savon::Client.new"http://www.webservicex.net/stockquote.asmx?WSDL"client.get_quotedo|soap|soap.body={:symbol=>"AAPL"}end返回SOAP异常。检查soap信封,在我看来soap请求没有正确的命名空间。任何人都可以建议我
在我的Controller中,我通过以下方式在我的index方法中支持HTML和JSON:respond_todo|format|format.htmlformat.json{renderjson:@user}end在浏览器中拉起它时,它会自然地以HTML呈现。但是,当我对/user资源进行内容类型为application/json的curl调用时(因为它是索引方法),我仍然将HTML作为响应。如何获取JSON作为响应?我还需要说明什么? 最佳答案 您应该将.json附加到请求的url,提供的格式在routes.rb的路径中定义。这
我可以得到Infinity和NaNn=9.0/0#=>Infinityn.class#=>Floatm=0/0.0#=>NaNm.class#=>Float但是当我想直接访问Infinity或NaN时:Infinity#=>uninitializedconstantInfinity(NameError)NaN#=>uninitializedconstantNaN(NameError)什么是Infinity和NaN?它们是对象、关键字还是其他东西? 最佳答案 您看到打印为Infinity和NaN的只是Float类的两个特殊实例的字符串
我不确定传递给方法的对象的类型是否正确。我可能会将一个字符串传递给一个只能处理整数的函数。某种运行时保证怎么样?我看不到比以下更好的选择:defsomeFixNumMangler(input)raise"wrongtype:integerrequired"unlessinput.class==FixNumother_stuffend有更好的选择吗? 最佳答案 使用Kernel#Integer在使用之前转换输入的方法。当无法以任何合理的方式将输入转换为整数时,它将引发ArgumentError。defmy_method(number)
有时我需要处理键/值数据。我不喜欢使用数组,因为它们在大小上没有限制(很容易不小心添加超过2个项目,而且您最终需要稍后验证大小)。此外,0和1的索引变成了魔数(MagicNumber),并且在传达含义方面做得很差(“当我说0时,我的意思是head...”)。散列也不合适,因为可能会不小心添加额外的条目。我写了下面的类来解决这个问题:classPairattr_accessor:head,:taildefinitialize(h,t)@head,@tail=h,tendend它工作得很好并且解决了问题,但我很想知道:Ruby标准库是否已经带有这样一个类? 最佳
我正在尝试解析一个CSV文件并使用SQL命令自动为其创建一个表。CSV中的第一行给出了列标题。但我需要推断每个列的类型。Ruby中是否有任何函数可以找到每个字段中内容的类型。例如,CSV行:"12012","Test","1233.22","12:21:22","10/10/2009"应该产生像这样的类型['integer','string','float','time','date']谢谢! 最佳答案 require'time'defto_something(str)if(num=Integer(str)rescueFloat(s
我正在玩HTML5视频并且在ERB中有以下片段:mp4视频从在我的开发环境中运行的服务器很好地流式传输到chrome。然而firefox显示带有海报图像的视频播放器,但带有一个大X。问题似乎是mongrel不确定ogv扩展的mime类型,并且只返回text/plain,如curl所示:$curl-Ihttp://0.0.0.0:3000/pr6.ogvHTTP/1.1200OKConnection:closeDate:Mon,19Apr201012:33:50GMTLast-Modified:Sun,18Apr201012:46:07GMTContent-Type:text/plain
rails中是否有任何规定允许站点的所有AJAXPOST请求在没有authenticity_token的情况下通过?我有一个调用Controller方法的JqueryPOSTajax调用,但我没有在其中放置任何真实性代码,但调用成功。我的ApplicationController确实有'request_forgery_protection'并且我已经改变了config.action_controller.consider_all_requests_local在我的environments/development.rb中为false我还搜索了我的代码以确保我没有重载ajaxSend来发送
我在加密来self正在使用的第三方供应商的值时遇到问题。他们的指令如下:1)Converttheencryptionpasswordtoabytearray.2)Convertthevaluetobeencryptedtoabytearray.3)Theentirelengthofthearrayisinsertedasthefirstfourbytesontothefrontofthefirstblockoftheresultantbytearraybeforeencryption.4)EncryptthevalueusingAESwith:1.256-bitkeysize,2.25
我正在开发西洋跳棋实现,其中有许多易于测试的方法,但我不确定如何测试我的主要#play_game方法。我的大多数方法都可以很容易地确定输入和输出,因此也很容易测试,但这种方法是多方面的,实际上并没有容易辨别的输出。这是代码:defplay_gameputs@gui.introwhile(game_over?==false)message=nil@gui.render_board(@board)@gui.move_requestplayer_input=getscoordinates=UserInput.translate_move_request_to_coordinates(play