SOAP Web Service - Nest array of complex object
Description
Environment
Activity
Michael Offner 21 May 2024 at 19:58
this part of the project is deprecated and only get security fixes, sorry.
Jonathan 9 September 2019 at 15:28Edited
<cfscript>
oDomainAdmin = createObject("webservice","http://mail.welikeit.net/Services/svcDomainAdmin.asmx?wsdl");
GetWeLikeItDomain_Result=oDomainAdmin.GetDomainInfo(AuthUserName="Administrator", AuthPassword="noPassword", domainName="welikeit.net");
writeoutput(GetWeLikeItDomain_Result.getMessage());
</cfscript>
The above code now (as of Lucee 5.3.2.77) returns the expected: Failed to log in instead of the error it did in earlier versions. While I cannot speak for all the other cases, the error associated with my test case is resolved in version Lucee 5.3.2.77.
Eric Kim, if you still have a way to test your reported bug . Please do so, you may find this issue to now be resolved as well.
Another bug appeared for me in the next step: java.lang.NullPointerException error when getting more than just a string back as a reply.
Jonathan 18 September 2017 at 17:05
So I guess I will make a proposal for a fix.
I propose that Lucee "createObject" > "WebService" be configured to handle case mismatch variables returned from a given WebService.
Configuring the WebService result handler to look for returned variables with the proper returned name, but, ignoring case all together, should cause the code I have provided to complete successfully. The successfully written output is the string "Failed to log in." because the user and password are not correct. Regardless, that should serve as a good test because right now the code throws an error.
PS: I upgraded to lucee 5.2.3.35 and the issue is still there. I saw a change in the last changelog and had hopes it may help but it did not.
Jonathan 12 September 2017 at 20:40Edited
I may be having the same, or very similar, issue when running this code:
<cfscript>
oDomainAdmin = createObject("webservice","http://mail.welikeit.net/Services/svcDomainAdmin.asmx?wsdl");
GetWeLikeItDomain_Result=oDomainAdmin.GetDomainInfo(AuthUserName="Administrator", AuthPassword="noPassword", domainName="welikeit.net");
writeoutput(GetWeLikeItDomain_Result.getMessage());
</cfscript>
Even with a failure to log in the result should be: Failed to log in.
After much research it appears that the cause of the error is a case mismatch issue... It is coming back from the webservice with the wrong case for one of the return objects. For example : " variable " is different from " Variable " and " Result " is different case than " result " because the r is upper case in the webservice definition but R in the actual value returned.
Any ideas on how to handle that kind of issue? If it even is the issue?
Details
Assignee
UnassignedUnassignedReporter
Eric KimEric KimPriority
MajorLabels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Affects versions
Details
Details
Assignee
Reporter
Priority
Labels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Hi,
I am trying to find an open source platform to host one of legacy coldfusion application and Lucee came to my attention. I have completed POC and most of application's functionalities are working expect web service integration.
I cannot provide the full WDSL as the web service is an internal web service but sharing schema in order to get support from you.
Below is response object
<element name="validateAddressDetailsResponse"> <complexType> <sequence> <element name="result" nillable="true" type="xsd:string"/> <element name="plAddressOK" nillable="true" type="xsd:boolean"/> <element name="pcAddressError" nillable="true" type="xsd:string"/> <element name="ttAddressMaster" nillable="true" type="S2:validateAddressDetails_ttAddressMasterParam"/> <element name="piAddrMatch" nillable="true" type="xsd:int"/> <element name="plMoreAddress" nillable="true" type="xsd:boolean"/> </sequence> </complexType> </element>
The validate address master param object contains array as below.
<complexType name="validateAddressDetails_ttAddressMasterParam"> <sequence> <element maxOccurs="unbounded" minOccurs="0" name="ttAddressMasterRow" type="S2:validateAddressDetails_ttAddressMasterRow"/>** </sequence> </complexType>
as you can see the web service is designed to return an object that contain array of another complex object.
when consuming this web service. I see validateAddressDetails_ttAddressMasterRow object created under cfclasses/RPC/ lucee folder. However I don't seem to find parent object and also getting below error.
org.apache.axis.AxisFault:
; nested exception is:
org.xml.sax.SAXException:
Unable to create JavaBean of type [La1jutmohj4zmcj.validateAddressDetails_ttAddressMasterRow ;. Missing default constructor?
Error was: java.lang.InstantiationException: [La1jutmohj4zmcj.validateAddressDetails_ttAddressMasterRow
Have anyone experienced a similar issue? if so, have you resolved this issue? It seems like Axis issue. I believe Lucee uses version 1.4 of Axis. It this issue because of Axis or how lucee works with XML?
any help would be appreciated.
Related Lucee Dev portal link: https://dev.lucee.org/t/consuming-web-service-array-of-complex-object-issue/2083
above article is written by me, trying to get some help.
thank you.