SeongminHeo / wsdl2objc

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

Input parameters' addition of domain prefix causing trouble on my WSDL server. #131

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
My WSDL server does not expect the namespace part added to the input parameters 
in my request, but the request generated by wsdl2objc prepends a "service:" 
namespace part. So my server seems not to find my input parameters. If I remove 
it in the prefix in the generated code for input elements all works well.

Now I'm not sure if this is correct behavior or if my WSDL server is just badly 
implemented (It IS SAP, so that's not totally out of the question) but if 
someone could verify that this is perhaps the right thing to do or not I would 
be grateful.

My modification in my generated code looks as follows: (after only this change 
it all works correctly for me)
(also attaching diff to project generating code)

- (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 issue reported on code.google.com by lailo...@gmail.com on 25 Feb 2011 at 3:26

Attachments:

GoogleCodeExporter commented 8 years ago
This is because the library does not check if the elements are specified as 
"unqualified". I tried to implement this once (half a year ago), but my lack of 
code understanding and time prevented me to do so :)

Original comment by pmilosev on 25 Feb 2011 at 4:01

GoogleCodeExporter commented 8 years ago
Hi,

Same problem occurred to my webservice. I contacted SAP and they mentioned that 
as per wsdl there shouldn't be "service:" namespace part, just the input 
parameter name. So somehow generated code is not generating request xml right.

Below is the message from SAP:
----------------
Thank you for contacting SAP Active Global Support.

According to the WSDL file the input parameters should be in empty
namespace, so instead of
<Service_ZWS_PO_GETITEMSREL_ZPR_ORDERTOOL:RelCodeIn>

please use
<RelCodeIn>

This applies to all input parameters, only the 'ZB2bPoGetitemsrel'
tag has to be in the 'Service_ZWS_PO_GETITEMSREL_ZPR_ORDERTOOL'
namespace.
-----------------

Thank you for the solution above.

Regards,
Jagadish

Original comment by jagadish...@gmail.com on 11 May 2011 at 5:29

GoogleCodeExporter commented 8 years ago
No problem, as a tip, SAP also may mange custom namespaces in parameter types 
etc. such as /use/my_variable into something like this -_use-_myvariable which 
causes all kinds of havok with your generated code and compiler. I've included 
fixes for additional cleanups on another post.

Original comment by lailo...@gmail.com on 13 May 2011 at 3:52

GoogleCodeExporter commented 8 years ago
I've got the same problem.
How to remove namespace prefix for the input parameters in soap envelop?

Regards,
Victor

Original comment by nakvic on 6 Jun 2011 at 3:43

GoogleCodeExporter commented 8 years ago
Well, I just removed the prefix as shown in the example above. That fixed it 
for me. You will have to do this every time after you generate your Objective-C 
stub, and on all input parameters.

Or else you can (if you feel brave) hack it out of the generating code so it 
will be out every time...

Original comment by lailo...@gmail.com on 6 Jun 2011 at 8:31

GoogleCodeExporter commented 8 years ago
Yes, I did this. Thanks.
But, I guess, it should be fixed anyway. At least, with the simple 
configuration parameter for request class.

Will appreciate it :)

Regards,
Victor

Original comment by nakvic on 7 Jun 2011 at 8:52

GoogleCodeExporter commented 8 years ago
I faced this problem too while using a java webservice. Removing the namespace 
tag that appears in 'elementsNode' resolved the problem.

Service details:
{
    "Content-Type" = "text/xml;charset=utf-8";
    Date = "Fri, 10 Aug 2013 07:58:30 GMT";
    Server = "GlassFish Server Open Source Edition 3.1.2";
    "Transfer-Encoding" = Identity;
    "X-Powered-By" = "Servlet/3.0 JSP/2.2 (GlassFish Server Open Source Edition 3.1.2 Java/Apple Inc./1.6)";
}

Original comment by niranjan...@gmail.com on 10 Aug 2012 at 8:03