Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在java中使用外部基于SOAP的web服务?_Java_Xml_Webservice Client - Fatal编程技术网

如何在java中使用外部基于SOAP的web服务?

如何在java中使用外部基于SOAP的web服务?,java,xml,webservice-client,Java,Xml,Webservice Client,我需要使用基于SOAP的Web服务 <?xml version="1.0" encoding="utf-8" ?> <wsdl:definitions targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmln

我需要使用基于SOAP的Web服务

<?xml version="1.0" encoding="utf-8" ?> 
<wsdl:definitions targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style"   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:n1="urn:sap-com:document:sap:rfc:functions">
 <wsdl:documentation>
 <sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl" /> 
 </wsdl:documentation>
 <wsp:UsingPolicy wsdl:required="true" /> 
 <wsp:Policy wsu:Id="IF_IF__-infype_-SOAP_WS_SC_SEARCH">
 <sapsession:Session xmlns:sapsession="http://www.sap.com/webas/630/soap/features/session/">
<sapsession:enableSession>false</sapsession:enableSession> 
</sapsession:Session>
</wsp:Policy>
<wsp:Policy wsu:Id="OP_IF_OP__-infype_-rfcShopcartSoapWs">
<sapcomhnd:enableCommit xmlns:sapcomhnd="http://www.sap.com/NW05/soap/features/commit/">false</sapcomhnd:enableCommit> 
<sapblock:enableBlocking xmlns:sapblock="http://www.sap.com/NW05/soap/features/blocking/">true</sapblock:enableBlocking> 
  <saptrhnw05:required xmlns:saptrhnw05="http://www.sap.com/NW05/soap/features/transaction/">no</saptrhnw05:required> 
  <saprmnw05:enableWSRM xmlns:saprmnw05="http://www.sap.com/NW05/soap/features/wsrm/">false</saprmnw05:enableWSRM> 
</wsp:Policy>
<wsdl:types>
<xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:rfc:functions">
<xsd:simpleType name="byte16">
<xsd:restriction base="xsd:base64Binary">
 <xsd:maxLength value="16" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char1">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="1" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char10">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="10" /> 
 </xsd:restriction>
 </xsd:simpleType>
