From: Andy B. <and...@ra...> - 2014-05-14 14:52:08
|
On 13/05/14 20:09 +0200, Willem de Jong wrote: >Hello Andy, > >The error message indicates that you are calling the function with a value >that somehow wrong (cannot be translated to an XML document that conforms >to the WSDL). Assuming that you are using yaws_soap_lib:call(), what values >are you providing? > >If you have a recent version of erlsom, you will find a reasonably good >type specification of the value that you should use in the .hrl file that >you get if you use yaws_soap_lib:write_hrl(Wsdl, "service.hrl"). > >Regards, >Willem > Thanks so much for the response Willem- When I call initModel and then write the records to a file, it looks like something is missing. In the .hrl file, I have a record and type for the response message for the function I wish to call, ### foo.hrl ### -record('p:getChassisResponse_datatype', {anyAttribs :: anyAttribs(), genericInfo :: 'p:ResponseInformation'() | undefined, chassisData :: 'p:chassis'() | undefined}). -type 'p:getChassisResponse_datatype'() :: #'p:getChassisResponse_datatype'{}. -record('p:getChassis_datatype', {anyAttribs :: anyAttribs()}). -type 'p:getChassis_datatype'() :: #'p:getChassis_datatype'{}. ### end foo.hrl ### I don't see a record for p:getChassis, which seems odd since the other working wsdl examples, there'll be a message and an operation with the same name, and the generated .hrl will have a record and type to match. Some of my coworkers mentioned having problems with this vendor's WSDL, so I suspect that the wsdl is the problem, and I'm hoping someone might spot something obvious. In any case, thanks for the help!! Here's an excerpt from the wsdl: <wsdl:operation name="getChassis"> <wsdl:documentation>Get chassis information</wsdl:documentation> <wsdl:input message="tns:getChassisRequestMsg"/> <wsdl:output message="tns:getChassisResponseMsg"/> <wsdl:fault name="RuntimeFault" message="tns:RuntimeFaultMsg"/> </wsdl:operation> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="getChassis"> <soap:operation soapAction="urn:webservicesapi#getChassis" style="document" /> <wsdl:input> <soap:header message="tns:getChassisRequestMsg" part="request_header_part" use = "literal"/> <soap:body use="literal" parts="parameters" /> </wsdl:input> <wsdl:output> <soap:body use="literal" parts="parameters" /> </wsdl:output> <wsdl:fault name="RuntimeFault"> <soap:fault name="RuntimeFault" use="literal" /> </wsdl:fault> </wsdl:operation> ... <wsdl:message name="getChassisRequestMsg"> <wsdl:part name="parameters" element="tns:getChassis" /> <wsdl:part name="request_header_part" element="tns:RequestHeader"/> </wsdl:message> ... <xsd:element name= "getChassis" type="tns:getChassis_datatype"/> <xsd:complexType name= "getChassisResponse_datatype"> <xsd:sequence> <xsd:element name="genericInfo" type="tns:ResponseInformation" minOccurs="0" maxOccurs="1" /> <xsd:element name="chassisData" type="tns:chassis" minOccurs="0" maxOccurs="1" /> </xsd:sequence> </xsd:complexType> ... > >On Mon, May 12, 2014 at 11:56 PM, Andy Bailey <and...@ra...>wrote: > >> yikes! coming to grips with a new mailer, I pasted the body of the message >> after an inadvertent bounce and neglected to paste the subject. Sorry >> about that! >> >> .andy >> >> On 5/12/14, 3:20 PM, "Andy Bailey" <andy.bailey@RACKSPACE.COM> wrote: >> >> >Hi All, >> > >> > >> > >> > First of all, my tremendous thanks for yaws! I have only been using >> > >> > it briefly, but it has been a huge help in a project I've been >> > >> > working on. >> > >> > >> > >> > I've been attempting to use yaws_soap_lib as a client for a soap API >> > >> > provided by a vendor of networking gear (specifically its a Brocade >> > >> > ADX load balancer). >> > >> > >> > >> > I'm able to retrieve the wsdl for the device via initModel, but when >> > >> > I try to issue a call for any of the methods in the interfaces, I get >> > >> > this error: >> > >> > >> > >> >** exception throw: {error,"Struct doesn't match model: recordtype not >> > >> >expected: p:getSystemClock"} >> > >> > in function erlsom_write:findAlternative/4 >> > >> > (/home/raym7046/projects/fe_lbaas/lib/erlsom/src/erlsom_write.erl, >> > >> > line 357) >> > >> > >> > >> > It appears that we get to that spot if we're unable to find a value >> > >> > matching the called function (in this case p:getChassis) in >> > >> > Alternatives. >> > >> > >> > >> > case lists:keysearch(RecordType, #alt.tp, Alternatives) of >> > >> > >> > >> > Examining Alternatives, I do see: >> > >> > >> > >> >[..., >> > >> > {alt,'p:getChassis','p:getChassis_datatype',[],1,1,true, >> > >> > undefined}, >> > >> > {alt,'p:getChassisResponse', >> > >> > 'p:getChassisResponse_datatype',[],1,1,true, >> > >> > undefined}, >> > >> >...], >> > >> > >> > >> >although #alt.tp is 3. >> > >> > >> > >> >I'm still walking through erlsom_write with my debugger, but I feel >> > >> >very stumped at the moment, and was wondering if someone knowledgeable >> > >> >on the list might take a peek at: >> > >> > >> > >> >http://ala.gooseyard.com/~rbailey/sys_service.wsdl >> > >> > >> > >> >to see if anything is obviously fishy with the wsdl. I have a feeling >> > >> >that it's a minor issue but I don't understand WSDL and Soap well >> > >> >enough understand what I'm looking at. >> > >> > >> > >> > Thanks in advance! >> > >> > >> > >> > .andy >> >-------------------------------------------------------------------------- >> >---- >> >"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE >> >Instantly run your Selenium tests across 300+ browser/OS combos. >> >Get unparalleled scalability from the best Selenium testing platform >> >available >> >Simple to use. Nothing to install. Get started now for free." >> >http://p.sf.net/sfu/SauceLabs >> >_______________________________________________ >> >Erlyaws-list mailing list >> >Erl...@li... >> >https://lists.sourceforge.net/lists/listinfo/erlyaws-list >> >> >> >> ------------------------------------------------------------------------------ >> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE >> Instantly run your Selenium tests across 300+ browser/OS combos. >> Get unparalleled scalability from the best Selenium testing platform >> available >> Simple to use. Nothing to install. Get started now for free." >> http://p.sf.net/sfu/SauceLabs >> _______________________________________________ >> Erlyaws-list mailing list >> Erl...@li... >> https://lists.sourceforge.net/lists/listinfo/erlyaws-list >> |