Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    #16
    Hey Guys, did you get the question below?

    Originally posted by Osa
    Hello Isomorphic

    I am still having issues with this. We looked at the WSDL and it does have the schema - its in an XSD. So SystemID is a field in an object called serviceContext which is in a different namespace and also defined in a different XSD. I am wondering if I need to load that XSD to make this work?

    Comment


      #17
      Any update?

      Comment


        #18
        Yes, you need to load the related XSD, otherwise there is no way for the system to be aware of the SystemID field at all. Note that one of the signatures for loadWSDL() has an autoLoadImports setting that will automatically load related .xsd and .wsdl files (assuming they are web accessible at the relative paths given in the main .wsdl).

        Comment


          #19
          Thanks, Isomorphic.

          Yes,
          the autoloadimports load and loads the xsds. So the useflatfields works perfectly now. When I send SystemID, Smartgwt finds the complex type as well - awesome.

          Map data = new LinkedHashMap();
          data.put("USZip", getValueAsString("ZipCode"))
          data.put("SystemID", getValueAsString("USSystemID"))

          However, now the XML that gets sent have a marshaling error because it attaches the namespace prefix to dudeContext. dudeContext object is defined in the XSD and in ns1 namesPace.

          soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Header/>
          <soap:Body xmlns:ns0="http://dudeNamespace" xmlns:ns1="http://namesPace2">

          <ns0:GetInfoByZIP>
          <AnotherINfo>338100</AnotherINfo>
          <ns0:dudeContext>
          <ns1:systemID>bob</ns1:systemID>
          </ns0:dudeContext>
          </ns0:GetInfoByZIP>
          </soap:Body>
          </soap:Envelope>


          However, when I create a testsuit in SOAPUI, it creates the right request which is below: Notice nso is not in front of dudeContext --> <dudeContext>

          snapshort of request:

          <ns0:GetInfoByZIP>
          <AnotherINfo>338100</AnotherINfo>
          <dudeContext>
          <ns1:systemID>bob</ns1:systemID>
          </dudeContext>
          </ns0:GetInfoByZIP>
          </soap:Body>


          It appears something is confusing the request creation. My question is how do I edit this request right before it fires? I can do a search and replace and remove the nso. Is there a way to edit the outgoing XML call at the zipCodeService.CallOperation(


          zipCodeService.callOperation("GetInfoByZIP", data, "//CITY", new WebServiceCallback() {

          public void execute(Object[] data, JavaScriptObject xmlDoc, RPCResponse rpcResponse,
          JavaScriptObject wsRequest) {
          ZipForm.this.setValue("City", (String) data[0]);
          }
          });


          Originally posted by Isomorphic
          Yes, you need to load the related XSD, otherwise there is no way for the system to be aware of the SystemID field at all. Note that one of the signatures for loadWSDL() has an autoLoadImports setting that will automatically load related .xsd and .wsdl files (assuming they are web accessible at the relative paths given in the main .wsdl).

          Comment


            #20
            According to the SOAP UI call, "dudeContext" is not namespaced at all. This could be some obscure WSDL usage pattern we don't yet support, or an actual flaw in the WSDL/XSD - we would need the complete WSDL and all dependent XSDs to know for sure. But if you have some control over the WSDL generation, tweaking it so that you don't have a mix of namespaced and non-namespaced elements (which is weird usage anyway) would fix the problem.

            Comment

            Working...
            X