<xsd:simpleType name="char12">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="12" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char14">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="14" /> 
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char2">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="2" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char20">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="20" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char21">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="21" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char220">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="220" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char30">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="30" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char32">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="32" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char40">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="40" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char50">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="50" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char54">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="54" /> 
 </xsd:restriction>
 </xsd:simpleType>
   <xsd:simpleType name="char60">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="60" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char8">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="8" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="char80">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="80" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="cuky5">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="5" /> 
 </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="curr13.2">
 <xsd:restriction base="xsd:decimal">
 <xsd:totalDigits value="13" /> 
 <xsd:fractionDigits value="2" /> 
  </xsd:restriction>
  </xsd:simpleType>
 <xsd:simpleType name="curr15.2">
 <xsd:restriction base="xsd:decimal">
 <xsd:totalDigits value="15" /> 
 <xsd:fractionDigits value="2" /> 
 </xsd:restriction>
 </xsd:simpleType>
  <xsd:simpleType name="date">
  <xsd:restriction base="xsd:date">
  <xsd:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}" /> 
  </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="numeric10">
  <xsd:restriction base="xsd:string">
  <xsd:maxLength value="10" /> 
  <xsd:pattern value="\d*" /> 
  </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="numeric2">
  <xsd:restriction base="xsd:string">
  <xsd:maxLength value="2" /> 
  <xsd:pattern value="\d*" /> 
  </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="numeric3">
  <xsd:restriction base="xsd:string">
  <xsd:maxLength value="3" /> 
  <xsd:pattern value="\d*" /> 
   </xsd:restriction>
  </xsd:simpleType>
 <xsd:simpleType name="numeric6">
 <xsd:restriction base="xsd:string">
  <xsd:maxLength value="6" />
  <xsd:pattern value="\d*" /> 
 </xsd:restriction>
 </xsd:simpleType>
  <xsd:simpleType name="quantum13.3">
 <xsd:restriction base="xsd:decimal">
 <xsd:totalDigits value="13" /> 
 <xsd:fractionDigits value="3" /> 
  </xsd:restriction>
 </xsd:simpleType>
 <xsd:simpleType name="unit3">
 <xsd:restriction base="xsd:string">
 <xsd:maxLength value="3" /> 
 </xsd:restriction>
 </xsd:simpleType>
  <xsd:complexType name="I">
 <xsd:sequence /> 
 </xsd:complexType>
 </xsd:schema>
 <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:n0="urn:sap-com:document:sap:rfc:functions">
 <xsd:import namespace="urn:sap-com:document:sap:rfc:functions" /> 
 <xsd:complexType name="Bapiret2">
 <xsd:sequence>
 <xsd:element name="Type" type="n0:char1" /> 
 <xsd:element name="Id" type="n0:char20" /> 
 <xsd:element name="Number" type="n0:numeric3" /> 
 <xsd:element name="Message" type="n0:char220" /> 
 <xsd:element name="LogNo" type="n0:char20" /> 
 <xsd:element name="LogMsgNo" type="n0:numeric6" /> 
 <xsd:element name="MessageV1" type="n0:char50" /> 
 <xsd:element name="MessageV2" type="n0:char50" /> 
 <xsd:element name="MessageV3" type="n0:char50" /> 
 <xsd:element name="MessageV4" type="n0:char50" /> 
 <xsd:element name="Parameter" type="n0:char32" /> 
 <xsd:element name="Row" type="xsd:int" /> 
 <xsd:element name="Field" type="n0:char30" /> 
 <xsd:element name="System" type="n0:char10" /> 
 </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="_-infype_-strScLst">
 <xsd:sequence>
 <xsd:element name="ScGuid" type="n0:byte16" /> 
 <xsd:element name="ScNo" type="n0:char10" /> 
 <xsd:element name="ScName" type="n0:char40" /> 
 <xsd:element name="ItemGuid" type="n0:byte16" /> 
 <xsd:element name="ItemNo" type="n0:numeric10" /> 
 <xsd:element name="ItemName" type="n0:char40" /> 
 <xsd:element name="NetPrice" type="n0:curr13.2" /> 
 <xsd:element name="ItemTotal" type="n0:curr15.2" /> 
 <xsd:element name="Currency" type="n0:cuky5" /> 
 <xsd:element name="TotalValue" type="n0:curr15.2" /> 
 <xsd:element name="PoNo" type="n0:char10" /> 
 <xsd:element name="ConfNo" type="n0:char10" /> 
 <xsd:element name="ScStatus" type="n0:numeric2" /> 
 <xsd:element name="ScStatusDesc" type="n0:char60" /> 
 <xsd:element name="ProductCat" type="n0:char20" /> 
 <xsd:element name="ProductCatDesc" type="n0:char80" /> 
 <xsd:element name="Quantity" type="n0:quantum13.3" /> 
 <xsd:element name="Uom" type="n0:unit3" /> 
 <xsd:element name="ProductType" type="n0:char2" /> 
 <xsd:element name="Purchteam" type="n0:char8" /> 
 <xsd:element name="ProductId" type="n0:char54" /> 
 <xsd:element name="CatalogId" type="n0:char20" /> 
 <xsd:element name="Catalogitem" type="n0:char40" /> 
 <xsd:element name="SupplierId" type="n0:char32" /> 
 <xsd:element name="SupplierName" type="n0:char40" /> 
 <xsd:element name="Flag" type="n0:char1" /> 
 <xsd:element name="ScNoCumItemno" type="n0:char21" /> 
 <xsd:element name="CreatedAt" type="n0:char10" /> 
 <xsd:element name="CreatedBy" type="n0:char12" /> 
  <xsd:element name="ChangedAt" type="n0:char10" /> 
  <xsd:element name="ChangedBy" type="n0:char12" /> 
  </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="_-infype_-strRelatedDoc">
 <xsd:sequence>
 <xsd:element name="SourceDoc" type="n0:char10" /> 
 <xsd:element name="RelatedDoc" type="n0:char10" /> 
 </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="_-infype_-strDocumentSrch">
 <xsd:sequence>
 <xsd:element name="DocNo" type="n0:char10" /> 
 <xsd:element name="DocName" type="n0:char40" /> 
 <xsd:element name="DocDateFrom" type="n0:date" /> 
 <xsd:element name="DocDateTo" type="n0:date" /> 
 </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="_-infype_-strStatus">
 <xsd:sequence>
 <xsd:element name="Status" type="xsd:int" /> 
 </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="TableOfBapiret2">
 <xsd:sequence>
 <xsd:element name="item" type="tns:Bapiret2" minOccurs="0" maxOccurs="unbounded" /> 
 </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="TableOf_-infype_-strScLst">
 <xsd:sequence>
 <xsd:element name="item" type="tns:_-infype_-strScLst" minOccurs="0" maxOccurs="unbounded" /> 
  </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="TableOf_-infype_-strRelatedDoc">
  <xsd:sequence>
  <xsd:element name="item" type="tns:_-infype_-strRelatedDoc" minOccurs="0" maxOccurs="unbounded" /> 
  </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="TableOf_-infype_-strStatus">
   <xsd:sequence>
  <xsd:element name="item" type="tns:_-infype_-strStatus" minOccurs="0" maxOccurs="unbounded" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:schema>
  </wsdl:types>
  <wsdl:message name="_-infype_-rfcShopcartSoapWs">
  <wsdl:part name="EtReturn" type="tns:TableOfBapiret2" /> 
  <wsdl:part name="EtScList" type="tns:TableOf_-infype_-strScLst" /> 
  <wsdl:part name="EtScPo" type="tns:TableOf_-infype_-strRelatedDoc" /> 
  <wsdl:part name="IsScSearch" type="tns:_-infype_-strDocumentSrch" /> 
  <wsdl:part name="ItScStatus" type="tns:TableOf_-infype_-strStatus" /> 
  <wsdl:part name="IvApprover" type="n1:char1" /> 
  <wsdl:part name="IvBuyer" type="n1:char1" /> 
  <wsdl:part name="IvCategoryId" type="n1:char20" /> 
  <wsdl:part name="IvCompletedCarts" type="n1:char1" /> 
  <wsdl:part name="IvDashboard" type="n1:char1" /> 
  <wsdl:part name="IvDbSearch" type="n1:char1" /> 
  <wsdl:part name="IvItemDesc" type="n1:char40" /> 
  <wsdl:part name="IvNoOfRecords" type="xsd:int" /> 
  <wsdl:part name="IvPoNumber" type="n1:char10" /> 
  <wsdl:part name="IvPurcGrp" type="n1:char14" /> 
  <wsdl:part name="IvPurcOrg" type="n1:char14" /> 
  <wsdl:part name="IvRequester" type="n1:char10" /> 
  <wsdl:part name="IvSupplier" type="n1:char10" /> 
  <wsdl:part name="IvTeamCart" type="n1:char1" /> 
  <wsdl:part name="IvTeamMember" type="n1:char12" /> 
  <wsdl:part name="IvUser" type="n1:char12" /> 
  <wsdl:part name="IvWithConf" type="n1:char1" /> 
  <wsdl:part name="IvWithPo" type="n1:char1" /> 
  </wsdl:message>
  <wsdl:message name="_-infype_-rfcShopcartSoapWsResponse">
  <wsdl:part name="EtReturn" type="tns:TableOfBapiret2" /> 
  <wsdl:part name="EtScList" type="tns:TableOf_-infype_-strScLst" /> 
  <wsdl:part name="EtScPo" type="tns:TableOf_-infype_-strRelatedDoc" /> 
  <wsdl:part name="EvCount" type="n1:I" /> 
  <wsdl:part name="ItScStatus" type="tns:TableOf_-infype_-strStatus" /> 
  </wsdl:message>
  <wsdl:portType name="_-infype_-SOAP_WS_SC_SEARCH">
  <wsp:Policy>
  <wsp:PolicyReference URI="#IF_IF__-infype_-SOAP_WS_SC_SEARCH" /> 
  </wsp:Policy>
  <wsdl:operation name="_-infype_-rfcShopcartSoapWs">
  <wsp:Policy>
   <wsp:PolicyReference URI="#OP_IF_OP__-infype_-rfcShopcartSoapWs" /> 
  </wsp:Policy>
  <wsdl:input message="tns:_-infype_-rfcShopcartSoapWs" /> 
  <wsdl:output message="tns:_-infype_-rfcShopcartSoapWsResponse" /> 
  </wsdl:operation>
  </wsdl:portType>
  </wsdl:definitions>

