Hello,
I'm integrating with the following webservice, of an accounting application:
https://c1.twinfield.com/webservices...sxml.asmx?wsdl
From their documentation, I should be able to send the following SOAP envelope:
When I try to set the SessionID in the header using this code:
I get the following warning:
The wsdl url does correctly describe the SessionID type in the header right? The developer console's 'generate sample request message' also ignores the SessionID. What am I doing wrong?
A second question I have is: this webservice has a 'free form xml body', eg, everything inside the element <xmlRequest> can contain any form of XML . If I send this, it gets escaped. Is there a way to prevent escaping? (so if I understand it correctly the webservice is kind of under-specified)
Hope someone can help me, i'm not so experienced with SOAP.
I'm integrating with the following webservice, of an accounting application:
https://c1.twinfield.com/webservices...sxml.asmx?wsdl
From their documentation, I should be able to send the following SOAP envelope:
Code:
<?xml version="1.0" encoding="utf-16"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XmlSchema-instance" xmlns:xsd="http://www.w3.org/2001/XmlSchema"> <soap:Header> <Header MyAttribute="" xmlns="http://www.twinfield.com/"> <SessionID>61587139-7938-4dca-84f7-625524d7a8fa</SessionID> </Header> </soap:Header> <soap:Body> <ProcessXmlString xmlns="http://www.twinfield.com/"> <xmlRequest><![CDATA[<list><type>offices</type></list>]]></xmlRequest> </ProcessXmlString> </soap:Body> </soap:Envelope>
Code:
WSRequest req = new WSRequest(); Map<String,Object> values = new HashMap<String,Object>(); values.put("SessionID", sessionId); req.setHeaderData(values); service.callOperation("ProcessXmlString", values, "//tf:ProcessXmlStringResult", new WebServiceCallback(){ @Override public void execute(Object[] data, JavaScriptObject xmlDoc, RPCResponse rpcResponse, JavaScriptObject wsRequest) { }, req);
Code:
[ERROR] [generatedcode] - 10:10:31.261:MUP0:WARN:XSElement:ProcessXmlString:headerData passed for SOAP header partName: SessionID, no schema available, not outputting
A second question I have is: this webservice has a 'free form xml body', eg, everything inside the element <xmlRequest> can contain any form of XML . If I send this, it gets escaped. Is there a way to prevent escaping? (so if I understand it correctly the webservice is kind of under-specified)
Hope someone can help me, i'm not so experienced with SOAP.
Comment