Reputation: 182
I am using wso2/soap package from ballerina central to create a simple soap connector.
import wso2/soap;
import ballerina/io;
endpoint soap:Client soapClient {
clientConfig:{
url: "http://localhost:9000"
}
};
function main (string... args) {
xml body = xml `<m0:getQuote xmlns:m0="http://services.samples">
<m0:request>
<m0:symbol>WSO2</m0:symbol>
</m0:request>
</m0:getQuote>`;
soap:SoapRequest soapRequest = {
soapAction: "urn:getQuote",
payload: body
};
var details = soapClient->
sendReceive("/services/SimpleStockQuoteService",soapRequest);
match details {
soap:SoapResponse soapResponse => io:println(soapResponse);
soap:SoapError soapError => io:println(soapError);
}
}
This code was initially building and running successfully with ballerina-0.975.0 version. Recently I have installed ballerina-0.980.0. After this I get the following error when trying to build the code.
Compiling source
package:0.0.0
ballerina: format error: ballerina: unsupported program file version 18
This occurs as I am trying to build using 0.980.0 and old the wso2/soap package is used from the home repository. Normal logic is, we check for the package in the home folder and if not found then we fetch from the ballerina central repository. This logic fails in this scenario as we are using a newer ballerina version. Newer ballerina version tries to use the existing soap package downloaded in the home folder and throws an error. Instead we should fetch the newer version of soap package from the ballerina central.
Upvotes: 0
Views: 142
Reputation: 1122
The issue will be fixed in future releases. For the time being, you can pull the latest version of the connector (which is compatible with Ballerina 0.980.0) using the following command and resolve the issue.
ballerina pull wso2/soap
Upvotes: 1