如何将soap请求返回的数据打印到控制台。急急急!!!!

提供的地址:http://127.0.0.1:3306/cqxyfw/lawenforcezunitappinfo/SOAP?wsdl
接口函数原型:getEmployeescorelistnewServiceApp(String empidnum);
通过身份证号查询数据。
附上代码,成功之后立即采纳

7个回答

public class Test {

public static void main(String[] args) {

try {

String endpoint = "http://127.0.0.1:3306cqxyfw/lawenforcezunitappinfo/SOAP";//直接引用远程的wsdl文件

Service service = new Service();

Call call = (Call) service.createCall();

call.setTargetEndpointAddress(endpoint);

call.setOperationName(new QName("getEmployeescorelistnewServiceApp"));// WSDL里面描述的接口名称

call.addParameter("empidnum",org.apache.axis.encoding.XMLType.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);// 接口的参数

call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);// 设置返回类型
String result = (String) call.invoke(new Object[]{"身份证"}); // 给方法传递参数,并且调用方法

System.out.println("返回数据:" + result);

} catch (Exception e) {

System.err.println(e.toString());

//e.printStackTrace();
}

}

}

图片说明

图片说明

尝试一下试试,原理就是用HttpURLConnection 模拟浏览器post请求获取数据

 public String getResult() {
        String result = "";
        String targetURL = "http://127.0.0.1:3306/cqxyfw/lawenforcezunitappinfo";
        try {
            URL targetUrl = new URL(targetURL);
            HttpURLConnection httpConnection = (HttpURLConnection) targetUrl.openConnection();
            httpConnection.setDoOutput(true);
            httpConnection.setRequestMethod("POST");
            httpConnection.setRequestProperty("Content-Type","application/json");

            OutputStream outputStream = httpConnection.getOutputStream();
            outputStream.write(input.getBytes());
            outputStream.flush();
            if (httpConnection.getResponseCode() != 200) {
                throw new RuntimeException("Failed : HTTP error code : " + httpConnection.getResponseCode());
            }
            StringBuffer output = new StringBuffer();
            InputStream is = httpConnection.getInputStream();
            byte[] bytes = new byte[is.available()];
            int size = 0;
            while ((size = is.read(bytes)) != -1) {
                String str = new String(bytes, 0, size, "UTF-8");
                output.append(str);
            }
            result = output.toString();
            is.close();
            httpConnection.disconnect();
            outputStream.close();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return result;
    }
qq_40574584
六月下起了大雪 input.getBytes()的input报错是什么?
大约 2 年之前 回复

http://blog.csdn.net/u012009613/article/details/52014113 看看这个能帮到你吗,webservice调用
百度的时候用 代码语言+wsdl+soap

 public string get(string Url, string postDataStr)
        {
            HttpWebResponse response = null;
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url + (string.IsNullOrEmpty(postDataStr) ? "" : "?") +     postDataStr);
            request.Timeout = 30000; // 设置超时时间,单位毫秒。
            try
            {
            request.Method = "GET";
            request.ContentType = "text/html;charset=UTF-8";
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)";
            response = (HttpWebResponse)request.GetResponse();

            Stream myResponseStream = response.GetResponseStream();
            StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));
            string retString = myStreamReader.ReadToEnd();

                  myStreamReader.Close();
 myStreamReader.Dispose();
                  myResponseStream.Close();
                  myResponseStream.Dispose();

                  return retString ;
            } catch(Exception ex){
                Console.WriteLine(ex.ToString());
            } finally{
                if (response != null)
{
response.Close();
}
            }
            return "false";
        }

取方法返回值打印出来就行了

1.首先新建一个空的项目,打开cmd,,cd到这个项目的src目录下,
2.使用wsdl2java生成客户端调用代码,命令:wsdl2java -d . http://127.0.0.1:3306/cqxyfw/lawenforcezunitappinfo/SOAP?wsdl
3.将这些代码连同包copy到项目中,
4.在applicationContext.xml中配置

<jaxws:client id="wsdlClient" address=" http://127.0.0.1:3306/cqxyfw/lawenforcezunitappinfo/SOAP?wsdl"

serviceClass="com.xx.xxx.XxxInterface">

/jaxws:client

5.建立test类
public class ClientTest {

    private ApplicationContext applicationContext;

    @Before
    public void before() {

        applicationContext = new ClassPathXmlApplicationContext(
                "applicationContext.xml");

    }

    @Test
    public void testCxfSpringClient() {
        // 从spring容器中取出porttype
        XxxInterface xxxInterface = (XxxInterface) applicationContext
                .getBean("wsdlClient");

        // 调用portType的方法
        List list = xxxInterface.getEmployeescorelistnewServiceApp(String empidnum);
//循环list并打印
        for () {

        }
    }

}






qi923701
Powerful_Current applicationContext。xml中配置的serviceClass:是指定portType地址(需要使用wsdl2java工具生成)
大约 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
用jmeter发送soap 请求没有返回数据

