访问wsdl的接口

本文介绍了如何访问和测试WSDL文件的接口,具体包括通过http://10.62.226.150:10000/esb/webservice/Jizhandabiao?wsdl获取文件内容,并演示了对其中的createsite接口进行测试的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

访问wsdl文件的接口

1.http://10.62.226.150:10000/esb/webservice/Jizhandabiao?wsdl 文件内容

  <? xml version="1.0" encoding="UTF-8" ?>
- < wsdl:definitions name =" JizhandabiaoImplService " targetNamespace =" http://webservice.rpc.other.web.demo.g4studio.org/ " xmlns:ns1 =" http://cxf.apache.org/bindings/xformat " xmlns:soap =" http://schemas.xmlsoap.org/wsdl/soap/ " xmlns:tns =" http://webservice.rpc.other.web.demo.g4studio.org/ " xmlns:wsdl =" http://schemas.xmlsoap.org/wsdl/ " xmlns:xsd =" http://www.w3.org/2001/XMLSchema " >
- < wsdl:types >
- < xs:schema elementFormDefault =" unqualified " targetNamespace =" http://webservice.rpc.other.web.demo.g4studio.org/ " version =" 1.0 " xmlns:tns =" http://webservice.rpc.other.web.demo.g4studio.org/ " xmlns:xs =" http://www.w3.org/2001/XMLSchema " >
  < xs:element name =" IsAlive " type =" tns:IsAlive " />
  < xs:element name =" IsAliveResponse " type =" tns:IsAliveResponse " />
  < xs:element name =" createsite " type =" tns:createsite " />
  < xs:element name =" createsiteResponse " type =" tns:createsiteResponse " />
- < xs:complexType name =" IsAlive " >
  < xs:sequence />
  </ xs:complexType >
- < xs:complexType name =" IsAliveResponse " >
- < xs:sequence >
  < xs:element minOccurs =" 0 " name =" return " type =" xs:string " />
  </ xs:sequence >
  </ xs:complexType >
- < xs:complexType name =" createsite " >
- < xs:sequence >
  < xs:element form =" qualified " minOccurs =" 0 " name =" xmlContent " type =" xs:string " />
  </ xs:sequence >
  </ xs:complexType >
- < xs:complexType name =" createsiteResponse " >
- < xs:sequence >
  < xs:element minOccurs =" 0 " name =" return " type =" xs:string " />
  </ xs:sequence >
  </ xs:complexType >
  </ xs:schema >
  </ wsdl:types >
- < wsdl:message name =" IsAlive " >
  < wsdl:part element =" tns:IsAlive " name =" parameters " />
  </ wsdl:message >
- < wsdl:message name =" IsAliveResponse " >
  < wsdl:part element =" tns:IsAliveResponse " name =" parameters " />
  </ wsdl:message >
- < wsdl:message name =" createsiteResponse " >
  < wsdl:part element =" tns:createsiteResponse " name =" parameters " />
  </ wsdl:message >
- < wsdl:message name =" createsite " >
  < wsdl:part element =" tns:createsite " name =" parameters " />
  </ wsdl:message >
- < wsdl:portType name =" Jizhandabiao " >
- < wsdl:operation name =" IsAlive " >
  < wsdl:input message =" tns:IsAlive " name =" IsAlive " />
  < wsdl:output message =" tns:IsAliveResponse " name =" IsAliveResponse " />
  </ wsdl:operation >
- < wsdl:operation name =" createsite " >
  < wsdl:input message =" tns:createsite " name =" createsite " />
  < wsdl:output message =" tns:createsiteResponse " name =" createsiteResponse " />
  </ wsdl:operation >
  </ wsdl:portType >
- < wsdl:binding name =" JizhandabiaoImplServiceSoapBinding " type =" tns:Jizhandabiao " >
  < soap:binding style =" document " transport =" http://schemas.xmlsoap.org/soap/http " />
- < wsdl:operation name =" IsAlive " >
  < soap:operation soapAction =" " style =" document " />
- < wsdl:input name =" IsAlive " >
  < soap:body use =" literal " />
  </ wsdl:input >
- < wsdl:output name =" IsAliveResponse " >
  < soap:body use =" literal " />
  </ wsdl:output >
  </ wsdl:operation >
- < wsdl:operation name =" createsite " >
  < soap:operation soapAction =" " style =" document " />
- < wsdl:input name =" createsite " >
  < soap:body use =" literal " />
  </ wsdl:input >
- < wsdl:output name =" createsiteResponse " >
  < soap:body use =" literal " />
  </ wsdl:output >
  </ wsdl:operation >
  </ wsdl:binding >
- < wsdl:service name =" JizhandabiaoImplService " >
- < wsdl:port binding =" tns:JizhandabiaoImplServiceSoapBinding " name =" JizhandabiaoImplPort " >
  < soap:address location =" http://10.62.226.150:10000/esb/webservice/Jizhandabiao " />
  </ wsdl:port >
  </ wsdl:service >
  </ wsdl:definitions >

2.测试访问里面createsite接口

/*public static void main(String[] args) throws Exception {

 
String xml="<?xml version=\"1.0\" encoding=\"utf-8\"?>"+
"<root>" +
"<basestation_id>99999999199892483</basestation_id>" +
"<basestation_name>test增加</basestation_name>" +
"<enodebID>109597</enodebID> " +
"<bsc>0</bsc>" +
"<btsid>1113848</btsid>" +
"<type>4G</type>" +
 
"</root> ";
 
String url = "http://10.62.226.150:10000/esb/webservice/Jizhandabiao?wsdl";
Service serv = new Service();
Call call = (Call) serv.createCall();
call.setTargetEndpointAddress(url);
call.setOperationName(new QName("http://webservice.rpc.other.web.demo.g4studio.org/","createsite"));
call.addParameter(new QName("http://webservice.rpc.other.web.demo.g4studio.org/", "xmlContent"), XMLType.XSD_STRING, Class.forName("java.lang.String"), ParameterMode.IN );
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
System.out.println("推送的xml---"+xml);
String str=(String) call.invoke(new Object[] {xml});
System.out.println(str+"----------------推送成功");
}*/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值