gotshub / js-soap-client Goto Github PK
View Code? Open in Web Editor NEWJavaScript SOAP Client
JavaScript SOAP Client
It is quite common for soap request/response to have null properties.
The _serialize method crashes attempting to serialize "null" as an object.
An explicit check may be needed before attempting to determine if the object is a "date" or an "array".
You claim this is CC licensed, but you forked it from a GPL project. Did you have permission to relicense the fork?
Make SOAPClient a class. Note that this would be a breaking change.
When array size is 1,soapclient didn't resolving it as array?I defined xsd as follow,did I defined wrong?:
<xs:element name="getPlantIncidentsResponse"> <xs:complexType> <xs:sequence> <xs:element name="Incidents" type="tns:plantIncident" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element>
<xs:complexType name="plantIncident">
<xs:sequence>
<xs:element name="id" type="xs:string"/>
<xs:element name="createDate" type="xs:string"/>
<xs:element name="Location" type="xs:string"/>
<xs:element name="RootCause" type="xs:string"/>
</xs:sequence>
</xs:complexType>
The GET request to retrieve the wsdl information should use the username/password credentials, if they are set, include the basic authentication header in the request as it does for the POST request.
This code at or about line 143
else
for(var p in o)
{
s += "<" + t + ">";
s += SOAPClientParameters._serialize(p, o[p]);
s += "</" + t + ">";
}
causes each property to be wrapped in the start/end tag of the outer object. The start/end tags should be outside the "for" loop.
SOAP-ENC:array and SOAP-ENC:arrayType are not supported extensions with WCF services.
The WCF service can be modified to support this extension but the default is to use a standard XSD complex sequence, and you may not have access to the server-side code to change the default handling in WCF (or convince the server side developers to do so).
To handle this, I think the _serialize function needs access to the wsdl types in order to determine the proper handling of arrays.
Note, I am not 100% sure, but it appears that if SOAP-ENC:array is used then the actual node names of the items in the array may be irrelevant, but with the WCF complex sequence, the node names are important and can only be determined from the wsdl.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.