开发者

How to consume webservice with complex ksoap2 mailing envelope correctly?

I need to send to the webservice that envelope:

` <? 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&开发者_如何学Gogt;`

Where "string" in <caseFilters> string </ caseFilters> filter should be replaced by that desire.

More like this

`

<? 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>`

the most I was able to make it in this 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>`

But I get a server error, refusing the envelope, the following error:

`

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`

I think these can be id = "o0" c: root = "1" or i: type = "n0: Process"

I need help to correctly assemble the envelope ...

someone there willing to help me?

Thank you.


Your envelope XML looks OK, and also from the stack trace looks like getCasesAsString() is actually called. What is that XML you're trying to parse inside getCasesAsString()? Looks like it is not syntactically correct - or maybe it is, but you're using a weird parser which thinks differently.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