Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/356.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 如何正确使用带有复杂ksoap2邮件信封的Web服务?_Java_Android - Fatal编程技术网

Java 如何正确使用带有复杂ksoap2邮件信封的Web服务?

Java 如何正确使用带有复杂ksoap2邮件信封的Web服务?,java,android,Java,Android,我需要向Web服务发送该信封: ` <? xml version = "1.0" encoding = "utf-8"?> <soap: Envelope xmlns: xsi = "http://wwwenter code here.w3.org/2001/XMLSchema-instance" xmlns: xsd = "http://www.w3.org/2001/XMLSchema" xmlns: soap = "http : / / schemas.xmlsoap.

我需要向Web服务发送该信封:

` <? xml version = "1.0" encoding = "utf-8"?>
 <soap: Envelope xmlns: xsi = "http://wwwenter code here.w3.org/2001/XMLSchema-instance" xmlns: xsd = "http://www.w3.org/2001/XMLSchema" xmlns: soap = "http : / / schemas.xmlsoap.org / soap / envelope / ">
    <soap:Body>
         <getCasesAsString xmlns="http://tempuri.org/">
           <caseFilters> string </ caseFilters>
         </ getCasesAsString>
    </soap: Body>
 </soap: Envelope>`
我认为这些可以是id=“o0”c:root=“1”或I:type=“n0:Process”

我需要帮助来正确组装信封

有人愿意帮助我吗


谢谢。

您的信封XML看起来不错,而且从堆栈跟踪来看,它看起来像是实际调用了
getCasesAsString()
。您试图在getCasesAsString()中解析的XML是什么?看起来它在语法上不正确——或者可能是,但您使用的是一个奇怪的解析器,它的思维方式不同

<? 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>
       <getCasesAsString xmlns="http://tempuri.org/">
         <caseFilters>
            <processName>process_name</ processName>
          </ caseFilters>
       </ getCasesAsString>
     </ soap: Body>
  </ soap: Envelope>`
<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">
  <v:Header />
    <v:Body>
       <getCasesAsString xmlns="http://tempuri.org/" id="o0" c:root="1">
         <caseFilters i:type="n0:Process" xmlns:n0="http://tempuri.org/">
           <processName i:type="d:string">PROCESS_NAME</processName>   
         </caseFilters>
       </getCasesAsString>
    </v:Body>
  </v:Envelope>`
SoapFault - faultcode: 'soap: Server' faultstring:    System.Web.Services.Protocols.SoapException: The server could not process the request. ---> System.Xml.XmlException: invalid data at the root level. Line 1, position 1.
    in System.Xml.XmlTextReaderImpl.Throw (Exception e)
    in System.Xml.XmlTextReaderImpl.Throw (String res, String arg)
    in System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace ()
    in System.Xml.XmlTextReaderImpl.ParseDocumentContent ()
    in System.Xml.XmlTextReaderImpl.Read ()
    in System.Xml.XmlLoader.Load (XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
    in System.Xml.XmlDocument.Load (XmlReader reader)
    in System.Xml.XmlDocument.LoadXml (String xml)
    in BizAgi.Web.Services.CWorkflowSOAWrapper.getCasesAsString (String caseFilters)
    --- End of stack trace --- inner exception 'faultactor:' null 'detail: org.kxml2.kdom.Node @ 4396c958`