willia4 / wsdl2objc

Automatically exported from code.google.com/p/wsdl2objc
MIT License
1 stars 0 forks source link

simple type as XML element doesn't have namespace prefix #113

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. make WSDL with XML schema which contains simple type as the Element (e.g. 
<element name="SomeDummyRequest" type="string"/>)
2. make Objective-C stubs with wsdl2objc
3. try to use them

What is the expected output?

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:ns1="http://www.w3.org/2001/XMLSchema" 
xmlns:myService="http://www.mysite.com/myschema" xsl:version="1.0">
  <soap:Body>
    <myService:SomeDummyRequest></myService:SomeDummyRequest>
  </soap:Body>
</soap:Envelope>

What do you see instead?

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:ns1="http://www.w3.org/2001/XMLSchema" 
xmlns:myService="http://www.mysite.com/myschema" xsl:version="1.0">
  <soap:Body>
    <SomeDummyRequest></SomeDummyRequest>
  </soap:Body>
</soap:Envelope>

Original issue reported on code.google.com by stiggerm...@gmail.com on 26 Aug 2010 at 7:06

GoogleCodeExporter commented 9 years ago
I'm not too sure I follow this Issue report fully, but I think my problem may 
be related. My WSDL server does not expect the namespace part added to the 
input parameters in my request, but the request generated by your code prepends 
a "service:" namespace. If I remove it in the generated code for only those 
elements all works well.

My modification looks as follows: (after only this change it all works 
correctly)

- (void)addElementsToNode:(xmlNodePtr)node
{

    if(self.GetInput != 0) {
        // xmlAddChild(node, [self.GetInput xmlNodeForDoc:node->doc elementName:@"GetInput" elementNSPrefix:@"service"]);
        xmlAddChild(node, [self.GetInput xmlNodeForDoc:node->doc elementName:@"GetInput" elementNSPrefix:@""]);
    }
}

Original comment by lailo...@gmail.com on 13 Oct 2010 at 10:33