4 Replies Latest reply on Nov 2, 2007 2:57 PM by cxf02

    Problem with Web Services

    cxf02 Level 1
      I have all my classes generated, and my code plumbed in for a simple web service. But when I try to run it I get this error:
      ------------------------------------------------------------------------------------------ ---------------------------------------------------------------------------------
      TypeError: Cannot marshall type ' http://www.w3.org/2001/XMLSchema::ProPackage_type0' to simple content.
      at mx.rpc.xml::SchemaMarshaller/marshall()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\s rc\mx\rpc\xml\SchemaMarshaller.as:76]
      at mx.rpc.xml::SchemaManager/marshall()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\src\ mx\rpc\xml\SchemaManager.as:339]
      at mx.rpc.xml::XMLEncoder/marshallBuiltInType()[E:\dev\flex_3_beta2\sdk\frameworks\projects\ rpc\src\mx\rpc\xml\XMLEncoder.as:126]
      at mx.rpc.soap::SOAPEncoder/marshallBuiltInType()[E:\dev\flex_3_beta2\sdk\frameworks\project s\rpc\src\mx\rpc\soap\SOAPEncoder.as:786]
      at mx.rpc.xml::XMLEncoder/encodeType()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\src\m x\rpc\xml\XMLEncoder.as:1420]
      at mx.rpc.soap::SOAPEncoder/encodeType()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\src \mx\rpc\soap\SOAPEncoder.as:733]
      at mx.rpc.xml::XMLEncoder/encode()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\src\mx\rp c\xml\XMLEncoder.as:74]
      at mx.rpc.soap::SOAPEncoder/encode()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\src\mx\ rpc\soap\SOAPEncoder.as:676]
      at mx.rpc.soap::SOAPEncoder/encodePartValue()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rp c\src\mx\rpc\soap\SOAPEncoder.as:583]
      at mx.rpc.soap::SOAPEncoder/encodeMessage()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\ src\mx\rpc\soap\SOAPEncoder.as:534]
      at mx.rpc.soap::SOAPEncoder/encodeOperationAsDocumentLiteral()[E:\dev\flex_3_beta2\sdk\frame works\projects\rpc\src\mx\rpc\soap\SOAPEncoder.as:373]
      at mx.rpc.soap::SOAPEncoder/encodeBody()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\src \mx\rpc\soap\SOAPEncoder.as:316]
      at mx.rpc.soap::SOAPEncoder/encodeEnvelope()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc \src\mx\rpc\soap\SOAPEncoder.as:178]
      at mx.rpc.soap::SOAPEncoder/encodeRequest()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\ src\mx\rpc\soap\SOAPEncoder.as:154]
      at generated.webservices::BaseProNumberService/call()[F:\Eclipse6Workspaces\Services\WebServ ice\src\generated\webservices\BaseProNumberService.as:133]
      at generated.webservices::BaseProNumberService/proNumber()[F:\Eclipse6Workspaces\Services\We bService\src\generated\webservices\BaseProNumberService.as:117]
      at generated.webservices::ProNumberService/proNumber()[F:\Eclipse6Workspaces\Services\WebSer vice\src\generated\webservices\ProNumberService.as:73]
      at WebService/getProNumber()[F:\Eclipse6Workspaces\Services\WebService\src\WebService.mxml:7 8]
      at WebService/___WebService_Button1_click()[F:\Eclipse6Workspaces\Services\WebService\src\We bService.mxml:14]
      ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------
      It's a confusing error, because I don't have the SchemaMarshaller.as class in the E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\src\mx\rpc\xml\class in this directory. That directory doesn't exist. In fact, after searching my drive, I only show that class under my flexbuilder 2 SDK install.

      Am I missing some classes? My web service tests out fine with a java client, I'd like to make it work in Flex as well.

      Thank you,

      Curtis
        • 1. Problem with Web Services
          GabiD.
          Providing help to Curtis offline.
          • 2. Re: Problem with Web Services
            cxf02 Level 1
            Thanks Gabriel, is this the same issue? http://bugs.adobe.com/jira/browse/FB-10090 ...and how will you help me offline?

            It looks as though complex types are not able to be marshalled. But I guess you'll fill me in.

            Thanks,

            Curtis
            • 3. Re: Problem with Web Services
              AHegedus
              I'm having the same trouble. I'm trying to pull in data from a .net webservice serving a datatable, and I get the same errors. Any chance I could get some help from any of you??

              Thanks,
              Adam
              • 4. Re: Problem with Web Services
                cxf02 Level 1
                I'm sure Gabriel will share whatever they come up with. My data model is a little complex, but not overly so. Here it is:

                <?xml version="1.0" encoding="UTF-8"?>
                <xs:schema xmlns:xs=" http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace=" http://www.yrcl.com/schemas" xmlns:schemas=" http://www.yrcl.com/schemas">

                <xs:element name="ProNumberRequest">
                <xs:complexType>
                <xs:sequence>
                <xs:element ref="schemas:ProPackage"/>
                </xs:sequence>
                </xs:complexType>
                </xs:element>

                <xs:element name="ProPackage">
                <xs:complexType>
                <xs:sequence>
                <xs:element ref="schemas:scac"/>
                <xs:element ref="schemas:LocId"/>
                </xs:sequence>
                </xs:complexType>
                </xs:element>

                <xs:element name="scac" type="xs:string"/>
                <xs:element name="LocId" type="xs:integer"/>

                <xs:element name="ProNumberResponse">
                <xs:complexType>
                <xs:sequence>
                <xs:element ref="schemas:ProNumber"/>
                </xs:sequence>
                </xs:complexType>
                </xs:element>
                <xs:element name="ProNumber" type="xs:string"/>
                </xs:schema>

                I created my wsdl from this for a contract first web service. The issue is that the marshalling cannot convert the data types from a complex to a primitive or a string. I'll keep you posted.

                Curtis