Webservice地址:http://www.gx96118.com/JobInterface/Services.asmx?op=QueryJobPublisher
webservice定义如下:SOAP 1.1
以下是 SOAP 1.2 请求和响应示例。所显示的占位符需替换为实际值。POST /JobInterface/Services.asmx HTTP/1.1
Host: www.gx96118.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.gx96118.com/QueryJobPublisher"<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.gx96118.com/ContentServices" xmlns:types="http://www.gx96118.com/ContentServices/encodedTypes" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <q1:QueryJobPublisher xmlns:q1="http://www.gx96118.com/QueryJobPublisher/Rpc">
      <hashCode xsi:type="xsd:string">string</hashCode>
      <startTime xsi:type="xsd:string">string</startTime>
      <endTime xsi:type="xsd:string">string</endTime>
      <jobType xsi:type="xsd:string">string</jobType>
      <count xsi:type="xsd:int">int</count>
    </q1:QueryJobPublisher>
  </soap:Body>
</soap:Envelope>

解决方案 »

  1.   

    我的调用代码: String serviceUrl = "http://www.gx96118.com/JobInterface/Services.asmx";
    String jobType = "其他";
    String jobContent = ""; try
    {
    RPCServiceClient serviceClient = new RPCServiceClient();
    Options options = serviceClient.getOptions();
    options.setProperty(Constants.Configuration.ENABLE_MTOM,
    Constants.VALUE_TRUE);
    EndpointReference targetEPR = new EndpointReference(
    serviceUrl);
    options.setTo(targetEPR);
    String methodName = "QueryJobPublisher";
    QName op = new QName("http://tempuri.org/", methodName);  String startTime = "200701171353";
    String endTime = "200701181353"; String hashCode = CommonTools.EncodeByMd5(startTime);
    System.out.println(hashCode);
    int itemCount = 1; Object[] args = new Object[] { hashCode, startTime, endTime,
    jobType, itemCount };
    Class<?>[] returnTypes = new Class[] { GxResult.class };
    Object[] response = serviceClient.invokeBlocking(op, args,
    returnTypes); if (response.length > 0)
    {
    GxResult gxResult = (GxResult) response[0];
    String resultCode = gxResult.getResultCode();
    if (resultCode.trim().equals("0"))
    {
    JobInfo[] jobInfos = gxResult.getJobInfos();
    if (jobInfos.length > 0)
    {
    JobInfo jobInfo = jobInfos[0];
    String title = jobInfo.getTitle();
    String content = jobInfo.getContent();
    jobContent = title + ":" + content;
    } else
    {
    jobContent = "";
    }
    }
    } } catch (Exception e)
    {
    logger.error(e);
    e.printStackTrace();
    }
    finally
    {
    System.out.println(jobContent);
    }
      

  2.   

    执行结果报错如下:
    18:18:04,250 ERROR [GxFieldJobServiceAction] org.apache.axis2.AxisFault: 服务器未能识别 HTTP 头 SOAPAction 的值: urn:anonOutInOp。
    (action.GxFieldJobServiceAction      83  ) org.apache.axis2.AxisFault: 服务器未能识别 HTTP 头 SOAPAction 的值: urn:anonOutInOp。
    org.apache.axis2.AxisFault: 服务器未能识别 HTTP 头 SOAPAction 的值: urn:anonOutInOp。
    at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512)
    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
    at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:548)
    at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
    at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:102)
    at com.a8.tptm.srv.action.GxFieldJobServiceAction.main(GxFieldJobServiceAction.java:196)
    各位大虾救命,明天就要交货了
      

  3.   

    http://www.gx96118.com/JobInterface/Services.asmx?wsdl
    是具体的定义