假的
假的
真的
不
假的
出于同样的原因,我在Eclipse中创建了一个webservice客户端,其结果是出现了以下数量的类,其中一些类的结构如下所示:

  • _Infype_标准文档SRCH
  • _inType_StrRelatedDoc
  • _inType_StrScLst
  • _intype_StrStatus
  • Bapiret2和I.java

我能够与URL建立连接,但无法从后端获取XML中列出的参数,如itemNo、itemName等。任何人都可以告诉我如何与上述类交互并获得所需的参数及其各自的值。

EclipseWeb服务客户端工具必须生成一些jsp页面。检查TestClient.jsp并输入值,然后查看得到的响应

它没有为我显示这样的jsp页面。它只生成了inType\u StrDocumentSrch、•\u inType\u StrRelatedDoc、•\u inType\u StrScLst、•\u inType\u StrStatus、,•Bapiret2和I.java文件。你能告诉我sameI的其他选择吗?我想你应该参考这些基本教程,如果你能解释一下你的问题,帮助你尝试给出一些源代码,以便我们都能解决问题,我已经共享了webservice xml文件……我需要从XML中设置某些参数的值,如IVUSER、IvPONumber等,以获取类•_inType_StrRelatedDoc、•_inType_StrScLst、•_inType_StrStatus的参数值