![图片说明](https://img-ask.csdn.net/upload/201710/18/1508312716_38682.png)<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:RequestByClientResponse xmlns:ns="http://webservice.jrtx.usi.com"><ns:return>&lt;?xml version="1.0" encoding="gb2312"?&gt;&lt;PageInfo&gt;&lt;MessageId&gt;&lt;/MessageId&gt;&lt;ResultCode&gt;99&lt;/ResultCode&gt;&lt;PageContents&gt;&lt;/PageContents&gt;&lt;AccessoryContents&gt;&lt;errorInfo&gt;&lt;/errorInfo&gt;&lt;/AccessoryContents&gt;&lt;CurrentPage&gt;0&lt;/CurrentPage&gt;&lt;RowCount&gt;0&lt;/RowCount&gt;&lt;PageSize&gt;0&lt;/PageSize&gt;&lt;Errors&gt;&lt;/Errors&gt;&lt;/PageInfo&gt;</ns:return></ns:RequestByClientResponse></soapenv:Body></soapenv:Envelope> 初次接触这个不太懂,我发送的请求中是不是不对呀![图片说明](https://img-ask.csdn.net/upload/201710/18/1508312816_998405.png)要怎么改呢?

SOAP PHP返回数据

<div class="post-text" itemprop="text"> <p>can any Coding Gurus lend a helping hand,</p> <p>I make the following soap call:</p> <pre><code> $acc = 192838; $vec1 = array( 'USERNAME'=&gt;'test', 'PASSWORD'=&gt;'test', 'BRANCHID'=&gt;231, 'Customer_AccountNo'=&gt;$acc ); $soap_client = new SoapClient('https://test.com/externalintegration.asmx?WSDL'); $info = $soap_client-&gt;Get_CustomerInfo($vec1); var_dump($info); </code></pre> <p>Which returns the following data:</p> <blockquote> <p>object(stdClass)#2 (1) { ["Get_CustomerInfoResult"]=&gt; object(stdClass)#3 (2) { ["schema"]=&gt; string(4205) "" ["any"]=&gt; string(2419) "192838ADELW7210250821972-10-03T00:00:00+02:00ENGLISHFEMALESINGLE6 CARWELL STREET, HIGHS RIVERCAPE TOWN3REET, HIGBURY PKUILS RIRCAPE a@s.com076478680707647868070219804897YES2015-06-04T12:55:02.49+02:00DISPUTED216LIT9AMSRAMSGAT90039 314 9090CAPITEC BANK470010AD Wentzel116056ARDINE LPSON SA1ST FLOOR, BUILDING 3, FUSON QUTER,s s s s AFRICA744102155113140215511314ilay@jlto.comSHANTAL PILLAY1Employeyed2518970.00003000.0000CLATOS " } }</p> </blockquote> <p>The data is being returned in one string, but I need to access the individual information.</p> <p>Firstnames</p> <p>Surname</p> <p>IdentityNo</p> <p>Email</p> <p>etc..</p> <p>Thanks in advance for your help!</p> <p>WSDL:</p> <pre><code>&lt;s:element name="Get_CustomerInfo"&gt; &lt;s:complexType&gt; &lt;s:sequence&gt; &lt;s:element minOccurs="0" maxOccurs="1" name="USERNAME" type="s:string"/&gt; &lt;s:element minOccurs="0" maxOccurs="1" name="PASSWORD" type="s:string"/&gt; &lt;s:element minOccurs="1" maxOccurs="1" name="BRANCHID" type="s:long"/&gt; &lt;s:element minOccurs="1" maxOccurs="1" name="Customer_AccountNo" type="s:long"/&gt; &lt;/s:sequence&gt; &lt;/s:complexType&gt; &lt;/s:element&gt; &lt;s:element name="Get_CustomerInfoResponse"&gt; &lt;s:complexType&gt; &lt;s:sequence&gt; &lt;s:element minOccurs="0" maxOccurs="1" name="Get_CustomerInfoResult"&gt; &lt;s:complexType&gt; &lt;s:sequence&gt; &lt;s:element ref="s:schema"/&gt; &lt;s:any/&gt; &lt;/s:sequence&gt; &lt;/s:complexType&gt; &lt;/s:element&gt; &lt;/s:sequence&gt; &lt;/s:complexType&gt; &lt;/s:element&gt; </code></pre> </div>

如何用java代码访问一个Soap请求,网上百度几天了,都无法请求

具体需求:用Soap UI的话,是访问一个wsdl地址,然后得出一大堆方法。![图片说明](https://img-ask.csdn.net/upload/201905/28/1559015804_243588.png) ,用Soap UI请求这个Getjfjl方法是没有问题的,能正常返回数据,但是用java代码不知道如何请求,百度了蛮久,发现有简单的httpClient请求,复杂的请求,还需要用到nameSpace、serviceName、responseName等各种参数,从没做过soap请求,所以有点乱;网上的教程大多试了蛮多了,请求得到的结果是返回的是整个wsdl报文,![图片说明](https://img-ask.csdn.net/upload/201905/28/1559016148_882919.png) ,没有帮我访问Getjfjl整个方法。。。 求大牛指导一二,谢谢大家

如何使用PHP发送此SOAP请求

<div class="post-text" itemprop="text"> <p>I'm trying to integrate with a third party API and their API accpets only SOAP requests. They have this sample in their documentation. All I need is to replace the agentcode and mpin. Pls I need some one to help me write a PHP code to send the below format to this link <a href="http://202.140.50.116/EstelServices/services/EstelServices?wsdl" rel="nofollow noreferrer">http://202.140.50.116/EstelServices/services/EstelServices?wsdl</a> using SOAP request</p> <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.estel.com" xmlns:bal="http://balance.support.services.estel.com"&gt; &lt;soapenv:Header/&gt; &lt;soapenv:Body&gt; &lt;ser:getBalance&gt; &lt;ser:balanceRequest&gt; &lt;bal:agentCode&gt;TPR_CM&lt;/bal:agentCode&gt; &lt;bal:mpin&gt;EE17F932B3C311E8877F999DD7865E11&lt;/bal:mpin&gt; &lt;/ser:balanceRequest&gt; &lt;/ser:getBalance&gt; &lt;/soapenv:Body&gt; &lt;/soapenv:Envelope&gt; </code></pre> <p>Heres what I have tried so far</p> <pre><code> $xml = '&lt;?xml version="1.0" encoding="utf-8"?&gt;'. '&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.estel.com" xmlns:bal="http://balance.support.services.estel.com"&gt;'. '&lt;soapenv:Header/&gt;'. '&lt;soapenv:Body&gt;'. '&lt;ser:getBalance&gt;'. '&lt;ser:balanceRequest&gt;'. '&lt;bal:agentCode&gt;TPR_CM&lt;/bal:agentCode&gt;'. '&lt;bal:mpin&gt;EE17F932B3C311E8877F999DD7865E11&lt;/bal:mpin&gt;'. '&lt;/ser:balanceRequest&gt;'. '&lt;/ser:getBalance&gt;'. '&lt;/soapenv:Body&gt;'. '&lt;/soapenv:Envelope&gt;'; $url = "http://balance.support.services.estel.com"; $soap_do = curl_init(); curl_setopt($soap_do, CURLOPT_URL, $url ); curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true ); curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($soap_do, CURLOPT_POST, true ); curl_setopt($soap_do, CURLOPT_POSTFIELDS, $xml); $result = curl_exec($soap_do); $err = curl_error($soap_do); var_dump($result); </code></pre> </div>

如何在soap请求中传递一个参数和xml数据

<div class="post-text" itemprop="text"> <p>I have soap request in xml format. I want to convert into php SOAP. Request</p> <pre><code> &lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;s:Body&gt; &lt;AddContact xmlns="http://thankqportal.com/eModulesAPI" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt; &lt;token&gt;efgh5678&lt;/token&gt; &lt;contactXml&gt; &lt;Contact xmlns="http://thankqportal.com/eModulesAPI/Contact.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; &lt;title&gt;Mr&lt;/title&gt; &lt;firstname&gt;Luke&lt;/firstname&gt; &lt;keyname&gt;Hawkins&lt;/keyname&gt; &lt;/Contact&gt; &lt;/contactXml&gt; &lt;/AddContact&gt; &lt;/s:Body&gt; &lt;/s:Envelope&gt; </code></pre> <p>Please help me here. I am stuck with contact xml. It is inner xml of xml. So How can I pass the xml to soap api.</p> <p>I have written the code as per below:</p> <pre><code> $xml = "&lt;Contact&gt; &lt;firstname&gt;$fname&lt;/firstname&gt; &lt;keyname&gt;$keyname&lt;/keyname&gt; &lt;/Contact&gt;"; $args = array("token" =&gt;$token, "contactXml" =&gt; new SoapVar($xml, XSD_ANYXML)); try { $result = $soapClient-&gt;AddContact($args); } catch (SoapFault $e) { echo '&lt;pre&gt;'; echo "Error!: "; echo $e -&gt; getMessage (); } </code></pre> <p>But it gives the error: Error!: Object reference not set to an instance of an object.</p> <p>So please help me here where I am wrong in my code.</p> </div>

python使用suds库请求soap接口,返回数据怎么断言?求救

返回数据格式: (MemberProperty){ PropertyId = 540054531 MebId = 181295543 PropertyType = 1 PropertyValues = "87172103" CreateTime = 2016-11-16 20:53:41 CreateOprt = 26748 LastModifyTime = 2016-11-16 20:53:41 LastModifyOprt = 26748 LastAccessTime = None Flag = True } 或者 SOAP Response: <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope> <soap:Body> <GetMemberPropertyResponse xmlns="http://tempuri.org/"> <GetMemberPropertyResult> <PropertyId>540054531</PropertyId> <MebId>181295543</MebId> <PropertyType>1</PropertyType> <PropertyValues>87172103</PropertyValues> <CreateTime>2016-11-16T20:53:41</CreateTime> <CreateOprt>26748</CreateOprt> <LastModifyTime>2016-11-16T20:53:41</LastModifyTime> <LastModifyOprt>26748</LastModifyOprt> <LastAccessTime xsi:nil="true"/> <Flag>true</Flag> </GetMemberPropertyResult> </GetMemberPropertyResponse> </soap:Body> </soap:Envelope>

java从控制台读取数据并输出

![图片说明](https://img-ask.csdn.net/upload/201608/13/1471097461_494198.png)

非WSDL Soap请求“错误请求”

<div class="post-text" itemprop="text"> <p><strong>The Problem</strong></p> <p>i'm trying to integrate with an API from a provider that has not given me a WSDL--i'm assuming that i'll have to make Non-WSDL requests. however, every request i'm making is giving me a "Bad Request" result. i've never worked with a SOAP API before so i'm kind of lost on what i'm doing wrong here.</p> <p>i've attempted to use the __soapCall(); function to call the API's endpoint and have constructed parameters using an object to try to format it the way the API documentation is requesting.</p> <p>when the request is generated and dumped using getLastRequest(), i'm noticing that my function call is wrapping everything in a "param0" struct, which does not match what the API's endpoint expects.</p> <p>so i'm asking two things essentially: 1. what is causing the Bad Request result or is there a way to diagnose it? 2. is this extra struct my parameters are being wrapped in the result of the error? how do i avoid that?</p> <p><strong>Code:</strong></p> <p>here's my constructor with options. from what i understand, if i have no wsdl, i should pass "null" (i've created a class that extends SoapClient to add some helper functions that will construct it, hence why i'm using parent::__construct)</p> <pre><code>$opts = array( "location" =&gt; $url, "uri" =&gt; "https://trakpak.co.uk/API/", "trace" =&gt; true ); parent::__construct( null, $opts ); </code></pre> <p>here's my call to the actual SOAP function:</p> <pre><code>$this-&gt;base_function = "CreateShipment"; $this-&gt;parameters = new \stdClass; $this-&gt;parameters-&gt;ApiKey = "fff"; $result = $this-&gt;__soapCall( $this-&gt;base_function, [ $this-&gt;base_function =&gt; $this-&gt;parameters ] ); </code></pre> <p>this returns:</p> <pre><code>SOAP Error Code: HTTP: Bad Request </code></pre> <p>if i dump my last request, this is what i recieve:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="https://trakpak.co.uk/API/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt; &lt;SOAP-ENV:Body&gt; &lt;ns1:CreateShipment&gt; &lt;param0 xsi:type="SOAP-ENC:Struct"&gt; &lt;ApiKey xsi:type="xsd:string"&gt;FFF&lt;/ApiKey&gt; &lt;/param0&gt; &lt;/ns1:CreateShipment&gt; &lt;/SOAP-ENV:Body&gt; &lt;/SOAP-ENV:Envelope&gt; </code></pre> <p>i'm unsure if this is how it's <strong>supposed</strong> to look, as i've never actually worked with SOAP before.</p> <p>the API is requesting something like this:</p> <pre><code>&lt;CreateShipment&gt; &lt;ApiKey&gt;FFF&lt;/ApiKey&gt; &lt;/CreateShipment&gt; </code></pre> <p>it seems like my request may never actually be reaching the SOAP endpoint, because dumping the response is completely blank. my request itself also seems to have that extra wrapping param0 struct in the CreateShipment tag when the API is not expecting that.</p> <p><strong>UPDATE</strong></p> <p>i've managed to work out my "param0" issue, and now my request looks like this:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="https://trakpak.co.uk/API/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt; &lt;SOAP-ENV:Body&gt; &lt;ns1:CreateShipment&gt; &lt;ApiKey xsi:type="xsd:string"&gt;FFF&lt;/ApiKey&gt; &lt;/ns1:CreateShipment&gt; &lt;/SOAP-ENV:Body&gt; &lt;/SOAP-ENV:Envelope&gt; </code></pre> <p>which is formatted exactly how they're requesting it, but i'm still getting</p> <pre><code>SOAP Error Code: HTTP: Bad Request </code></pre> <p>and no response from the server.</p> </div>

cURL在发出SOAP请求时返回bool(false)

<div class="post-text" itemprop="text"> <p>I am trying to make a SOAP request using cURL but I am getting the following errors. For the output of the result, I get "<strong>bool(false)</strong>". For the curl_error() function, I get "<strong>Operation timed out after 30000 milliseconds with 0 bytes received</strong>". </p> <p>My question is whether I am missing something that could be preventing the connection, possibly in the cURL options?</p> <p>This is my code:</p> <pre><code>&lt;?php function soap_subscriber($subscriber_email) { $soap_endpoint = '[HIDDEN]'; $soap_username = '[HIDDEN]'; $soap_userpass = '[HIDDEN]'; define('USERNAME', '[HIDDEN]'); define('PASSWORD', '[HIDDEN]'); define('ENDPOINT', $soap_endpoint); date_default_timezone_set('America/Nassau'); $ch = '&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt; &lt;soap:Header&gt; &lt;wsse:Security soap:mustUnderstand="1"&gt; &lt;wsse:UsernameToken wsu:Id="SecurityToken-884da619-59bb-4db6-834d-138322342442"&gt; &lt;wsse:Username&gt; . soap_username . &lt;/wsse:Username&gt; &lt;wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" &gt; . soap_userpass . &lt;/wsse:Password&gt; &lt;/wsse:UsernameToken&gt; &lt;/wsse:Security&gt; &lt;/soap:Header&gt; &lt;soap:Body&gt; &lt;RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI"&gt; &lt;RetrieveRequest&gt; &lt;ClientIDs&gt; &lt;ID&gt;[HIDDEN]&lt;/ID&gt; &lt;/ClientIDs&gt; &lt;ObjectType&gt;DataExtensionObject[HIDDEN]&lt;/ObjectType&gt; &lt;Properties&gt;SubscriberID&lt;/Properties&gt; &lt;Properties&gt;FirstName&lt;/Properties&gt; &lt;Properties&gt;Email&lt;/Properties&gt; &lt;Filter xmlns:q1="http://exacttarget.com/wsdl/partnerAPI" xsi:type="q1:SimpleFilterPart"&gt; &lt;q1:Property&gt;Email&lt;/q1:Property&gt; &lt;q1:SimpleOperator&gt;equals&lt;/q1:SimpleOperator&gt; &lt;q1:Value&gt; . $subscriber_email . &lt;/q1:Value&gt; &lt;/Filter&gt; &lt;/RetrieveRequest&gt; &lt;/RetrieveRequestMsg&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt;'; $soap_header = array( "Content-type: application/soap+xml;charset=\"utf-8\"", "Accept: text/xml", "Cache-Control: no-cache", "Pragma: no-cache", "SOAPAction: ", "Content-length: ".strlen($ch), ); $ch = curl_init(); $curl_options = array( CURLOPT_URL =&gt; ENDPOINT, CURLOPT_CONNECTTIMEOUT =&gt; 10, CURLOPT_RETURNTRANSFER =&gt; true, CURLOPT_TIMEOUT =&gt; 30, CURLOPT_USERPWD =&gt; USERNAME . ':' . PASSWORD, CURLOPT_HTTPAUTH =&gt; CURLAUTH_ANY, CURLOPT_SSL_VERIFYPEER =&gt; false, CURLOPT_SSL_VERIFYHOST =&gt; false, CURLOPT_HEADER =&gt; true, CURLOPT_POSTFIELDS =&gt; $ch, CURLOPT_HTTPHEADER =&gt; $soap_header, CURLOPT_POST =&gt; true, ); curl_setopt_array($ch, $curl_options); $response = curl_exec($ch); $error = curl_error($ch); curl_close($ch); var_dump($response); var_dump($error); } soap_subscriber('[HIDDEN]'); ?&gt; </code></pre> </div>

通过CURL在PHP中调用soap请求

<div class="post-text" itemprop="text"> <p>This is a soap link that I need to call with CURL:</p> <p><a href="http://webservice-ip1.systemnic.net/index.php?wsdl" rel="nofollow noreferrer">http://webservice-ip1.systemnic.net/index.php?wsdl</a></p> <p>I need this function:</p> <pre><code>&gt;message name="domainInfoRequest </code></pre> <p>and its answer:</p> <pre><code>&gt;message name="domainInfoResponse </code></pre> <p>But I don't know how to call it. I saw other topics but they weren't helpful, so I wrote this code:</p> <pre><code> $soapUrl = "http://webservice-ip1.systemnic.net/index.php?wsdl"; // asmx URL of WSDL $soapUser = "username"; // username $soapPassword = "password"; // password // xml post structure $xml_post_string = '&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;soap:Body&gt; &lt;domainInfo xmlns="http://webservice-ip1.systemnic.net/index.php?wsdl"&gt; &lt;api_user&gt;"myusername"&lt;/api_user&gt; &lt;api_pass&gt;"mypass"&lt;/api_pass&gt; &lt;domain&gt;"mydomain"&lt;/domain&gt; &lt;/domainInfo &gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt;'; // data from the form, e.g. some ID number $headers = array( "Content-type: text/xml;charset=\"utf-8\"", "Accept: text/xml", "Cache-Control: no-cache", "Pragma: no-cache", "SOAPAction: http://webservice-ip1.systemnic.net/index.php?wsdl", "Content-length: ".strlen($xml_post_string), ); //SOAPAction: your op URL $url = $soapUrl; // PHP cURL for https connection with auth $ch = curl_init(); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // converting $response = curl_exec($ch); curl_close($ch); // converting $response1 = str_replace("&lt;soap:Body&gt;","",$response); $response2 = str_replace("&lt;/soap:Body&gt;","",$response1); // convertingc to XML $parser = simplexml_load_string($response2); // user $parser to get your data out of XML response and to display it. </code></pre> <p>But it didn't work!</p> </div>

PHP SOAPClient请求问题

<div class="post-text" itemprop="text"> <p>I am trying to call this web service http:// 115. 186. 182.11/csws/Service.asmx?op=SendSMS with following PHP code but it gives me exception Error mate in Script: Server was unable to process request. ---&gt; Object reference not set to an instance of an object.</p> <p>Will highly appreciate your help on this.</p> <pre><code>try { $client = new SoapClient("http://115.186.182.11/csws/Service.asmx?wsdl"); $method = 'SendSMS'; $params = array( new SoapParam('xxxxx', 'Src_nbr'), new SoapParam('xxxxxx', 'Password'), new SoapParam('xxxxx', 'Dst_nbr'), new SoapParam('xxxxx', 'Mask'), new SoapParam('Message is test message', 'Message') ); $result = $client-&gt;__call($method,$params); } catch(SoapFault $e){ echo "Error mate in Script: " . $e-&gt;getMessage(); } echo "&lt;pre&gt;"; var_dump($result); echo "&lt;/pre&gt;"; $xmlobj = simplexml_load_string($result); print_r($xmlobj); </code></pre> <p>FOllowing is the specification...</p> <pre><code>POST /csws/Service.asmx HTTP/1.1 Host: 115.186.182.11 Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://tempuri.org/SendBulkSMS" &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;soap:Body&gt; &lt;SendBulkSMS xmlns="http://tempuri.org/"&gt; &lt;Src_nbr&gt;string&lt;/Src_nbr&gt; &lt;Password&gt;string&lt;/Password&gt; &lt;Dst_nbr&gt;xmlxml&lt;/Dst_nbr&gt; &lt;Mask&gt;string&lt;/Mask&gt; &lt;Message&gt;string&lt;/Message&gt; &lt;/SendBulkSMS&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt; HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;soap:Body&gt; &lt;SendBulkSMSResponse xmlns="http://tempuri.org/"&gt; &lt;SendBulkSMSResult&gt; &lt;string&gt;string&lt;/string&gt; &lt;string&gt;string&lt;/string&gt; &lt;/SendBulkSMSResult&gt; &lt;/SendBulkSMSResponse&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt; </code></pre> </div>

使用soapenv的SOAP请求

<div class="post-text" itemprop="text"> <p>I have the following code for connecting to a soap client. I am struggling hard to find how to create a proper soap request. </p> <pre><code>$soap = new SoapClient($apiWsdl, array("soap_version" =&gt; SOAP_1_1, "trace" =&gt; 1)); var_dump($soap); echo $soap-&gt;__getLastResponse(); try{ $data = $soap-&gt;login($apiUser,$apiKey); } catch (SoapFault $soapFault) { echo "Request :&lt;br&gt;", htmlentities($soap-&gt;__getLastRequest()), "&lt;br&gt;"; echo "Response :&lt;br&gt;", htmlentities($soap-&gt;__getLastResponse()), "&lt;br&gt;"; } </code></pre> <p>I get the following XML built:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; \&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;SOAP-ENV:Body&gt;&lt;ns1:login&gt;&lt;username xsi:type="xsd:string"&gt;XXXXXXX&lt;/username&gt;&lt;apiKey xsi:type="xsd:string"&gt;XXXXXXXX&lt;/apiKey&gt;&lt;/ns1:login&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt; Which returns be a forbidden access. However the server is accepting only request of the following form &lt;soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento"&gt; &lt;soapenv:Header/&gt; &lt;soapenv:Body&gt; &lt;urn:login soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt; &lt;username xsi:type="xsd:string"&gt;XXXXXXX&lt;/username&gt; &lt;apiKey xsi:type="xsd:string"&gt;XXXXXX&lt;/apiKey&gt; &lt;/urn:login&gt; &lt;/soapenv:Body&gt; &lt;/soapenv:Envelope&gt; </code></pre> <p>Can somebody please let me know what mistake I am making in the code.</p> </div>

SOAP请求非常慢

<div class="post-text" itemprop="text"> <p>In my php website, whenever a user is saved a SOAP request is made to an external API through. This request takes a very long time, +20 seconds.<br> Trying to find the bottleneck I have put some logs and I see that the constructor is not the issue (0.0005 second), the actual call is.<br> Here is what my class looks like: </p> <pre class="lang-php prettyprint-override"><code>Myclass extends SoapClient { public function __construct($wsdl = null, $options = array()) { $start = microtime(true); parent::SoapClient($wsdl, $options); $end = microtime(true); // $end-$start = 0.0005s } public function sendUserData($userData) { $start = microtime(true); $result = $this-&gt;__soapCall('TriggerCampaign', array($userData)); $end = microtime(true); // $end-$start = 24.77s } } </code></pre> <p>On my local machine the <code>__soapCall</code> takes at the maximum 1 second, on test environment it takes about half a second and in production it takes up to 30 seconds. The constructor takes 0.0005 second on all the environments.</p> <p>The external API says it doesn't come from their end.<br> From my microtime logging I believe it does.</p> <p>Is it possible that they are right and there is something about my production environment that makes the request so slow?<br> How can I debug more in depth this matter in order to find the culprit?</p> <p><strong>edit</strong><br> I remembered after posting that the external API has an alternate URL, so in order to determine if the problem is on my side or theirs, I made a quick and dirty script in which I make 2 SOAP calls to those 2 different URLs with the same data and executing the same method. The script looks like this:</p> <pre class="lang-php prettyprint-override"><code>&lt;?php $constructorStart1 = microtime(true); $soapClient1 = new SoapClient('http://url1.com?WSDL'); $constructorEnd1 = microtime(true); $header1 = array( 'Login' =&gt; 'login1', 'Password' =&gt; 'password1' ); $headers1 = new SoapHeader('http://tempuri.org/', 'AutomationAuthHeader', $header1); $soapClient1-&gt;__setSoapHeaders($headers1); $args1 = array( 'GateName' =&gt; 'UPDATE_MEMBER', 'InputData' =&gt; array( //some values ) ); $callStart1 = microtime(true); $soapClient1-&gt;__soapCall('TriggerCampaign', $args1); $callEnd1 = microtime(true); echo 'SOAP url: url1.com?WSDL' . "&lt;br&gt;"; echo 'SOAP construtor time: ' . number_format($constructorEnd1 - $constructorStart1, 4) . "&lt;br&gt;"; echo 'SOAP call time: ' . number_format($callEnd1 - $callStart1, 4) . "&lt;br&gt;&lt;br&gt;"; $constructorStart2 = microtime(true); $soapClient2 = new SoapClient('http://url2.com?WSDL'); $constructorEnd2 = microtime(true); $header2 = array( 'Login' =&gt; 'login2', 'Password' =&gt; 'password2' ); $headers2 = new SoapHeader('http://tempuri.org/', 'AutomationAuthHeader', $header2); $soapClient2-&gt;__setSoapHeaders($headers2); $args2 = array( 'GateName' =&gt; 'UPDATE_MEMBER', 'InputData' =&gt; array( //some value ) ); $callStart2 = microtime(true); $soapClient2-&gt;__soapCall('TriggerCampaign', $args2); $callEnd2 = microtime(true); echo 'SOAP url: http://url2.com?WSDL' . "&lt;br&gt;"; echo 'SOAP construtor time: ' . number_format($constructorEnd2 - $constructorStart2, 4) . "&lt;br&gt;"; echo 'SOAP call time: ' . number_format($callEnd2 - $callStart2, 4) . "&lt;br&gt;"; </code></pre> <p>The result I get is:</p> <pre><code>SOAP url: http://url1.com?WSDL SOAP construtor time: 0.0004 SOAP call time: 0.1568 SOAP url: http://url2.com?WSDL SOAP construtor time: 0.0002 SOAP call time: 22.1807 </code></pre> <p>for me that is definitive proof that the slowness comes from their side, am I correct?</p> </div>

如何使用PHP从XML创建SOAP请求

<div class="post-text" itemprop="text"> <p>I am trying to create SOAP request, but it gives me error: An exception occurred whilst trying to authenticate you. String reference not set to an instance of a String. Parameter name: s My code is:</p> <pre><code>$wsdl = "https://securedwebapp.com/api/service.asmx?WSDL"; $trace = true; $exceptions = false; $debug = true; $client = new SoapClient($wsdl, array( 'trace' =&gt; $trace, 'exceptions' =&gt; $exceptions, 'debug' =&gt; $debug, )); $xml = '&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:kas="KashFlow"&gt; &lt;soapenv:Header/&gt; &lt;soapenv:Body&gt; &lt;kas:GetInvoice&gt; &lt;kas:UserName&gt;xxx&lt;/kas:UserName&gt; &lt;kas:Password&gt;xxx&lt;/kas:Password&gt; &lt;kas:InvoiceNumber&gt;184576&lt;/kas:InvoiceNumber&gt; &lt;/kas:GetInvoice&gt; &lt;/soapenv:Body&gt; &lt;/soapenv:Envelope&gt;'; //var_dump($xml); $args = array(new SoapVar($xml, XSD_ANYXML)); $res = $client-&gt;__soapCall('GetInvoice', $args); var_dump($res); echo "&lt;hr&gt;Last Request"; echo "&lt;pre&gt;", htmlspecialchars($client-&gt;__getLastRequest()), "&lt;/pre&gt;"; </code></pre> <p>Does anyone know how to solve? The request works fine if I use:</p> <pre><code>$wsdl = 'https://securedwebapp.com/api/service.asmx?WSDL'; $trace = true; $exceptions = false; $debug = true; $client = new SoapClient($wsdl, array( 'trace' =&gt; $trace, 'exceptions' =&gt; $exceptions, 'debug' =&gt; $debug, )); $params = array( 'InvoiceNumber' =&gt;'81217', 'UserName' =&gt; 'xxx', 'Password' =&gt; 'xxx' ); $resp = $client-&gt;GetInvoice($params); print_r($resp); </code></pre> <p>This is request with simple parameters, but in real situation I have complex XML request, that I do not know how to form as php object. That is why I would send it as XML as I am trying to do at first place. </p> </div>

如何在php中创建SOAP请求,就像在SoapUI中一样?

<div class="post-text" itemprop="text"> <p>I am all new to php and all lost in doing a soap request. I have this other question <a href="https://stackoverflow.com/questions/55539930/how-to-send-a-soap-request-in-javascript-like-in-soapui">How to send a SOAP request in javascript, like in SoapUI</a>, which I have just got answered, but I have now decided to work in php instead of Node.js. As I want my php code to do the exact same, I will repeat my earlier question down below:</p> <p>I have this WSDL site that I need to get some answers from. I have figured out how to do this in SoapUI, but I have no idea how to do it in php. The request that I am sending in soapUI looks like this:</p> <pre><code>&lt;soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:uni="https://uni-login.dk"&gt; &lt;soap:Header/&gt; &lt;soap:Body&gt; &lt;uni:hentDataAftaler&gt; &lt;uni:wsBrugerid&gt;?&lt;/uni:wsBrugerid&gt; &lt;uni:wsPassword&gt;?&lt;/uni:wsPassword&gt; &lt;/uni:hentDataAftaler&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt; </code></pre> <p>I also have the wsdl-link: <a href="https://wsiautor.uni-login.dk/wsiautor-v4/ws?WSDL" rel="nofollow noreferrer">https://wsiautor.uni-login.dk/wsiautor-v4/ws?WSDL</a></p> <p>I hope you I have some suggestions and tell me if you need any more information to answer my question :)</p> <p>The answer for my previous question was the following</p> <pre><code> const soapRequest = require('easy-soap-request'); const url = 'https://wsiautor.uni-login.dk/wsiautor-v4/ws'; const headers = { 'Content-Type': 'application/soap+xml;charset=UTF-8', 'soapAction': 'https://wsiautor.uni-login.dk/hentDataAftaler', }; // example data const xml = ` &lt;soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:uni="https://uni-login.dk"&gt; &lt;soap:Header/&gt; &lt;soap:Body&gt; &lt;uni:hentDataAftaler&gt; &lt;uni:wsBrugerid&gt;?&lt;/uni:wsBrugerid&gt; &lt;uni:wsPassword&gt;?&lt;/uni:wsPassword&gt; &lt;/uni:hentDataAftaler&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt; `; // usage of module soapRequest(url, headers, xml).then(({response: {body, statusCode}}) =&gt; { console.log(body); console.log(statusCode); }).catch((errorBody) =&gt; { console.error(errorBody); }); </code></pre> </div>

PHP从SOAP返回对象

<div class="post-text" itemprop="text"> <p>How to store SOAP returned value in PHP?</p> <p>My PHP code using SOAP.</p> <pre><code> &lt;?php $client = new SoapClient("http://rscnagahrd/OracleWS/Oracle.asmx?WSDL"); $result = $client-&gt;getFoods(); echo $result; ?&gt; </code></pre> <p>When I try to run the application I get the error:</p> <blockquote> <p>Catchable fatal error: Object of class stdClass could not be converted to string in C:\apache\htdocs\food.php on line 4</p> </blockquote> <p>I am doing this so that I could later parse the xml code:</p> <pre><code>$dom = new DomDocument; $dom-&gt;preserveWhiteSpace = FALSE; $dom-&gt;loadXML($result); $params = $dom-&gt;getElementsByTagName('FOOD_ID'); foreach ($params as $param) { echo $param -&gt; nodeValue, PHP_EOL; } </code></pre> </div>

为soap请求php创建参数数组

<div class="post-text" itemprop="text"> <p>I want to create a soap request, I've xml request sample but the array that I've created getting wrong structure.</p> <p>The Sample that should my array should be like:</p> <pre><code>&lt;soap:Envelope xmlns:xsi="XMLSchema-instance" xmlns:xsd="XMLSchema" xmlns:soap="envelope"&gt; &lt;soap:Header&gt; &lt;AuthenticationSoapHeader xmlns="http://example.com/ws"&gt; &lt;WSUserName&gt;USERNAME&lt;/WSUserName&gt; &lt;WSPassword&gt;PASSWORD&lt;/WSPassword&gt; &lt;/AuthenticationSoapHeader&gt; &lt;/soap:Header&gt; &lt;soap:Body&gt; &lt;SearchFlight xmlns="http://example.com/ws"&gt; &lt;OTA_AirLowFareSearchRQ ProviderType="OnlyAmadeus" RefundableType="OnlyRefundable" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="0"&gt; &lt;OriginDestinationInformation&gt; &lt;DepartureDateTime&gt;2019-02-03T00:01:00&lt;/DepartureDateTime&gt; &lt;OriginLocation LocationCode="FRA" /&gt; &lt;DestinationLocation LocationCode="AMS" /&gt; &lt;/OriginDestinationInformation&gt; &lt;TravelerInfoSummary&gt; &lt;AirTravelerAvail&gt; &lt;PassengerTypeQuantity Code="ADT" /&gt; &lt;/AirTravelerAvail&gt; &lt;/TravelerInfoSummary&gt; &lt;/OTA_AirLowFareSearchRQ&gt; &lt;/SearchFlight&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt; </code></pre> <p>I've tried the following:</p> <pre><code>$client = new SoapClient($soapURL,array("trace"=&gt;1)); $auth = array( 'WSUserName' =&gt; 'USERNAME', 'WSPassword' =&gt; 'PASSWORD' ); $header = new SoapHeader($location,'authentification',$auth,false); $client-&gt;__setSoapHeaders($header); $params = array( 'OTA_AirLowFareSearchRQ' =&gt; array( '_' =&gt; array( 'OriginDestinationInformation' =&gt; array( 'DepartureDateTime' =&gt; '2019-02-25T00:01:00', 'OriginLocation' =&gt; array( '_' =&gt; '', 'LocationCode' =&gt; 'FRA' ), 'DestinationLocation' =&gt; array( '_' =&gt; '', 'LocationCode' =&gt; 'AMS' ) ), 'TravelerInfoSummary' =&gt; array( 'AirTravelerAvail' =&gt; array( 'PassengerTypeQuantity' =&gt; array( '_' =&gt; '', 'Code' =&gt; 'ADT' ) ) ) ), 'ProviderType' =&gt; 'OnlyAmadeus', 'RefundableType' =&gt; 'AllFlights' ) ); $searchResponse = $client-&gt;__soapCall("SearchFlight", array($params)); var_dump($client-&gt;__getLastRequest()); </code></pre> <p>But I'm getting the following which is wrong:</p> <pre><code>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://example.com/ws" xmlns:ns2="http://example.com/ws"&gt; &lt;SOAP-ENV:Header&gt; &lt;ns2:authentification&gt; &lt;item&gt; &lt;key&gt;WSUserName&lt;/key&gt;&lt;value&gt;USERNAME&lt;/value&gt; &lt;/item&gt; &lt;item&gt; &lt;key&gt;WSPassword&lt;/key&gt;&lt;value&gt;PASSWORD&lt;/value&gt; &lt;/item&gt; &lt;/ns2:authentification&gt; &lt;/SOAP-ENV:Header&gt; &lt;SOAP-ENV:Body&gt; &lt;ns1:SearchFlight&gt; &lt;ns1:OTA_AirLowFareSearchRQ RefundableType="AllFlights" ProviderType="OnlyAmadeus"/&gt; &lt;/ns1:SearchFlight&gt; &lt;/SOAP-ENV:Body&gt; &lt;/SOAP-ENV:Envelope&gt; </code></pre> <p>How Can I make it work, please consider the header authentication as in the example</p> </div>

webService项目中,如何在接收到请求之后自动打印出请求和响应对象的信息

![1](https://img-ask.csdn.net/upload/201603/15/1458031151_740015.png) 怎么才能像这样在每次webService接收到请求之后打印出相关request和response的信息?找了好久不知道怎么配置的,请各位大神解答一下。

webservice发送soap请求时返回xml报文中显示must be a method name element,求解:

请求返回XML: <soap:Body> <soap:Fault> <fautlcode>soap:Client</fautlcode> <fautlstring>There must be a method name element</fautlstring> </soap:Fault> </soap:Body> 请求方法如下: ![图片说明](https://img-ask.csdn.net/upload/201906/25/1561430302_804824.jpg)

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

点沙成金:英特尔芯片制造全过程揭密

“亚马逊丛林里的蝴蝶扇动几下翅膀就可能引起两周后美国德州的一次飓风……” 这句人人皆知的话最初用来描述非线性系统中微小参数的变化所引起的系统极大变化。 而在更长的时间尺度内,我们所生活的这个世界就是这样一个异常复杂的非线性系统…… 水泥、穹顶、透视——关于时间与技艺的蝴蝶效应 公元前3000年,古埃及人将尼罗河中挖出的泥浆与纳特龙盐湖中的矿物盐混合,再掺入煅烧石灰石制成的石灰,由此得来了人...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

你打算用Java 8一辈子都不打算升级到Java 14,真香

我们程序员应该抱着尝鲜、猎奇的心态,否则就容易固步自封,技术停滞不前。

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《经典算法案例》01-08:如何使用质数设计扫雷(Minesweeper)游戏

我们都玩过Windows操作系统中的经典游戏扫雷(Minesweeper),如果把质数当作一颗雷,那么,表格中红色的数字哪些是雷(质数)?您能找出多少个呢?文中用列表的方式罗列了10000以内的自然数、质数(素数),6的倍数等,方便大家观察质数的分布规律及特性,以便对算法求解有指导意义。另外,判断质数是初学算法,理解算法重要性的一个非常好的案例。

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

一文带你入门Java Stream流,太强了

两个星期以前,就有读者强烈要求我写一篇 Java Stream 流的文章,我说市面上不是已经有很多了吗,结果你猜他怎么说:“就想看你写的啊!”你看你看,多么苍白的喜欢啊。那就“勉为其难”写一篇吧,嘻嘻。 单从“Stream”这个单词上来看,它似乎和 java.io 包下的 InputStream 和 OutputStream 有些关系。实际上呢,没毛关系。Java 8 新增的 Stream 是为...

立即提问
相关内容推荐