Closed Bug 254897 Opened 20 years ago Closed 20 years ago

SOAP encoding problem with complex structure and anyType

Categories

(Core Graveyard :: Web Services, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 243904

People

(Reporter: chantepie, Assigned: chantepie)

References

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040725 Firefox/0.9.1+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040725 Firefox/0.9.1+

When using SOAP with complex structure encoder does seem make proper SOAP response.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.

Actual Results:  
<enc:anyType>

Expected Results:  
<ns1:myComplexType>
We may need to allow to provide JS SOAP encoder impl. so that complex js object
would be encoded as user want
Great! This is something that I have seen also. I have been meaning to
investigate. It's one of the biggest issues that we have with asmx services
also. Thanks for doing this, I'll try to review and test this in the next few days.

(In reply to comment #2)
> We may need to allow to provide JS SOAP encoder impl. so that complex js object
> would be encoded as user want

Isn't this acutally possible if you just use the SOAP API? Its only the
wsdlproxy stuff that doesn't expose that capability outside. No?
> Isn't this acutally possible if you just use the SOAP API? Its only the
> wsdlproxy stuff that doesn't expose that capability outside. No?

How would you do that ?
Attachment #155584 - Flags: review?(keeda)
Blocks: 255624
Comment on attachment 155584 [details] [diff] [review]
Patch for the trunk

I can't think of anything that this might break.
But this stuff is very fragile so please test carefully
before checkin.

r=me if you fix the following nits. 


>   nsresult rc;
>-  PRBool needType = PR_FALSE;
>+  PRBool needType = PR_TRUE;

Move declaration of needType below, closer to where it is first needed.

[snip]

>     // find the base type and use the name of that as the element name.
>     ns = gSOAPStrings->kSOAPEncURI;
>     nsAutoString currentURI = ns;
>-    nsCOMPtr<nsISchemaType> currentType = aSchemaType;
>+    nsCOMPtr<nsISchemaType> currentType = aSchemaType;    

Don't add unnecessary whitespace noise.

>-    rc = aEncoding->GetExternalSchemaURI(gSOAPStrings->kSOAPEncURI, ns);
>+
>+    if (!typeNS.IsEmpty()) {
>+      ns.Truncate();
>+      ns.SetIsVoid(true);
>+
>+      rc = NS_OK;
>+    }
>+    else {
>+      rc = aEncoding->GetExternalSchemaURI(gSOAPStrings->kSOAPEncURI, ns);
>+    }

SetIsVoid() is not needed as far as I can see. Get rid of it
if its not doing anything useful. Truncate() is enough.
Attachment #155584 - Flags: review?(keeda) → review+
Assignee: web-services → chantepie
Status: NEW → ASSIGNED
Attachment #158237 - Flags: review?(keeda)
Attachment #158237 - Flags: review?(keeda) → review+
Attachment #158237 - Flags: superreview?(jst)
Comment on attachment 158237 [details] [diff] [review]
Fixed patch [trunk]

sr=jst
Attachment #158237 - Flags: superreview?(jst) → superreview+
Attachment #158237 - Flags: approval1.7.x?
Comment on attachment 158237 [details] [diff] [review]
Fixed patch [trunk]

This is a Gecko change that would cause a difference between 1.7 and Firefox.
Attachment #158237 - Flags: approval1.7.x? → approval1.7.x-

*** This bug has been marked as a duplicate of 243904 ***
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: