axis2 客户端

xml:
POST /PIPsIntegration/PIPsIntegration_Btarn_To_UI_Configure_orch_WS_Btarn_Configure_Port.asmx HTTP/1.1
Host: 55.55.55.55
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.rosettanet.org/PIPsIntegration/PIPsIntegration_Btarn_To_UI_Configure_orch_WS_Btarn_Configure_Port/Get_Btarn_Configure"

<?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:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Get_Btarn_Configure xmlns="http://www.rosettanet.org/PIPsIntegration">
      <Req_Get_BTARNCONFIG xmlns="http://PIPsIntegrationSchema.Get_BTARNCONFIG">
        <Get_BTARNCONFIG />
      </Req_Get_BTARNCONFIG>
    </Get_Btarn_Configure>
  </soap:Body>
</soap:Envelope>




axis2
private static EndpointReference reference = new EndpointReference("http://55.55.55.55/PIPsIntegration/PIPsIntegration_Btarn_To_UI_Configure_orch_WS_Btarn_Configure_Port.asmx");		

	
	public static OMElement getOMElement() throws ParseException, AxisFault {
			
		
			ServiceClient sc = new ServiceClient();
			Options op = new Options(); 
			       
			op.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
			op.setTo(reference);
			op.setAction("http://www.rosettanet.org/PIPsIntegration/PIPsIntegration_Btarn_To_UI_Configure_orch_WS_Btarn_Configure_Port/Get_Btarn_Configure");
			sc.setOptions(op);
			System.out.println(getOm1());
			OMElement om = sc.sendReceive(getOm1());
			System.out.println("xml:\n"+om);
            return om;
	}
	public static OMElement getOm1() throws ParseException{
		OMFactory omf = OMAbstractFactory.getOMFactory();
		OMNamespace omn = omf.createOMNamespace("http://www.rosettanet.org/PIPsIntegration", "");
		OMNamespace omn1 = omf.createOMNamespace("http://PIPsIntegrationSchema.Get_BTARNCONFIG", "");
		OMElement method = omf.createOMElement("Get_Btarn_Configure",omn);
		OMElement method1 = omf.createOMElement("Req_Get_BTARNCONFIG",omn1);
		OMElement method2 = omf.createOMElement("Get_BTARNCONFIG",omn1);
 		
 		method1.addChild(method2);
 		method.addChild(method1);
		return method;
	}
	
	public static void main(String args[]) throws AxisFault, ParseException{
		getOMElement();
	}


httpclient 如果不用多线程,需要清除,axis2默认连接数两个...

你可能感兴趣的:(多线程,xml,UI)